MongoCursorNext[MongoCursor[…]]
returns the next document in the MongoCursor[…] object.
MongoCursorNext
MongoCursorNext[MongoCursor[…]]
returns the next document in the MongoCursor[…] object.
Details and Options
- To use MongoCursorNext, you first need to load MongoLink using Needs["MongoLink`"].
- If MongoCursorNext is called on a cursor with no more documents, Null is returned.
- Read[MongoCursor[…]] is equivalent to MongoCursorNext[MongoCursor[…]].
- MongoCursorNext corresponds to cursor.next in the MongoDB documentation.
Examples
Basic Examples (1)
Needs["MongoLink`"]client = MongoConnect[]Connect to a the "WolframTestCollection" collection in the "WolframTestDB" database:
coll = client["WolframTestDB"]["WolframTestCollection"]Find all of the documents in the collection:
cursor = MongoCollectionFind[coll]View documents in the collection one at a time:
MongoCursorNext[cursor]MongoCursorNext[cursor]MongoCursorNext[cursor]When there are no more documents in the cursor, nothing will be returned:
MongoCursorNext[cursor]cursor = MongoCollectionFind[coll]Read[cursor]Tech Notes
Related Guides
Text
Wolfram Research (2018), MongoCursorNext, Wolfram Language function, https://reference.wolfram.com/language/MongoLink/ref/MongoCursorNext.html.
CMS
Wolfram Language. 2018. "MongoCursorNext." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/MongoLink/ref/MongoCursorNext.html.
APA
Wolfram Language. (2018). MongoCursorNext. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/MongoLink/ref/MongoCursorNext.html
BibTeX
@misc{reference.wolfram_2026_mongocursornext, author="Wolfram Research", title="{MongoCursorNext}", year="2018", howpublished="\url{https://reference.wolfram.com/language/MongoLink/ref/MongoCursorNext.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_mongocursornext, organization={Wolfram Research}, title={MongoCursorNext}, year={2018}, url={https://reference.wolfram.com/language/MongoLink/ref/MongoCursorNext.html}, note=[Accessed: 12-June-2026]}