MongoGetCollection[MongoDatabase[…], name]
connects to a collection name inside the database MongoDatabase[…].
MongoGetCollection[MongoClient[…],dbname,collname]
connects to a collection collname inside the database dbname using client MongoClient[…].


MongoGetCollection
MongoGetCollection[MongoDatabase[…], name]
connects to a collection name inside the database MongoDatabase[…].
MongoGetCollection[MongoClient[…],dbname,collname]
connects to a collection collname inside the database dbname using client MongoClient[…].
Details and Options
- To use MongoGetCollection, you first need to load MongoLink using Needs["MongoLink`"].
- MongoGetCollection[…] returns a MongoCollection object.
- MongoGetCollection[MongoDatabase[…],name] is equivalent to MongoDatabase[…]["name"].
- MongoGetCollection[MongoClient[…], dbname, collname] is equivalent to MongoClient[…][dbname, collname].
- If the collection does not exist, one will be created once a document is inserted.
- MongoGetCollection corresponds to db.getCollection() in the MongoDB manual.
See Also
Tech Notes
Related Guides
Text
Wolfram Research (2018), MongoGetCollection, Wolfram Language function, https://reference.wolfram.com/language/MongoLink/ref/MongoGetCollection.html.
CMS
Wolfram Language. 2018. "MongoGetCollection." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/MongoLink/ref/MongoGetCollection.html.
APA
Wolfram Language. (2018). MongoGetCollection. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/MongoLink/ref/MongoGetCollection.html
BibTeX
@misc{reference.wolfram_2025_mongogetcollection, author="Wolfram Research", title="{MongoGetCollection}", year="2018", howpublished="\url{https://reference.wolfram.com/language/MongoLink/ref/MongoGetCollection.html}", note=[Accessed: 25-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_mongogetcollection, organization={Wolfram Research}, title={MongoGetCollection}, year={2018}, url={https://reference.wolfram.com/language/MongoLink/ref/MongoGetCollection.html}, note=[Accessed: 25-August-2025]}