MongoLink`
MongoLink`

MongoCursor

MongoCursor[]

is an object which represents a cursor for iterating through documents in a MongoDB collection.

Details

  • To use MongoCursor, you first need to load MongoLink using Needs["MongoLink`"].
  • MongoCursor objects are created by a number of functions, for example MongoCollectionFind.
  • MongoCursor objects are stateful, both containing a connection to a MongoDB database and a cursor position.

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 and return a result cursor:

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

Read the first document in the cursor:

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

Read the second document in the cursor:

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

See Also

MongoCursorNext  MongoCursorToArray  MongoCollectionFind

Tutorials