Introduction

MongoDB is a No SQL database. It is an open-source, cross-platform, document-oriented database written in C++. It was developed and supported by company 10gen.

Why it was needed?
All the modern applications require big data, fast features development, flexible deployment, and the older database systems not competent enough, so the MongoDB was needed.

What is NoSQL DMS?
NoSQL database stands for “Not Only SQL” or “Not SQL.”. NoSQL is a non-relational DMS, that does not use a fixed schema and is easily scalable. NoSQL is used for Big data and real-time web apps. Web apps that need to handle a large amount of data every day like Facebook, Google use NoSQL.

Advantages of NoSQL:
i) It supports query language.
ii) It provides fast performance.
iii) It provides horizontal scalability.

Features of MongoDB:

i) Any field in a document can be indexed.
ii) Support map reduce and aggregation tools.
iii) MongoDB supports Master Slave replication.
A master can perform Reads and Writes and a Slave copies data from the master and can only be used for reads or back up.
iv) Uses JavaScript instead of Procedures.
v) It supports JSON data model with dynamic schemas.

Data model in MongoDB

In MongoDB, there is no need to crade schema before creating a database. Separate tables are not required to maintain data. Rather, data can be added to a single collection.
Steps to be followed while using MongoDB database:
1) Create a database –
If there is no existing database, the following command is used to create a new database.
Use DATABASE_NAME

2) Create Collection –
MongoDB creates collection automatically when you insert some documents.
db.createCollection(name, options) is used to create collection .
Name: is a string type, specifies the name of the collection to be created.
Options: is a document type, specifies the memory size and indexing of the collection. It is an optional parameter.

3) Insert document –
In MongoDB, the db.collection.insert() method is used to add or insert new documents into a collection in your database.

For example :
db.example.insert(
{
Book:”C Programming”,
details:{
auther:”XYZ”
publication:”abc”
},
edition:[{size:”medium”,qty:2000},{size:”Medium”,qty:3000}],
category:”Highlevellanguage”
}
)

In MongoDB, update() method is used to update or modify the existing documents of a collection.

Syntax:
db.COLLECTION_NAME.update(SELECTIOIN_CRITERIA,UPDATED_DATA)

– In MongoDB, the db.colloction.remove() method is used to delete documents from a collection.
– In MongoDB, the db.collection.find() method is used to retrieve documents from a collection. This method returns a cursor to the retrieved documents.
– In MongoDB, limit() method is used to limit the fields of document that you want to show.
db.COLLECTION_NAME.find().limit(NUMBER)
– In MongoDB, skip() method is used to skip the document. It is used with find() and limit() methods.
db.COLLECTION_NAME.find().limit(NUMBER).skip(NUMBER)

Now, if we want to develop an application which deals with a large volume of data, then we need to choose one such database which always provides a high – performance data storage solutions. So, we can achieve performance in the solution in terms of the data store and data retrieval with accuracy, speed, and reliability.
In such a case, MongoDB is one good option depending upon the requirements of your application.

Applications of MongoDB:

i) India’s Unique Identification project, aka Aadhar, is the world’s biggest biometrics database.
ii) Shutterfly is a popular internet-based photo sharing and personal publishing company that manages a store of more than 6 billion images with a transaction rate of up to 10,000 operations per second. Shutterfly is one of the companies that transitioned from Oracle to MongoDB.
iii) eBay is an American multinational internet consumer-to-consumer corporation, headquartered in San Jose. eBay has several projects running on MongoDB for search suggestions, metadata storage, cloud management, and merchandizing categorization.
iv) MetLife is a leading global provider of insurance, annuities, and employee benefit programs. They serve about 90 million customers and hold leading market positions in the United States, Japan, Latin America, Asia, Europe, and the Middle East. MetLife uses MongoDB for “The Wall”, an innovative customer service application that provides a consolidated view of MetLife customers, including policy details and transactions.

Advantages of MongoDB:

i) There may be a difference between the number of fields, content, and size of the document from one to another.
ii) Structure of a single object is clear in MongoDB.
iii) There are no complex joins in MongoDB.
iv) MongoDB provides the facility of deep query because it supports a powerful dynamic query on documents.
v) It is very easy to scale.
vi) It uses internal memory for storing working sets and this is the reason for its fast access.

References:
https://www.javatpoint.com/mongodb-tutorial
https://www.edureka.co/blog/real-world-use-cases-of-mongodb/