WorksheetsMongoDB Quiz
Total questions: 20
Worksheet time: 10mins
MongoDB is primarily classified as:
Relational Database
Document-Oriented Database
Graph Database
Columnar Database
The default port for MongoDB is:
1433
1521
27017
3306
In MongoDB, a collection is equivalent to which in relational databases?
Row
Column
Table
Index
Which of the following formats does MongoDB use to store data internally?
JSON
BSON
XML
CSV
The _id field in MongoDB:
Is optional
Must be unique per collection
Can be changed anytime
Is only used in indexes
Which command lists all available databases in MongoDB shell?
show dbs
db.show()
show collections
list databases
Which method inserts multiple documents in MongoDB?
insert()
insertOne()
insertMany()
addDocuments()
The default storage engine in MongoDB 3.2+ is:
InnoDB
WiredTiger
MMAPv1
RocksDB
Which operator is used to match values greater than a specified value?
$lt
$lte
$gt
$eq
Which MongoDB feature allows horizontal scaling by distributing data?
Replication
Indexing
Aggregation
Sharding
Which aggregation stage groups documents by a field?
$sort
$group
$match
$limit
Which index type is used for location-based queries?
Text Index
Hashed Index
2dsphere Index
Compound Index
In replication, which node receives all write operations?
Secondary
Primary
Arbiter
Hidden Node
What is the default database when you start MongoDB shell?
default
main
admin
test
Which command shows all collections in the current database?
show collections
list tables
db.listCollections()
Both A and C
Which method is used to update only specific fields in a document?
replaceOne()
updatePartial()
updateOne() with $set
patch()
In MongoDB, replication primarily provides:
Faster queries
Data redundancy and failover
Encryption
Aggregation support
The find() method in MongoDB shell returns results in:
XML
JSON-like format (internally BSON)
CSV
YAML
Which of the following is NOT a valid MongoDB data type?
Boolean
Double
Date
Table
Which operator in MongoDB is used for pattern matching in strings?
$regex
$like
$pattern
$search
