Professional Documents
Culture Documents
MERN Week 3
MERN Week 3
Exp goD
Rea ress B
Nod ct
.js
e.js
STA
CK
Contents
What is a database
SQL vs NoSQL databases
02
Advantages & Disadvantages
of MongoD
When to choose MongoDB ? 03
Installation
Basic Queries
Aggregation Operation
Mongoose
04
Data is a collection of discrete units of information. It can be the names of users, their ages, interests, etc. We
need a place to store this data. A database is an organized collection of data to make it easily manageable,
accessible, and easy to update. In simple terms, a database is where data is stored.
More on databases:
https://en.wikipedia.org/wiki/Database
NoSQL databases do not use SQL, and there is no "table" in NoSQL databases. They are non-tabular
databases. Instead, data is stored in JSON-like documents.
Both databases have their unique features and use. We will focus on MongoDB now, which is a NoSQL
database.
Features of MongoDB :
Flexible Schema
Horizontal Scaling
Fast Querie
Easy and convenient for developers
https://www.geeksforgeeks.org/horizontal-and-vertical-scaling-in-databases/
https://www.geeksforgeeks.org/difference-between-sql-and-nosql/
Flexible Document Schemas: MongoDB’s document model allows any data structure to be modeled and
manipulated easily
High performance: Because of the document model used in MongoDB, information can be embedded
inside a single document. This makes queries much faster and returns all the necessary information in a
single call to the database
Easy horizontal scale-out with sharding: Since MongoDB is a NoSQL database, horizontal scaling
becomes very easy and effective.
Disadvantage
Consistency of data: Mongo and other NoSQL databases are flexible and fast, but when it comes to data
consistency, NoSQL databases are not very consistent
No standard rules: There are no standard rules for the roles of NoSQL databases.
OR
Terms in MongoDB
Learn the basic terminologies of MongoDB before getting started to understand everything better.
https://www.tutorialspoint.com/mongodb/mongodb_overview.htm
Basic Queries in MongoDB for CRUD Operations
Create operations
Delete/Drop database
Aggregation Operations
Aggregations operations process data records and return computed results. Aggregation operations group
values from multiple documents together, and can perform a variety of operations on the grouped data to
return a single result.
https://www.tutorialspoint.com/mongodb/mongodb_aggregation.htm
Mongoose
What is mongoose?
In simple words, mongoose is a Node package that allows you to work with MongoDB from your NodeJS
application. Mongoose is a MongoDB object modeling tool designed to work in an asynchronous
environment.
Installing Mongoose
You can create a free account on Atlas and get a free database hosted.
Tutorial: https://www.youtube.com/watch?v=KKyag6t98g8&ab_channel=TraversyMedia
https://www.youtube.com/watch?v=5QEwqX5U_2M&ab_channel=codedamn
Submission Form
https://forms.gle/nVSq58Jowbbog6zw9