MongoCursorToArray[MongoCursor[…]]
takes a MongoCursor object and returns a list of all remaining documents.
MongoCursorToArray
MongoCursorToArray[MongoCursor[…]]
takes a MongoCursor object and returns a list of all remaining documents.
Details and Options
- To use MongoCursorToArray, you first need to load MongoLink using Needs["MongoLink`"].
- MongoCursorToArray[cursor] completely iterates the cursor, loading all the documents into RAM and exhausting the cursor.
- ReadList[cursor] corresponds to MongoCursorToArray[cursor].
- Dataset[cursor] corresponds to Dataset[MongoCursorToArray[cursor]].
- MongoCursorToArray corresponds to cursor.toArray in the MongoDB documentation.
Examples
open all close allBasic 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 all of the documents in the collection:
MongoCursorToArray[cursor]cursor = MongoCollectionFind[coll]ReadList[cursor]Scope (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 all of the documents as a dataset:
Dataset[cursor]Tech Notes
Related Guides
Text
Wolfram Research (2018), MongoCursorToArray, Wolfram Language function, https://reference.wolfram.com/language/MongoLink/ref/MongoCursorToArray.html.
CMS
Wolfram Language. 2018. "MongoCursorToArray." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/MongoLink/ref/MongoCursorToArray.html.
APA
Wolfram Language. (2018). MongoCursorToArray. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/MongoLink/ref/MongoCursorToArray.html
BibTeX
@misc{reference.wolfram_2026_mongocursortoarray, author="Wolfram Research", title="{MongoCursorToArray}", year="2018", howpublished="\url{https://reference.wolfram.com/language/MongoLink/ref/MongoCursorToArray.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_mongocursortoarray, organization={Wolfram Research}, title={MongoCursorToArray}, year={2018}, url={https://reference.wolfram.com/language/MongoLink/ref/MongoCursorToArray.html}, note=[Accessed: 13-June-2026]}