MongoDB Quiz

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?

  1. Python
  2.  Perl
  3.  PHP
  4.  All the above.

Answer : 4
 
Q 2 – Which of the following is supported by MongoDB?

  1. ACID Transactions
  2.  Relationships between Collections (Primary Key – Foreign Key)
  3.  Journaling
  4.  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”;

  1. db.employees.find({“designation”:”Manager”},{“first_name” : 1,”salary”:1,”date_of_join”:1})
  2. db.employees.find({“designation”:”Manager”},{“first_name” : 1;”salary”:1;”date_of_join”:1})
  3. 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.

  1. db.employees.insert(document)
  2.   db.employees.insert().(document)
  3.  employees.insert(document)

Answer : 1
 
Q 5. ‘mongoimport’ command is used for ___________.

  1. Multiple command import
  2.   Multiple command insertion
  3.   Provides a route to import content from a JSON, CSV, or TSV export created by mongoexport.

Answer : 3
 
Q6. ‘$set’ is used for ___________.

  1.    Delete
  2.    Insert
  3.    Update

Answer : 3
 
Q7.  What does the following command do?
db.employees.find().skip(5).limit(5)

  1. Skips first five documents and then shows the sixth one five times
  2.    Shows just next five documents
  3.    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.

  1. db.employees.find({“designation:Manager”},{“date_of_join” : 1})
  2.    db.employees.find({“designation:Manager”},{“date_of_join” : 0})
  3.    db.employees.find({“designation”:”Manager”},{“date_of_join” : 0})

Answer : 3
 
Q9. Core MongoDB Operations are ?

  1.    Create, Read, Update, Delete
  2.    Create, Select, Update, Delete
  3.    Create, Read, Update, Drop

Answer : 1
 
Q10. Which of the following answers equals to SQL command – Select emp_id from employees where designation=”Manager”;

  1.    db.employees.find({“designation:manager”}
  2.    employees.find({“designation”:”manager”}
  3.    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;

  1. db.employees.find().sort({“date_of_join” : “16/10/2010″,”designation”:”Manager”}).sort({“salary”:-1})
  2.   db.employees.find({“date_of_join” : “16/10/2010″,”designation”:”Manager”}).sort({“salary”:-1})
  3.   db.employees.find({“date_of_join : 16/10/2010″,”designation:Manager”}).sort({“salary:-1”})

Answer : 2