Insert Methods

MongoDB provides the following methods for inserting documents into a collection:

db.collection.insertOne()Inserts a single document into a collection.
db.collection.insertMany()db.collection.insertMany() inserts multipledocuments into a collection.
db.collection.insert()db.collection.insert() inserts a single document ormultiple documents into a collection.

Additional Methods for Inserts

The following methods can also add new documents to a collection:

See the individual reference pages for the methods for more informationand examples.