blog image

what was the need of MongoDB although there were many databases in action?

MongoDB is a cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas. MongoDB is developed by MongoDB Inc. and licensed under the Server Side Public License (SSPL). MongoDB is a NoSQL database. There are different types of NoSQL databases, so to be specific MongoDB is an open source document based NoSQL database(I have covered NoSQL in a separate guide, link is below). This MongoDB tutorial is designed for beginners so you will be able to understand MongoDB even if you don’t have any prior knowledge of it.

MongoDB is a very JavaScript-friendly database. It exposes a JavaScript API we can use to create databases and collections of objects (called documents).In MongoDB you can store any object without having to worry about the particular fields that compose this object and how to store them. You tell MongoDB to store that object.Data is stored in a format similar to JSON, but enhanced to allow storing more than just basic data types.

Purpose of building MongoDB

  • Each database contains collections which in turn contains documents. Each document can be different with a varying number of fields. The size and content of each document can be different from each other.
  • The document structure is more in line with how developers construct their classes and objects in their respective programming languages. Developers will often say that their classes are not rows and columns but have a clear structure with key-value pairs.
  • The rows (or documents as called in MongoDB) doesn't need to have a schema defined beforehand. Instead, the fields can be created on the fly.
  • The data model available within MongoDB allows you to represent hierarchical relationships, to store arrays, and other more complex structures more easily.