MongoLink`
MongoLink`

MongoCollectionFindOne

MongoCollectionFindOne[MongoCollection[]]

returns the first document in MongoCollection.

MongoCollectionFindOne[MongoCollection[],query]

returns the first document matching the query query.

MongoCollectionFindOne[MongoCollection[],query,projection]

the fields included in the document are controlled by projection.

Details and Options

Examples

Basic Examples  (1)

Connect to a client:

Connect to a the "WolframTestCollection" collection in the "WolframTestDB" database:

Find the first document in the collection:

Find the first document in the collection that matches the query <|"age"5|>:

Find the first document in the collection that matches the query <|"age"4|>, without returning the "date" field:

Wolfram Research (2018), MongoCollectionFindOne, Wolfram Language function, https://reference.wolfram.com/language/MongoLink/ref/MongoCollectionFindOne.html.

Text

Wolfram Research (2018), MongoCollectionFindOne, Wolfram Language function, https://reference.wolfram.com/language/MongoLink/ref/MongoCollectionFindOne.html.

CMS

Wolfram Language. 2018. "MongoCollectionFindOne." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/MongoLink/ref/MongoCollectionFindOne.html.

APA

Wolfram Language. (2018). MongoCollectionFindOne. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/MongoLink/ref/MongoCollectionFindOne.html

BibTeX

@misc{reference.wolfram_2023_mongocollectionfindone, author="Wolfram Research", title="{MongoCollectionFindOne}", year="2018", howpublished="\url{https://reference.wolfram.com/language/MongoLink/ref/MongoCollectionFindOne.html}", note=[Accessed: 19-April-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_mongocollectionfindone, organization={Wolfram Research}, title={MongoCollectionFindOne}, year={2018}, url={https://reference.wolfram.com/language/MongoLink/ref/MongoCollectionFindOne.html}, note=[Accessed: 19-April-2024 ]}