MongoDB Basics
MongoDB Basics
Adapted from
https://www.guru99.com/mongodb-tutorials.html
Intro,
Architecture,
Features
What is MongoDB
● {
● "Name": "Tom",
● The document has simple structure and very ● "Age": 30,
easy to understand the content ● "Role": "Student",
compared to XML. }
{
● For data delivery between servers and browsers,
● "Name": “Sam",
JSON is a better choice
● "Age": 32,
● Easy in parsing, processing, validating in all ● "Role": "Student",
languages ● "University": “OU",
oriented system. ]
RDBMS vs MongoDB
RDBMS MongoDB Difference
Table Collection In RDBMS, the table contains the columns and rows which are used to store the data whereas, in MongoDB,
this same structure is known as a collection. The collection contains documents which in turn contains Fields,
which in turn are key-value pairs.
Row Document In RDBMS, the row represents a single, implicitly structured data item in a table. In MongoDB, the data is
stored in documents.
Column Field In RDBMS, the column denotes a set of data values. These in MongoDB are known as Fields.
Joins Embedded In RDBMS, data is spread across various tables and in order to show a complete view of all
documents data, a join is formed across tables to get the data. In MongoDB, the data is normally
stored in a single collection, but separated by using Embedded documents. So there is no
concept of joins in MongoDB.
CRUD Operations
Create Database, Collections
Python MongoDB