One document
db.collection.insertOne({ name: "Alice", age: 30 })
Several at once
db.collection.insertMany([{ name: "Bo" }, { name: "Cy" }])
Key Concepts
- No fixed schema required
- Each document gets a unique
_id(returned asinsertedId) - Fields can be any JSON type