How are relationships between documents typically managed in MongoDB?
Foreign keys, like in relational databases.
Joins, similar to SQL.
Embedded documents or references.
Through data duplication across collections.
Which of the following is NOT a key feature of MongoDB?
Flexible document structure
Support for ACID transactions
High Scalability and Performance
Schema-less data model
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 frequently accessed together with the main document
When maintaining data integrity across multiple collections is crucial
When the related data is rarely accessed
What does the findOne() method in MongoDB return?
findOne()
The number of matching documents
All documents in the collection
An array of matching documents
The first matching document
How do you switch to a specific database, for example, a database named 'myDatabase', in the MongoDB shell?
change to myDatabase
use myDatabase
switch to myDatabase
connect myDatabase
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 is the command used to connect to a running MongoDB instance from the terminal?
connect_mongodb
mongodb-connect
mongo
start_mongo
What is the primary purpose of indexing in MongoDB?
To compress data and reduce storage space
To enforce data integrity and prevent duplicates
To store data in a sorted order for faster retrieval
To enable full-text search capabilities
Which is NOT a valid index type in MongoDB?
Array Index
Spatial Index
Full Text Index
Hashed Index
Which command in the MongoDB shell displays all available databases?
db.getDatabases()
show databases
show dbs
list databases