MongoDB Collection

MongoDB Collection is a storage for documents. It is analogous to a table in MySQL that stores records.

MongoDB Collection

Unlike relational databases, MongoDB Collection do not have a schema. The MongoDB Document that go into a collection can have any fields. So for any change in your application’s model class, no change is required at database side which is a pro. There is no way you could describe your Collection, and it is one of the design aspects of MongoDB – No rigid schema. So if you are interested in knowing the schema of a Collection, take a look at the code that is actually writing to the Collection.

ADVERTISEMENT

Operations on a MongoDB Collection