Mongo DB
Mongo DB
MongoDB is an open source NOSQL dataset in C++, this offers flexible data models,
indexing, replication and modern applications for scalable architecture.
The MongoDB is an open-source document database and leading NoSQL database. MongoDB is written in C++.
This tutorial will give you great understanding on MongoDB concepts needed to create and deploy a highly
scalable and performance-oriented database.
MongoDB features are flexible data models that allows the storage of unstructured data. This provides full
support indexing, replication, capabilities and also user friendly APIs.
The MongoDB is a multipurpose dataset that is used for modern application development and cloud
environments. This scalable architecture enables us to handle system demands and also adding more nodes to
distribute the load.
MongoDB is a cross-platform, document oriented database that provides, high performance, high availability, and
easy scalability. MongoDB works on concept of collection and document.
Collection
Collection is a group of MongoDB documents. It is the equivalent of an RDBMS table. A collection exists within
a single database. Collections do not enforce a schema. Documents within a collection can have different fields.
Typically, all documents in a collection are of similar or related purpose.
Document
A document is a set of key-value pairs. Documents have dynamic schema. Dynamic schema means that
documents in the same collection do not need to have the same set of fields or structure, and common fields in a
collection's documents may hold different types of data.
The following table shows the relationship of RDBMS terminology with MongoDB.
RDBMS MongoDB
Database Database
Table Collection
Tuple/Row Document
column Field
Table Join Embedded Documents
Primary Key (Default key _id provided by MongoDB itself)
Primary Key
MongoDB can handle unstructured data, which provides better indexing and operations.
MongoDB ensures the development software applications that can handle all sorts of data
in a scalable way.
MongoDB is a rapid iterative development that enables the collaboration of a large
number of teams. MongoDB has become the most necessary database in the world, which
makes it easy for every developer to store, manage, and retrieve data.
MongoDB Applications
•Deep query-ability. MongoDB supports dynamic queries on documents using a document-based query
language that's nearly as powerful as SQL.
•Tuning.
•Uses internal memory for storing the (windowed) working set, enabling faster access of data.
MongoDB Basic Commands
We have a list of standard MongoDb commands to interact with the database, These commands are CREATE,
READ, INSERT, UPDATE, DELETE, DROP and AGGREGATE can be classified into following groups based on
their nature −
Command Description
CREATE Creates a new table in the database and other objects in the database.
INSERT Inserts collection name in existing database.
DROP Deletes an entire table or specified objects in the database.
UPDATE Updates the document into a collection.
Data in MongoDB has a flexible schema.documents in the same collection. They do not need to
have the same set of fields or structure Common fields in a collections documents may hold
different types of data.
3. Create Collection
4. Insert Document(s)
5. Delete Document(s)
6. Update Document(s)
7. Join Collections (Aggregation)
8. Sort
9. Query