Backend Session 4 (MongoDB)
Backend Session 4 (MongoDB)
1. Setup Server
2. MongoDB Compass
3. Connection String
mongodb://127.0.0.1:27017
mongodb://127.0.0.1:27017
1. Database
- Database is a store in DBMS.
- Data is kept in database.
- A database is created for every application.
- However an application can use multiple databases.
- MongoDB provides sample databases for administration
a) admin
b) local
c) config
2. Collection
- MongoDB stores the data in a collection.
- Collection represents an array of objects. [ ]
- Collection is schema less [structure less or semi-structured]
Note: SQL based database are structured and data is kept in a "Table".
NoSQL database are structure less and data is kept in a "Collection".
3. Document
- MongoDB collection is schema less and stores data in the format document.
- Document is a set of keys and values.
4. Embedded Document
- It represents a JOIN.
- Embedded document comprises a multi level hierarachy of data.
- It can join multiple views and configure the data.
SQL NoSQL
----------------------------------------------------------------------------
Database Database
Table Collection
Field Key