db.users.insertMany([{name: 'Alice'}, {name: 'Bob'}])

Category: Databases & SQL

db.users.insertMany([{name: 'Alice'}, {name: 'Bob'}])

Insert several documents at once

Takes an array of documents and inserts them in a single round trip, far faster than looping insertOne. Related: insertOne for a single document.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.