| |
show wiki show source compare to current compare to previous read history
insertOne()
MongoDB Driver Function Reference
Inserts a single document into a collection.
db.<collection>.insertOne(<document>[, <options>])
|
Arguments
<collection> | | The target collection |
<document> | | The BSON document to insert into the collection |
<options> | | A BOSN document specifying options |
|
Options
{ bypassDocumentValidation: <boolean> }
bypassDocumentValidation | | Document validation will be bypassed (default; false) |
|
Example
db.employees.insertOne({ name: "King", firstname: "Arthur", age: 34, salary: 780000 });
|
Inserts a document into the employees collection.
home | MongoDB Driver Function Reference | MongoDB Driver
|