CRUD Flashcards
1
Q
Write command to add record {"name": Max}
to collection coll
A
db.coll.insertOne({name: "Max"})
2
Q
Write command to add ordered bulk of records:
- {"name": Max}
- {"name": Alex}
to collection coll
A
db.coll.insertMany([ {name: "Max"}, {name:"Alex"} ])
or
~~~
db.coll.insertMany([
{name: “Max”},
{name:”Alex”}
], {ordered: true})
~~~
ordered bulk insert
3
Q
A