Docs Menu

Docs HomeMongoDB Manual

Insert Methods

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

Inserts a single document into a collection.
db.collection.insertMany() inserts multiple documents into a collection.
db.collection.insert() inserts a single document or multiple documents into a collection.

If you use MongoDB Atlas, the fully managed service for MongoDB deployments in the cloud, you can use these methods to insert documents after you connect to your cluster. To learn more, see the following resources in the MongoDB Atlas documentation:

  • Connect to Your Cluster

  • Insert and View a Document

The following methods can also add new documents to a collection, including collections hosted in MongoDB Atlas:

See the individual reference pages for the methods for more information and examples.

←  Insert DocumentsQuery Documents →