WorksheetsMongodb
Total questions: 22
Worksheet time: 14mins
Point out the correct statement
MongoDB is classified as a NoSQL database
MongoDB favors XML format more than JSON
MongoDB is column oriented database store
All of the mentioned
MongoDB is a _________ database that provides high performance, high availability, and easy scalability.
Graph
Key value
Document
All of the mentioned
NoSQL databases is used mainly for handling large volumes of ______________ data.
Unstructured
Structured
Semi-structured
All of the mentioned
Collection is a group of MongoDB ___________?
Database
Document
Row
Table
How to get the list of databases in your system?
display dbs
db
show db
show dbs
How to create a database in mongodb?
create databaseName
new databaseName
use databaseName
None of the above
After starting the mongo shell, your session will use the (a) database by default.
method is used to query documents in collections?
(a)
Which of the following operation adds a new document to the users collection?
add
insert
truncate
drop
Which of the following is not a NoSQL database?
SQL Server
MongoDB
Cassandra
couchDB
What is the interactive shell for MongoDB called?
Mongo
dbmong
mongosh
mongodb
Which of the following line skips the first 5 documents in the bios collection and returns all remaining documents?
db.bios.find().limit( 5 )
db.bios.find().skip( 1 )
db.bios.find().skip( 5)
db.bios.find().sort( 5 )
The __________ method limits the number of documents in the result set.
limit
limitOf
limitBy
None of the Above
Which of the following method corresponds to Order by clause in SQL?
sort()
order()
orderby()
All the above
____________ method renders the document in a JSON-like format.
displayjson
printjson
printdoc
MongoDB is a _________ database that provides high performance, high availability, and easy scalability.
Graph
Key-Value
Document
All the above
What is the equivalent command in MongoDB for the following SQL query?
SELECT * FROM posts WHERE author like "%john%"
db.posts.find( { author: /john/ } )
db.posts.find( { author: {$like: /john/} } )
db.posts.find( { $like: {author: /john/} } )
db.posts.find( { author: /^john^/ } )
Which language is MongoDB written in?
C++
Java
Python
MongoC
which of the following will display only students name and GPA?
db.Students.find({},{"sName":1, "GPA":1})
db.Students.find({},{"sName":1, "GPA":1, "_id":0})
db.Students.find({},{"sName":1, "GPA":0})
db.Students.find({"sName":1, "GPA":1, "_id":0})
Which of the following will display details of sName "Sumit"?
db.Students.find({sName: "Sumit"})
db.Students.find({sName: "Sumit"},{"sName":1, "GPA":1, "_id":0})
db.Students.find({sName: "Sumit"},{"sName":1, "GPA":0})
db.Students.find({sName: Sumit})
Which of the following will display the number of students having GPA greater than 3.7?
db.Students.find({})
db.Students.find({GPA:3.7})
db.Students.find({GPA:{$gt:3.7}})
db.Students.find({$gt:{GPA:3.7}})
(a) is the command use to check current database mounted in mongodb.
