MongoDB – Create Backup In this chapter, we will see how to create a backup in MongoDB. Dump MongoDB Data To create backup of database in MongoDB, you should use mongodump command. This command will dump the entire data of your server into the dump directory. There are many options available by which you can […]
Category Archives: mongodb
MongoDB – Insert Document In this chapter, we will learn how to insert document in MongoDB collection. The insert() Method To insert data into MongoDB collection, you need to use MongoDB”s insert() or save() method. Syntax The basic syntax of insert() command is as follows − >db.COLLECTION_NAME.insert(document) Example > db.users.insert({ … _id : ObjectId(“507f191e810c19729de860ea”), … […]
MongoDB – Update Document MongoDB”s update() and save() methods are used to update document into a collection. The update() method updates the values in the existing document while the save() method replaces the existing document with the document passed in save() method. MongoDB Update() Method The update() method updates the values in the existing document. […]