MongoLink`
MongoLink`

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

Examples

Basic Examples  (1)

In[1]:=
Click for copyable input

Connect to a client:

In[1]:=
Click for copyable input
Out[1]=

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

In[1]:=
Click for copyable input
Out[1]=

Find all of the documents in the collection:

In[1]:=
Click for copyable input
Out[1]=

Read the first document in the cursor:

In[1]:=
Click for copyable input
Out[1]=

Find all of the documents in the collection that match the query <|"age"5|>:

In[1]:=
Click for copyable input
Out[1]=

Read the first document in the cursor:

In[1]:=
Click for copyable input
Out[1]=

Find all of the documents in the collection that match the query <|"age"4|>, without returning the "date" field:

In[1]:=
Click for copyable input
Out[1]=

Return a list of all documents in the cursor:

In[1]:=
Click for copyable input
Out[1]=

See Also

MongoCollection  MongoCollectionFindOne  MongoCollectionCount

Tutorials