MongoLink`
MongoLink`

MongoCollectionInsert

MongoCollectionInsert[MongoCollection[],doc]

inserts a document doc into the collection.

MongoCollectionInsert[MongoCollection[],{doc1,,docn}]

inserts n documents into the collection.

Details

Examples

Basic Examples  (1)

Connect to a client:

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

Create an data association to represent a document:

Insert one document into the collection:

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

Create an data association to represent a series of documents:

Insert many documents into the collection: