MongoDB MCQ Test: MongoDB MCQs - Practice Questions
1. In MongoDB, how do you create a compound index?
2. What is the purpose of the `db.currentOp()` method in MongoDB?
3. How does MongoDB ensure high availability in a replica set?
4. What is the purpose of the `explain()` method in MongoDB?
5. What is the purpose of the $push operator in MongoDB?
6. In MongoDB, what is the primary role of the `mongos` process?
7. In MongoDB, what is the purpose of the `$nin` operator?
8. Which aggregation stage is used to group documents by a specific field?
9. What is the purpose of the `db.killOp()` method in MongoDB?
10. What is the syntax for creating an ascending index on a field in MongoDB?
11. What is the primary purpose of the MongoDB aggregation framework?
12. Which authentication mechanism is commonly used in MongoDB?
13. What is the purpose of the `db.createView()` method in MongoDB?
14. What is the purpose of the $graphLookup stage in MongoDB aggregation?
15. Explain the concept of document-level locking in MongoDB.
16. What is sharding in MongoDB?
17. How can you update multiple documents in MongoDB?
18. What is the purpose of the `$elemMatch` operator in MongoDB?
19. Explain the purpose of the $lookup stage in the MongoDB aggregation pipeline.
20. In MongoDB, what is the primary purpose of the `oplog`?
21. In MongoDB, what is the purpose of the `explain()` method?
22. In MongoDB, how can you exclude a field from the query results?
23. What is the purpose of the `ttl` index type in MongoDB?
24. Which command is used to create a new database in MongoDB?
25. Which type of data format does MongoDB primarily store?
26. What is the primary purpose of MongoDB?
27. What is the purpose of the `text` index type in MongoDB?
28. What is a covered query in MongoDB?
29. What is the `$all` operator used for in MongoDB?
30. Which operator is used for equality in MongoDB queries?
31. Explain the significance of the ObjectId in MongoDB documents.
32. Explain the difference between find() and findOne() methods in MongoDB.
33. What is the default port for MongoDB?
34. How do you query documents in MongoDB to find those with a specific value in a field?
35. What is a sharded cluster in MongoDB, and why might it be used?
36. How does MongoDB handle transactions, and what types of operations support transactions?
37. What is the purpose of the TTL (Time To Live) index in MongoDB?
38. What is the purpose of the $redact stage in MongoDB aggregation?
39. Explain the role of the oplog in MongoDB and its significance in replication.
40. What is the significance of the GridFS in MongoDB?
41. How can you perform a case-sensitive search in MongoDB?
42. Explain the concept of MongoDB change streams and their use cases.
43. What is the role of an index in MongoDB, and how does it impact query performance?
44. In MongoDB, what is a capped collection, and when might it be used?
45. In MongoDB, what does the `dbStats()` command provide?
46. In MongoDB, what is a replica set?
47. What is the purpose of the `$exists` operator in MongoDB?
48. Explain the concept of readConcern in MongoDB and its impact on data consistency.
49. In MongoDB, what is the role of the WiredTiger storage engine?
50. In MongoDB, what is a capped collection?