1.

How to add data in MongoDB?

Answer»

The BASIC method for adding DATA to MongoDB is “inserts”. To insert a single document, use the collection’s insertOne method:

> db.books.insertOne({"TITLE" : "START With Why"})

For inserting multiple documents into a collection, we use insertMany. This method enables passing an ARRAY of documents to the database.



Discussion

No Comment Found