Effectively, each MongoDB document follows the Javascript Object Notation (JSON) format. The data fields can be of an arbitrary number and type, even within the same collection. Indexes, a fundamental feature for efficient query execution, are also supported in MongoDB on any field or subfield of the documents, and they are defined at the collection level.Ī collection contains a number of documents, and a document contains data fields. In other words, in a relational database, tables are related by keys, and in MongoDB, collections contain unstructured and often arbitrary data. ![]() In a traditional relational SQL database (i.e., MySQL, PostgreSQL), tables are used for defining the structure of a data set and rows for the actual data, while in MongoDB, we have collections and text documents containing name-value pairs, respectively. ![]() The best way to start understanding MongoDB basics is to grasp the following comparison: MongoDB
0 Comments
Leave a Reply. |