MongoCollectionFind
MongoCollectionFind[MongoCollection[…]]
returns a MongoCursor containing every document in MongoCollection.
MongoCollectionFind[MongoCollection[…],query]
returns a cursor containing every document matching the query query.
MongoCollectionFind[MongoCollection[…],query,projection]
the fields included in the documents is controlled by projection.
Details and Options
- To use MongoCollectionFind, you first need to load MongoLink using Needs["MongoLink`"].
- Both query and projection are Associations.
- See "Query and Projection Operators" in the MongoDB documentation for available query and projection operators.
- The following options are supported:
-
BatchSize Automatic Controls the number of documents MongoDB will return to the client in a single network message. "Limit" None Constrains the size of a cursor’s result set. - MongoCollectionFind corresponds to db.collection.find in the MongoDB manual.
- See also the "Query Documents" and "Project Fields to Return from Query" tutorials in the MongoDB documentation.
Examples
Basic Examples (1)
Connect to a the "WolframTestCollection" collection in the "WolframTestDB" database:
Find all of the documents in the collection:
Read the first document in the cursor:
Find all of the documents in the collection that match the query <"age"5 >:
Read the first document in the cursor:
Find all of the documents in the collection that match the query <"age"4 >, without returning the "date" field:
Text
Wolfram Research (2018), MongoCollectionFind, Wolfram Language function, https://reference.wolfram.com/language/MongoLink/ref/MongoCollectionFind.html.
CMS
Wolfram Language. 2018. "MongoCollectionFind." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/MongoLink/ref/MongoCollectionFind.html.
APA
Wolfram Language. (2018). MongoCollectionFind. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/MongoLink/ref/MongoCollectionFind.html