Question:- Which command is used to drop a database?
Answer:- The db.dropDatabse() command is used to drop a database.
Question:- What is the use of the pretty() method?
Answer:- The pretty() method is used to show the results in a formatted way.
Question:- Which method is used to remove a document from a collection?
Answer:- The remove() method is used to remove a document from a collection.
Question:- Define MongoDB Projection.
Answer:- Projection is used to select only the necessary data. It does not select the whole data of a document.
Question:- What is the use of the limit() method?
Answer:- The limit() method is used to limit the records in the database.
Question:- What is the syntax of the limit() method?
Answer:- The syntax of the limit() method is as follows: >db.COLLECTION_NAME.find().limit(NUMBER)
Question:- What is the syntax of the sort() method?
Answer:- In MongoDB, the following syntax is used for sorting documents: >db.COLLECTION_NAME.find().sort({KEY:1})
Question:- Which command is used to create a backup of the database?
Answer:- The mongodump command is used to create a backup of the database.
Question:- What is a Collection in MongoDB?
Answer:- In MongoDB, a collection is a group of MongoDB documents.
Question:- What is the use of the db command?
Answer:- The db command gives the name of the currently selected database.
Question:- Which method is used to update documents into a collection?
Answer:- The update() and save() methods are used to update documents into a collection.
Question:- What is the syntax of the skip() method?
Answer:- The syntax of the skip() methopd is as follows: >db.COLLECTION_NAME.find().limit(NUMBER).skip(NUMBER)
Question:- Which command is used to restore the backup?
Answer:- The mongorestore command is used to restore the backup.
Question:- What is the use of the dot notation in MongoDB?
Answer:- MongoDB uses the dot notation to access the elements of an array and the fields of an embedded document.
