robbiblubber.org

help | login | search:  
>>

show wiki  show source  compare to current  compare to previous  read  history 


insert()


MongoDB Driver Function Reference


Inserts multiple documents into a collection.
This method differs from the MongoDB shell implementation. It is functionally identical to insertMany(), but takes a list of documents (varargs) instead of an array. It also does not support options.



db.<collection>.insert(<document>[, ...])



Arguments


<collection> The target collection.
<document> A BSON document to insert into the collection.



Example


db.employees.insert({ name: "Miller", firstname: "Amanda", age: 29, salary: 680000 },
{ name: "Bower", firstname: "Debora", age: 46, salary: 840000 });


Inserts documents into the employees collection.














home | MongoDB Driver Function Reference | MongoDB Driver