Advertisement
satishfrontenddev5

Untitled

Feb 25th, 2024
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. MongoDB Interview Questions:
  2.  
  3. What are some advantages of MongoDB?
  4. - Supports field, range-based, and string pattern matching queries
  5. - Primary and secondary index support
  6. - Uses JavaScript objects instead of procedures
  7. - Dynamic database schema
  8. - Easy scalability
  9. - Built-in support for data partitioning (Sharding)
  10.  
  11. What is a Document in MongoDB?
  12. - Ordered set of keys with associated values
  13. - Represented as a map, hash, or dictionary
  14. - Example: {"greeting": "Hello world!", "views": 3}
  15.  
  16. What is a Collection in MongoDB?
  17. - Group of documents
  18. - Analogous to a table in relational databases
  19. - Collections have dynamic schemas
  20.  
  21. What are Databases in MongoDB?
  22. - Group collections into databases
  23. - MongoDB can host several databases
  24. - Reserved database names include admin, local, config
  25.  
  26. What is the Mongo Shell?
  27. - JavaScript shell for interacting with MongoDB from the command line
  28. - Used for administrative functions, inspecting instances, and exploring MongoDB
  29. - Full-featured JavaScript interpreter
  30.  
  31. How does Scale-Out occur in MongoDB?
  32. - Document-oriented model makes it easy to split data across multiple servers
  33. - MongoDB balances and loads data across a cluster automatically
  34. - Mongos acts as a query router
  35. - Config servers store metadata and configuration settings
  36.  
  37. What are some features of MongoDB?
  38. - Indexing support
  39. - Aggregation framework
  40. - Special collection and index types (e.g., TTL collections)
  41. - File storage
  42. - Sharding for horizontal scaling
  43.  
  44. How to add data in MongoDB?
  45. - Use inserts, insertOne for single document, insertMany for multiple documents
  46.  
  47. How do you Update a Document?
  48. - Use updateOne, updateMany, or replaceOne methods
  49. - Provide filter document and modifier document for updates
  50.  
  51. How do you Delete a Document?
  52. - Use deleteOne or deleteMany methods
  53. - Specify a filter document to match against documents to be removed
  54.  
  55. How to perform queries in MongoDB?
  56. - Use the find method
  57. - Query criteria specified by a document
  58.  
  59. What are the data types in MongoDB?
  60. - Null
  61. - Boolean
  62. - Number
  63. - String
  64. - Date
  65. - Regular expression
  66. - Array
  67. - Embedded document
  68. - Object ID
  69. - Binary data
  70. - Code
  71.  
  72. When to use MongoDB?
  73. - Rapid iterative development
  74. - Scaling to high levels of read and write traffic
  75. - Scaling data repository to a massive size
  76. - Evolving deployment as business changes
  77. - Storing, managing, and searching data with various dimensions
  78.  
  79. How is Querying done in MongoDB?
  80. - Use the find method
  81. - Query criteria specified by a document
  82.  
  83. Explain the term “Indexing” in MongoDB.
  84. - Indexes help efficiently resolve queries
  85. - Stores a small part of the data set in an easily traversable form
  86. - Create indexes using createIndex method
  87.  
  88. What are Geospatial Indexes in MongoDB?
  89. - Two types: 2dsphere and 2d
  90. - 2dsphere for spherical geometries based on the WGS84 datum
  91. - 2d for points on a two-dimensional plane
  92.  
  93. Explain the process of Sharding.
  94. - Splitting data across machines
  95. - Create a cluster of many machines (shards) and break up a collection across them
  96. - Each shard stores a subset of data
  97.  
  98. Explain the SET Modifier in MongoDB?
  99. - Sets the value of a field if it doesn't exist
  100. - Useful for updating schemas or adding user-defined keys
  101.  
  102. What do you mean by Transactions?
  103. - Logical unit of processing including one or more database operations
  104. - Ensures consistency in MongoDB
  105. - Core API or Call-back API can be used
  106.  
  107. What are MongoDB Charts?
  108. - Integrated tool for data visualization in MongoDB
  109. - Offers a way to create visualizations using data from a MongoDB database
  110. - Two implementations: MongoDB Charts PaaS and MongoDB Charts Server
  111.  
  112. What is the Aggregation Framework in MongoDB?
  113. - Set of analytics tools for performing analytics on documents
  114. - Based on the concept of a pipeline
  115. - Documents pass through stages, each performing a different operation
  116.  
  117. Explain the concept of pipeline in the MongoDB aggregation framework.
  118. - Individual stage of data processing unit
  119. - Processes documents one at a time and produces output stream
  120. - Documents pass through stages sequentially
  121.  
  122. What is a Replica Set in MongoDB?
  123. - Group of servers with one primary and multiple secondaries
  124. - Primary receives write operations, secondaries keep copies of primary's data
  125. - Ensures high availability and data safety
  126.  
  127. Explain the Replication Architecture in MongoDB.
  128. - Primary receives write operations and saves data changes in the Oplog
  129. - Secondaries query primary for new changes in the Oplog and copy them
  130. - Changes applied from Oplog to secondaries' datafiles
  131.  
  132. What are some utilities for backup and restore in MongoDB?
  133. - mongoimport
  134. - mongoexport
  135. - mongodump
  136. - mongorestore
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement