|  |  | read  source  history  
 insertOne()MongoDB Driver Function Reference
 
 
 Inserts a single document into a collection.
 More information can be found in the corresponding entry of the MongoDB Manual.
 
 
 
 | <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
 
 
 |