Create a single document.
Section: Create and read
Insert one document
javascript
javascript
db.products.insertOne({ sku: "A100", name: "Keyboard", price: 49, in_stock: true })Explanation
Returns an inserted id for the created document.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Create and read