MongoCursor[…]
is an object which represents a cursor for iterating through documents in a MongoDB collection.
MongoCursor
MongoCursor[…]
is an object which represents a cursor for iterating through documents in a MongoDB collection.
Details and Options
- To use MongoCursor, you first need to load MongoLink using Needs["MongoLink`"].
- MongoCursor objects are created by a number of functions, for example MongoCollectionFind.
- MongoCursor objects are stateful, both containing a connection to a MongoDB database and a cursor position.
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 and return a result cursor:
curs = MongoCollectionFind[coll]Read the first document in the cursor:
MongoCursorNext[curs]Read the second document in the cursor:
MongoCursorNext[curs]Tech Notes
Related Guides
Text
Wolfram Research (2018), MongoCursor, Wolfram Language function, https://reference.wolfram.com/language/MongoLink/ref/MongoCursor.html.
CMS
Wolfram Language. 2018. "MongoCursor." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/MongoLink/ref/MongoCursor.html.
APA
Wolfram Language. (2018). MongoCursor. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/MongoLink/ref/MongoCursor.html
BibTeX
@misc{reference.wolfram_2026_mongocursor, author="Wolfram Research", title="{MongoCursor}", year="2018", howpublished="\url{https://reference.wolfram.com/language/MongoLink/ref/MongoCursor.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_mongocursor, organization={Wolfram Research}, title={MongoCursor}, year={2018}, url={https://reference.wolfram.com/language/MongoLink/ref/MongoCursor.html}, note=[Accessed: 13-June-2026]}