Google News
logo
MongoDB - Interview Questions
What is a Collection in MongoDB?
A collection in MongoDB is a group of documents. If a document is the MongoDB analog of a row in a relational database, then a collection can be thought of as the analog to a table.

Documents within a single collection can have any number of different “shapes.”, i.e. collections have dynamic schemas.
 
For example, both of the following documents could be stored in a single collection:
 
{"greeting" : "Hello world!", "views": 3}
{"signoff": "Good bye"}

Advertisement