How do you drop an index named "itemName_1" on the "products" collection?
db.products.removeIndex("itemName_1")
db.products.deleteIndex("itemName_1")
db.products.dropIndex("itemName_1")
db.products.drop("itemName_1")
Why might you drop and recreate an index instead of just updating it?
All of the above
To rename the index
To improve query performance after significant data changes
To change the index type
What is the command to list all databases in a MongoDB instance?
display databases
list databases
show databases
all databases
What is a collection in MongoDB?
A user account
A table-like structure containing documents
A group of databases
A specific data type
What is the BSON data type for storing an array of values in MongoDB?
object
array
set
list
In the context of the $group stage, what does the _id field represent?
$group
_id
The field used to group documents together based on a shared value.
A placeholder for a calculated aggregate value.
The unique identifier of the document within the collection.
The total number of documents processed by the aggregation pipeline.
Which operator is commonly used within a $group stage to calculate the sum of a specific field?
$push
$avg
$sum
$max
How are relationships between documents typically managed in MongoDB?
Through data duplication across collections.
Embedded documents or references.
Foreign keys, like in relational databases.
Joins, similar to SQL.
Can you use multiple $match stages within a single aggregation pipeline?
$match
Yes, you can use multiple $match stages, and their order matters.
Yes, you can use multiple $match stages, but their order doesn't matter.
No, you can only use one $match stage per aggregation pipeline.
It depends on the version of MongoDB you are using.
How do you remove a collection named "products" from a MongoDB database?
remove collection products
drop products
db.products.drop()
delete products