

In SQL terminology, this is similar to a row in a database table.įield: A field is key in a document. In SQL terminology, this is similar to a database table.ĭocument: A document is a set of key-value pairs. For a better understanding, we will define these terms in comparison with Structured Query Language (SQL).ĭatabase: A database is a physical container for collections.Ĭollection: A collection is a group of MongoDB documents. The following is a detailed description of each of these. It primarily uses the concept of database, collection, and documents. However, there is no concept of a schema in MongoDB. A schema defines the infrastructure of this box An easy way to envision a schema is to think of it as a box that holds tables, stored procedures, views, and related data assets. As described in detailed here, a database schema can be defined as below:Ī database schema is a collection of database metadata that describes the relationships between objects and information in a database. In a relational database, we use a database schema. If there is no database selected while storing data, MongoDB uses this database to store data. MongoDB provides a default database named test.One document can have a certain set of fields, whereas another document can have a completely different set (both type and amount) of fields. Data stored in collections need not have a similar structure.Data is stored in BSON format (Binary encoding of JSON-like documents).A join is generally performed while storing the data by combining the documents. There are no complex joins between collections which are usually done in relational database tables.Data is stored as collections and documents. There is no concept of database schema like relational databases.It is an open-source, cross-platform, NoSQL, document-based database.

The following are a few notable features of MongoDB database: It stores data in a JSON-like format with enterprise-grade features such as high availability, scalability, and security. MongoDB is an open-source, document-based NoSQL database.
