MongoDB Quiz
MongoDB Quiz contain set of 10 MCQ questions for MongoDB MCQ which will help you to clear beginner level quiz.
Q 1 – MongoDb is supported by?
- Python
- Perl
- PHP
- All the above.
Answer : 4
Q 2 – Which of the following is supported by MongoDB?
- ACID Transactions
- Relationships between Collections (Primary Key – Foreign Key)
- Journaling
- Transaction Management
Answer : 3
Q 3 – Which of the following is the command equivalent to
Select first_name,salary,date_of_join from employees where designation=”Manager”;
- db.employees.find({“designation”:”Manager”},{“first_name” : 1,”salary”:1,”date_of_join”:1})
- db.employees.find({“designation”:”Manager”},{“first_name” : 1;”salary”:1;”date_of_join”:1})
- db.employees.find({“designation:Manager”},{“first_name” : 1,”salary”:1,”date_of_join”:1})
Answer : 1
Q 4 – Which of the following is correct command to insert data into MongoDB?
Assume that document is a valid JSON document.
- db.employees.insert(document)
- db.employees.insert().(document)
- employees.insert(document)
Answer : 1
Q 5. ‘mongoimport’ command is used for ___________.
- Multiple command import
- Multiple command insertion
- Provides a route to import content from a JSON, CSV, or TSV export created by mongoexport.
Answer : 3
Q6. ‘$set’ is used for ___________.
- Delete
- Insert
- Update
Answer : 3
Q7. What does the following command do?
db.employees.find().skip(5).limit(5)
- Skips first five documents and then shows the sixth one five times
- Shows just next five documents
- Skips first five documents and then shows just next five documents.
Answer : 3
Q8. Which of the following is equivalent to this :
select first_name,salary from employees where designation=”Manager”;
Assume that there are three columns first_name,salary,date_of_join.
- db.employees.find({“designation:Manager”},{“date_of_join” : 1})
- db.employees.find({“designation:Manager”},{“date_of_join” : 0})
- db.employees.find({“designation”:”Manager”},{“date_of_join” : 0})
Answer : 3
Q9. Core MongoDB Operations are ?
- Create, Read, Update, Delete
- Create, Select, Update, Delete
- Create, Read, Update, Drop
Answer : 1
Q10. Which of the following answers equals to SQL command – Select emp_id from employees where designation=”Manager”;
- db.employees.find({“designation:manager”}
- employees.find({“designation”:”manager”}
- db.employees.find({“designation”:”manager”}
Answer : 3
Q11. Which one of the following answers is equivalent to this SQL command :
Select * from employees where date_of_join=”16/10/2010″
and designation=”Manager” order by salary desc;
- db.employees.find().sort({“date_of_join” : “16/10/2010″,”designation”:”Manager”}).sort({“salary”:-1})
- db.employees.find({“date_of_join” : “16/10/2010″,”designation”:”Manager”}).sort({“salary”:-1})
- db.employees.find({“date_of_join : 16/10/2010″,”designation:Manager”}).sort({“salary:-1”})
Answer : 2