What is the primary purpose of MongoDB drivers?
To visualize data stored in MongoDB
To store data in a relational database
To perform data analysis within MongoDB
To interact with MongoDB databases from application code
Which data type in MongoDB ensures that all documents in a collection have a specific field?
key
required
There is no such data type.
mandatory
Which command in the MongoDB shell displays all available databases?
list databases
show dbs
db.getDatabases()
show databases
Can you use multiple $match stages within a single aggregation pipeline?
$match
It depends on the version of MongoDB you are using.
Yes, you can use multiple $match stages, and their order matters.
No, you can only use one $match stage per aggregation pipeline.
Yes, you can use multiple $match stages, but their order doesn't matter.
What is the primary purpose of the MongoDB Aggregation Framework?
Processing and analyzing data to extract meaningful insights.
Performing CRUD (Create, Read, Update, Delete) operations on documents.
Defining the schema and structure of MongoDB collections.
Managing user authentication and authorization.
What is the purpose of the insert_one() method in the Python MongoDB driver?
insert_one()
To update an existing document in a collection
To delete a document from a collection
To add a new document to a collection
To retrieve a single document from a collection
How do you drop an index named "itemName_1" on the "products" collection?
db.products.deleteIndex("itemName_1")
db.products.dropIndex("itemName_1")
db.products.removeIndex("itemName_1")
db.products.drop("itemName_1")
When is it generally preferred to embed data in a document rather than referencing it in MongoDB?
When minimizing document size is a top priority
When the related data is rarely accessed
When the related data is frequently accessed together with the main document
When maintaining data integrity across multiple collections is crucial
MongoDB's ability to handle massive datasets and high traffic is attributed to its:
Horizontal scaling capabilities
Strong data consistency guarantees
Advanced indexing techniques
Use of SQL for querying
What MongoDB shell command is used to insert a new document into a collection?
db.collection.insert()
db.collection.create()
db.collection.put()
db.collection.add()