Create or Insert Operation in MongoDB

a) db.collection.insert() - Version 2.6

b) db.collection.save() - Version 2.6  

The save() method uses either the insert or the update command. If record already exit the it updates else insert the new document.

c) db.collection.insertOne() - Version 3.2

d) db.collection.insertMany() - Version 3.2

 

Share This:

Leave a Reply

Your email address will not be published. Required fields are marked *