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.
更多信息和选项
- 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.
范例
基本范例 (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:
文本
Wolfram Research (2018),MongoCollectionFind,Wolfram 语言函数,https://reference.wolfram.com/language/MongoLink/ref/MongoCollectionFind.html.
CMS
Wolfram 语言. 2018. "MongoCollectionFind." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/MongoLink/ref/MongoCollectionFind.html.
APA
Wolfram 语言. (2018). MongoCollectionFind. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/MongoLink/ref/MongoCollectionFind.html 年