Skip to main content

How to add data in MongoDB?

Published 1 min readMarkdown
Part of seriesMongoDB
How to add data in MongoDB?

The MongoDB shell provides the following methods to insert documents into a collection:

  • To insert a single document, use db.collection.insertOne()
  • To insert multiple documents, use db.collection.insertMany()

Sources:

Insert Documents — MongoDB Shell. www.mongodb.com/docs/mongodb-shell/crud/insert.

About the author

  • Full Stack Developer with a passion for building web applications. PHP, Node.js, Laravel, MySQL, MongoDB. Love collaborating & making a difference

No comments yet. Be the first to comment.

More from this blog