💥Work with MongoDB 💥

Eishan Dinuka
3 min readMay 14, 2021

What is MongoDB? 🤔

MongoDB is an open-source database and leads the NoSQL database. MongoDB is written in C ++. This tutorial will give you a good understanding of the MongoDB concepts needed to create and deliver an awesome and efficient database. In simple words, you can say that — Mongo DB is a document-oriented database. It is an open, developed, and supported product by a company called 10gen. MongoDB is available under a General Public license free of charge and is also available under a commercial license from the manufacturer. The production company 10gen described MongoDB as “MongoDB is a scalable, open-source, high-performance, database-oriented database.” — 10gen. MongoDB is designed to work with asset servers. It is now used by a company of all sizes, across the industry.

MongoDB

Key features of MongoDB

⭕Data represented in JSON / BSON

⭕Map/Reduce for aggregation

⭕Supports Master-Slave replication

⭕No joins nor transactions

⭕No rigid schema, which makes it dynamic

⭕Full index support for high performance

⭕Horizontally scalable and fault-tolerant (distributed data storage/sharing)

⭕Rich document-based queries for easy readability

⭕Replication and failover for high availability

When we use MongoDB?🤔

MongoDB can be used in places that require simple queries, easy and fast integration of data, and have data whose structure changes constantly with time.

✔E-commerce websites.

✔Mobile applications.

✔Blogs and content management portals.

✔Big Data

✔Content Management and Delivery

✔Mobile and Social Infrastructure

✔User Data Management

✔Data Hub

SQL vs MongoDB 🎈

SQL vs MongoDB

Collection 🙌

A collection is a group of MongoDB scripts. It is equivalent to an RDBMS table. The collection exists within a single data. Collections do not use schema. In-text texts may have different fields. Usually, all texts in a collection have the same or related purposes.

Document 👀

A document is a set of value-value pairs. The text has a dynamic schema. Dynamics schema means that documents in the same collection do not need to have the same set of fields or structure, and common fields in collective documents can hold different types of data. The following table shows the relationship between the words RDBMS and MongoDB.

Advantages and Limitations of MongoDB over RDBMS

advantages and Limitations

🟩Schemaless — MongoDB is a database of texts where one cluster contains different texts. The number of fields, the content, and the size of the document may vary from one document to another.

🟩The structure of one object is clear.

🟩No complicated joins.

🟩The ability to ask an in-depth question. MongoDB supports powerful queries in texts using a document-based query language that is as powerful as SQL.

🟩Tuning

🟩Ease of measurement — MongoDB is easy to measure.

🟩Modification/mapping of app items into unnecessary storage.

🟩It uses internal memory storage (with a window), which enables faster data access.

Connect to MongoDB using MongoDB Compass

First, click the Connect Button

Disconnect to MongoDB using MongoDB Compass

Create a Database

From the Databases tab, click the Create Database button to bring up the Create Database dialog.

After that

Enter database and first collection information and click Create Database.

After creating the database

--

--