Which command creates a new collection in the currently active database?
make collection
db.createCollection()
create collection
new collection()
What is the function of the $project stage in the aggregation pipeline?
$project
To sort documents in ascending or descending order.
To group documents based on shared values.
To filter documents based on matching criteria.
To reshape and transform the structure of output documents.
Which command in the MongoDB shell displays all available databases?
show dbs
db.getDatabases()
show databases
list databases
What is a collection in MongoDB?
A table-like structure containing documents
A user account
A group of databases
A specific data type
How do you verify that the MongoDB server has started successfully?
Use the systemctl status mongod command to view the service's status
Check the log file for messages indicating successful startup
Try to connect to the MongoDB server using the mongo shell
All of the above
What is the default data directory for MongoDB?
/etc/mongodb.conf
/bin/mongod
/log/mongodb.log
/var/lib/mongodb
Which of the following is NOT a key consideration when designing a schema in MongoDB?
Document size and growth potential
Data relationships and access patterns
Data normalization to eliminate redundancy
Query patterns and performance requirements
Which aggregation stage is used to filter documents based on specified criteria?
$group
$match
$sort
What is a potential drawback of excessive embedding in MongoDB?
Difficulties in updating related data consistently
Larger document sizes, potentially impacting storage and retrieval speed
Increased query complexity and reduced performance
Inability to represent one-to-many relationships effectively
Which operator is commonly used within a $group stage to calculate the sum of a specific field?
$push
$avg
$max
$sum