In a MongoDB cluster, which component acts as a query router and distributes requests to the appropriate shards?
Config Server
Primary Node
Replica Set
Mongos
In the context of the $group stage, what does the _id field represent?
$group
_id
The total number of documents processed by the aggregation pipeline.
A placeholder for a calculated aggregate value.
The field used to group documents together based on a shared value.
The unique identifier of the document within the collection.
What is the BSON data type for storing an array of values in MongoDB?
list
set
object
array
Which command is used to create a new database in MongoDB?
new database
use database
make database
create database
What is the primary advantage of MongoDB's flexible schema design?
Faster query performance
Improved data integrity
Simplified data modeling and agility
Reduced storage space requirements
What is the purpose of replica sets in MongoDB?
Load Balancing
High Availability and Data Redundancy
Data Sharding
Query Optimization
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 reshape and transform the structure of output documents.
To filter documents based on matching criteria.
How do you delete a database in MongoDB?
delete database
remove database
erase database
drop database
How do you switch to a specific database, for example, a database named 'myDatabase', in the MongoDB shell?
use myDatabase
change to myDatabase
switch to myDatabase
connect myDatabase
The Attribute Pattern in MongoDB is best suited for:
Storing a large, sparse matrix of data
Managing evolving schemas and varying attributes for different documents
Representing hierarchical relationships between entities
Optimizing geospatial queries for location-based data