How do you verify that the MongoDB server has started successfully?
All of the above
Try to connect to the MongoDB server using the mongo shell
Use the systemctl status mongod command to view the service's status
Check the log file for messages indicating successful startup
What is the primary purpose of indexing in MongoDB?
To compress data and reduce storage space
To enable full-text search capabilities
To enforce data integrity and prevent duplicates
To store data in a sorted order for faster retrieval
What does the findOne() method in MongoDB return?
findOne()
An array of matching documents
The number of matching documents
All documents in the collection
The first matching document
Which command is used to create an index in MongoDB?
db.collection.insertIndex()
db.collection.ensureIndex()
db.collection.createIndex()
db.collection.addIndex()
How would you count the number of documents in each group using the $group stage?
$group
Use $total: 1
$total: 1
Use $count: 1
$count: 1
Use $size: 1
$size: 1
Use $sum: 1
$sum: 1
How are relationships between documents typically managed in MongoDB?
Embedded documents or references.
Foreign keys, like in relational databases.
Joins, similar to SQL.
Through data duplication across collections.
Referencing in MongoDB involves:
Creating a link (usually an ObjectId) to the related document in another collection
Storing a copy of the related data within the main document
Merging multiple documents into a single entity
Defining a strict one-to-one relationship between documents
Which of the following is NOT a commonly used MongoDB driver?
Java driver
Node.js driver
Python driver
C# driver
Which command in the MongoDB shell displays all available databases?
list databases
show databases
db.getDatabases()
show dbs
What is a core concept of data modeling in MongoDB?
Strictly enforcing data types and relationships
Representing data in a tabular format with rows and columns
Organizing data into documents with a flexible schema
Using joins to query data across multiple collections