MongoLink`
MongoLink`

MongoInsertResult

MongoInsertResult[]

an object representing the result of a MongoDB insertion operation.

Details

  • To use MongoInsertResult, you first need to load MongoLink using Needs["MongoLink`"].
  • A MongoInsertResult object is returned from MongoCollectionInsert.
  • MongoInsertResult[]["InsertedIDs"] returns a list of the primary keys of the inserted documents.
  • Normal[MongoInsertResult[]] returns an Association with keys "InsertedCount", "Acknowledged" and "InsertedIDs".

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]=

Create an data association to represent a document:

In[1]:=
Click for copyable input

Insert one document into the collection:

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

Obtain a list of the primary keys of the inserted documents:

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

See Also

MongoCollection  MongoCollectionInsert

Tutorials