Site icon i2tutorials

MongoDB Advanced – Quiz

This Quiz contains totally 25 Questions each carry 1 point for you.

1. What does ACID stand for in the context of MongoDB transactions?
Applicability, Compliance, Identification, Determination
Atomicity, Consistency, Isolation, Durability
Application, Connection, Integration, Development
Adaptability, Conversion, Interaction, Delivery

Correct!

Wrong!

2. What is a replica set in MongoDB?
A set of copied databases
A set of original databases
A set of divided databases
A set of integrated database

Correct!

Wrong!

3. In MongoDB, what is sharding used for?
To reduce the size of the database
To replicate the database
To distribute data across multiple machines
To encrypt the data in the database

Correct!

Wrong!

4. Which of the following can be used for authentication in MongoDB?
SCRAM-SHA-256
MySQL password
Node.js password
HTML password

Correct!

Wrong!

5. What module is used in Node.js to connect to a MongoDB database?
Express.js
Angular.js
React.js
Mongoose.js

Correct!

Wrong!

6. How can you begin a transaction in MongoDB?
db.session.startTransaction()
db.begin()
db.transaction.start()
db.start()

Correct!

Wrong!

7. What is the primary function of the oplog in MongoDB replication?
It stores user data.
It records all changes to the database's data.
It records all the failed transactions.
It stores the authentication details.

Correct!

Wrong!

8. What is a 'shard key' in MongoDB?
A key to encrypt the data
The key used in the primary index
The field used to distribute documents across shards
A foreign key that connects two tables

Correct!

Wrong!

9. Which of the following is not a role in MongoDB's Role-Based Access Control (RBAC)?
read
readWrite
dbAdmin
dbEncrypt

Correct!

Wrong!

10. What is the 'callback' argument in MongoClient.connect() in Node.js MongoDB?
The username to connect to the MongoDB database
The password to connect to the MongoDB database
The function to execute when the connection is completed
The URL of the MongoDB database to connect to

Correct!

Wrong!

11. In MongoDB, what does a two-phase commit ensure?
That a transaction is divided into two parts
That a transaction is either fully completed or not done at all
That a transaction can be split between two databases
That a transaction will be done in two steps, no matter what

Correct!

Wrong!

12. What role does a primary member play in MongoDB replication?
It only contains a backup of the data
It can accept write operations
It can never be a part of the replica set
It only has read operations enabled

Correct!

Wrong!

13. Which of the following is true about the partitioning of data in MongoDB?
The process of partitioning in MongoDB is called replication
Partitioning cannot be done in MongoDB
The process of partitioning in MongoDB is called sharding
Partitioning in MongoDB results in data redundancy

Correct!

Wrong!

14. What is X.509 in the context of MongoDB Security?
A hashing algorithm
A symmetric key algorithm
An encryption method
An authentication method

Correct!

Wrong!

15. How can you create a new document in MongoDB using Node.js?
db.collection.insertOne()
db.collection.create()
db.collection.newDocument()
db.collection.add()

Correct!

Wrong!

16. Which of the following is true about multi-document transactions in MongoDB?
They are not supported by MongoDB
They are only available in the Enterprise version
They can be used across multiple databases, collections, and documents
They can only be used in a single collection

Correct!

Wrong!

17. In MongoDB replication, what is the 'heartbeat'?
A data integrity check across all nodes
A signal sent between members of the replica set to check if they're still online
The primary node's way of assigning tasks to the secondary nodes
The process of copying data from the primary to the secondary nodes

Correct!

Wrong!

18. What is the main benefit of sharding in MongoDB?
It allows for faster search queries
It provides a backup of the data
It reduces the load on a single database by distributing data
It prevents data from being lost

Correct!

Wrong!

19. Which of the following mechanisms are part of MongoDB's security features?
Role-Based Access Control
Transport Layer Security
Encryption at Rest
All of the above

Correct!

Wrong!

20. Which of the following functions is used to close a MongoDB database connection in Node.js?
db.close()
client.close()
connection.end()
db.end()

Correct!

Wrong!

21. How can you handle errors in MongoDB transactions?
With the abortTransaction() method
With the error() method
With the fail() method
With the reject() method

Correct!

Wrong!

22. In MongoDB replication, what is a secondary member?
It accepts both read and write operations
It accepts only write operations
It replicates the data from the primary member and can serve read operations
It does not store any data

Correct!

Wrong!

23. In MongoDB replication, what is a secondary member?
It accepts both read and write operations
It accepts only write operations
It replicates the data from the primary member and can serve read operations
It does not store any data

Correct!

Wrong!

24. How does MongoDB handle Authorization?
Through IP Whitelisting
Through Role-Based Access Control (RBAC)
Through password-only based access
MongoDB does not have an authorization mechanism

Correct!

Wrong!

25. How can you delete a document in MongoDB using Node.js?
db.collection.remove()
db.collection.deleteOne()
db.collection.drop()
db.collection.destroy()

Correct!

Wrong!

Share the quiz to show your results !

Subscribe to see your results

Ignore & go to results

MongoDB Advanced – Quiz

You got %%score%% of %%total%% right

%%description%%

%%description%%

Loading...

Exit mobile version