SlideShare a Scribd company logo
Sigit Kurniawan, M.Kom
MongoDB
Contents
• SQL vs NoSQL
• NoSQL Features & Types
• What is MongoDB?
• MongoDB Features
• MongoDB Data Types
• Installation MongoDB on Windows
• MongoDB CRUD Operations
• Node.js with MongoDB
SQL vs NoSQL
SQL VS NoSQL
• NoSQL (often interpreted as Not only SQL) database
• It provides a mechanism for storage and retrieval of data that is modeled
in means other than the tabular relations used in relational databases.
SQL NoSQL
Relational Database Management System (RDBMS) Non-relational or distributed database system.
These databases have fixed or static or predefined schema They have dynamic schema
These databases are best suited for complex queries These databases are not so good for complex queries
Vertically Scalable Horizontally scalable
Follows ACID property Follows BASE property
SQL VS NoSQL
• ACID Properties:
1. Atomicity; The entire transaction
takes place at once or doesn't
happen at all
2. Consistency; The database is
consistent before and after the
transaction
3. Isolation; Multiple transactions
occur independently without
interference
4. Durability; The changes of
successful transaction occurs even if
the systems failure occurs
Relational Databases
Durability
Isolation
Atomicity Consistency
ACID
SQL VS NoSQL
• CAP Properties:
1. Consistency; that the nodes will have
the same copies of a replicated data
item visible for various transactions
2. Availability; that each read or write
request for a data item will either be
processed successfully or will receive a
message that the operation cannot be
completed
3. Partition tolerance; the system can
continue operating even if the
network connecting the nodes has a
fault that results in two or more
partitions, where the nodes in each
partition can only communicate
among each other.
NoSQL Databases
Consistency
Availability
Partition tolerance
CAP
NoSQL Features & Types
NoSQL Features & Types
Fexible Schemas
Horizotal scaling
Fast queries due
to the data model
Ease of use for
developers
FEATURES
NoSQL Features & Types
Fexible Schemas
Horizotal scaling
Fast queries due
to the data model
Ease of use for
developers
FEATURES
Document
databases
Wide-column
stores
Key-value
databases
Graph databases
TYPES
What is MongoDB?
What is MongoDB ?
A database management
system designed to
rapidly develop web
applications and internet
infrastructure.
A general-purpose
document database
designed for modern
application development
and for the cloud.
A good NoSQL document
database with a range of
features that, in the
open-source NoSQL
world, are hard to beat.
What is MongoDB ?
A database management
system designed to
rapidly develop web
applications and internet
infrastructure.
A general-purpose
document database
designed for modern
application development
and for the cloud.
A good NoSQL document
database with a range of
features that, in the
open-source NoSQL
world, are hard to beat.
Document-Oriented,
No Sequel (NoSQL)
What is MongoDB ?
Database Collections
MongoDB stores data
as JSON/BSON (Binary
JSON) documents
In MongoDB, a
collection is a group of
documents
MongoDB Features
MongoDB Features
High
Performance
Auto
Replication
Horizontal
Scalability
Load
Balancing
High
Availability
Indexing
MongoDB Data Types
MongoDB Data Types
• String
This is the most commonly used datatype to store the data. String in MongoDB must be
UTF-8 valid.
• Integer
This type is used to store a numerical value. Integer can be 32 bit or 64 bit depending
upon your server.
• Double
This type is used to store floating point values.
• Date
This datatype is used to store the current date or time in UNIX time format. You can
specify your own date time by creating object of Date and passing day, month, year
into it.
• Boolean
This type is used to store a boolean (true/ false) value.
MongoDB Data Types
• Object ID
This datatype is used to store the document’s ID.
• Array
This type is used to store arrays or list or multiple values into one key.
• Timestamp
ctimestamp. This can be handy for recording when a document has been modified or
added.
• Code
This datatype is used to store JavaScript code into the document.
• Regular Expression
This datatype is used to store regular expression.
Installation MongoDB on Windows
Installation on Windows
• Step 1: Go to MongoDB download Page
and click download as shown in the
screenshot. A .msi file like this
mongodb-win32-x86_64-2008plus-ssl-
3.4.7-signed will be downloaded in
your system. Double click on the file to
run the installer.
Installation on Windows
• Step 2: Click Run when the MongoDB
installation windows pops up.
Installation on Windows
• Step 3: Click Next when the MongoDB
installation windows pops up.
Installation on Windows
• Step 4: Accept the MongoDB user
Agreement and click Next.
Installation on Windows
• Step 5: When the setup asks you to
choose the Setup type, choose
Complete.
Installation on Windows
• Step 6: Click Next when the MongoDB
service configuration. MongoDB will be
installed in the windows service
Installation on Windows
• Step 7: Choose Install MongoDB
Compass if you want to use the
MongoDB User Interface, or ignore it
and continue by clicking Next in the
Install MongoDB Compass window
Installation on Windows
• Step 8: Click Install to begin the
installation.
MongoDB CRUD Operations
MongoDB CRUD
RDBMS MongoDB
Database Database
Table Collection
Tuple/Row Document
column Field
Table Join Embedded Documents
Primary Key
Primary Key
(Default key _id provided by MongoDB itself)
MongoDB CRUD
CREATE DATABASE
MongoDB use DATABASE_NAME is used to create database. The command will create a
new database if it doesn't exist, otherwise it will return the existing database.
SQL Create Database
• SQL Server
CREATE DATABASE databasename;
Example: CREATE DATABASE testdb;
• MySQL
CREATE DATABASE databasename;
Example: CREATE DATABASE testdb;
MongoDB CRUD
INSERT DOCUMENT
Single Insert Multiple Insert
SQL Insert Query
• SQL Server
 Single
INSERT INTO tablename (c1,c2,...)
VALUES (v11,v12,...);
 Multiple
INSERT INTO tablename (c1,c2,...)
VALUES (v11,v12,...), (v21,v22,...), ….. , (vnn,vn2,...);
• MySQL
 Single
INSERT INTO tablename (c1,c2,...)
VALUES (v11,v12,...);
 Multiple
INSERT INTO tablename (c1,c2,...)
VALUES (v11,v12,...), (v21,v22,...), ….. , (vnn,vn2,...);
MongoDB CRUD
INSERT DOCUMENT - SINGLE
MongoDB CRUD
INSERT DOCUMENT - MULTIPLE
MongoDB CRUD
QUERY DOCUMENTS
Select All Documents
Specify Equality
Specify Conditions Using Query Operators
SELECT * FROM tablename;
SELECT * FROM tablename WHERE column;
SELECT * FROM tablename WHERE columnname IN ;
MongoDB CRUD
SELECT ALL DOCUMENTS
MongoDB CRUD
SPECIFY EQUALITY
MongoDB CRUD
SPECIFY CONDITIONS USING
QUERY OPERATORS
MongoDB CRUD
QUERY DOCUMENTS
Specify “AND” Conditions
Specify “OR” Conditions
Specify “AND” as well as “OR” Conditions
MongoDB CRUD
SPECIFY “AND” CONDITIONS
MongoDB CRUD
SPECIFY “OR” CONDITIONS
MongoDB CRUD
SPECIFY “AND” AS WELL AS “OR” CONDITIONS
MongoDB CRUD
UPDATES DOCUMENTS
Single Update Updates a single
document within the
collection based on
the filter.
SQL Update Query
• SQL Server
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
• MySQL
UPDATE table_name
SET
column_name1 = expr1,
column_name2 = expr2,
...
WHERE condition;
MongoDB CRUD
UPDATES DOCUMENTS
MongoDB CRUD
UPDATES DOCUMENTS
Multiple Update
Updates all documents
that match the specified
filter for a collection.
MongoDB CRUD
UPDATES DOCUMENTS
MongoDB CRUD
UPDATES DOCUMENTS
Replace One
Replaces a single
document within the
collection based on the
filter.
MongoDB CRUD
UPDATES DOCUMENTS
MongoDB CRUD
DELETE DOCUMENTS
Single Delete
SQL Delete Query
• SQL Server
DELETE FROM table_name WHERE condition;
• MySQL
DELETE FROM table_name WHERE condition;
MongoDB CRUD
DELETE DOCUMENTS
MongoDB CRUD
DELETE DOCUMENTS
Multiple Delete
MongoDB CRUD
DELETE DOCUMENTS
Node.js with MongoDB
MongoDB.pptx
Ad

More Related Content

What's hot (20)

The Basics of MongoDB
The Basics of MongoDBThe Basics of MongoDB
The Basics of MongoDB
valuebound
 
Mongo DB
Mongo DB Mongo DB
Mongo DB
Tata Consultancy Services
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
César Trigo
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Mike Dirolf
 
MongoDB Atlas
MongoDB AtlasMongoDB Atlas
MongoDB Atlas
MongoDB
 
Mongodb vs mysql
Mongodb vs mysqlMongodb vs mysql
Mongodb vs mysql
hemal sharma
 
Copy of MongoDB .pptx
Copy of MongoDB .pptxCopy of MongoDB .pptx
Copy of MongoDB .pptx
nehabsairam
 
An Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDBAn Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDB
Lee Theobald
 
Introducing MongoDB Atlas
Introducing MongoDB AtlasIntroducing MongoDB Atlas
Introducing MongoDB Atlas
MongoDB
 
Relational databases vs Non-relational databases
Relational databases vs Non-relational databasesRelational databases vs Non-relational databases
Relational databases vs Non-relational databases
James Serra
 
Introduction to azure cosmos db
Introduction to azure cosmos dbIntroduction to azure cosmos db
Introduction to azure cosmos db
Ratan Parai
 
MongodB Internals
MongodB InternalsMongodB Internals
MongodB Internals
Norberto Leite
 
Introducing MongoDB Atlas
Introducing MongoDB AtlasIntroducing MongoDB Atlas
Introducing MongoDB Atlas
MongoDB
 
Mongo DB Presentation
Mongo DB PresentationMongo DB Presentation
Mongo DB Presentation
Jaya Naresh Kovela
 
MongoDB
MongoDBMongoDB
MongoDB
Anthony Slabinck
 
Introduction to redis
Introduction to redisIntroduction to redis
Introduction to redis
NexThoughts Technologies
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Dineesha Suraweera
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Ravi Teja
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
Marin Dimitrov
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentation
Hyphen Call
 
The Basics of MongoDB
The Basics of MongoDBThe Basics of MongoDB
The Basics of MongoDB
valuebound
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
César Trigo
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Mike Dirolf
 
MongoDB Atlas
MongoDB AtlasMongoDB Atlas
MongoDB Atlas
MongoDB
 
Copy of MongoDB .pptx
Copy of MongoDB .pptxCopy of MongoDB .pptx
Copy of MongoDB .pptx
nehabsairam
 
An Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDBAn Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDB
Lee Theobald
 
Introducing MongoDB Atlas
Introducing MongoDB AtlasIntroducing MongoDB Atlas
Introducing MongoDB Atlas
MongoDB
 
Relational databases vs Non-relational databases
Relational databases vs Non-relational databasesRelational databases vs Non-relational databases
Relational databases vs Non-relational databases
James Serra
 
Introduction to azure cosmos db
Introduction to azure cosmos dbIntroduction to azure cosmos db
Introduction to azure cosmos db
Ratan Parai
 
Introducing MongoDB Atlas
Introducing MongoDB AtlasIntroducing MongoDB Atlas
Introducing MongoDB Atlas
MongoDB
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Ravi Teja
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentation
Hyphen Call
 

Similar to MongoDB.pptx (20)

Mongo db
Mongo dbMongo db
Mongo db
Gyanendra Yadav
 
MongoDB at community engine
MongoDB at community engineMongoDB at community engine
MongoDB at community engine
mathraq
 
Mongo DB at Community Engine
Mongo DB at Community EngineMongo DB at Community Engine
Mongo DB at Community Engine
Community Engine
 
MongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data scienceMongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data science
bitragowthamkumar1
 
Introduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDBIntroduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDB
Ahmed Farag
 
Mongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorialMongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorial
Mohan Rathour
 
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
Hariharan Ganesan
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Stiliyan Kanchev
 
Hybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS ApplicationsHybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS Applications
Steven Francia
 
SQL vs MongoDB
SQL vs MongoDBSQL vs MongoDB
SQL vs MongoDB
calltutors
 
Introduction to mongodb
Introduction to mongodbIntroduction to mongodb
Introduction to mongodb
Mohammed Ragab
 
Webinar: When to Use MongoDB
Webinar: When to Use MongoDBWebinar: When to Use MongoDB
Webinar: When to Use MongoDB
MongoDB
 
MongoDB
MongoDBMongoDB
MongoDB
Serdar Buyuktemiz
 
No sq lv1_0
No sq lv1_0No sq lv1_0
No sq lv1_0
Tuan Luong
 
Mean stack
Mean stackMean stack
Mean stack
RavikantGautam8
 
A Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsA Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - Habilelabs
HabileLabs
 
NoSql Databases
NoSql DatabasesNoSql Databases
NoSql Databases
Nimat Khattak
 
Big Data, NoSQL with MongoDB and Cassasdra
Big Data, NoSQL with MongoDB and CassasdraBig Data, NoSQL with MongoDB and Cassasdra
Big Data, NoSQL with MongoDB and Cassasdra
Brian Enochson
 
NoSQL and MongoDB Introdction
NoSQL and MongoDB IntrodctionNoSQL and MongoDB Introdction
NoSQL and MongoDB Introdction
Brian Enochson
 
Database Multitenancy in Ruby
Database Multitenancy in RubyDatabase Multitenancy in Ruby
Database Multitenancy in Ruby
João Soares
 
MongoDB at community engine
MongoDB at community engineMongoDB at community engine
MongoDB at community engine
mathraq
 
Mongo DB at Community Engine
Mongo DB at Community EngineMongo DB at Community Engine
Mongo DB at Community Engine
Community Engine
 
MongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data scienceMongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data science
bitragowthamkumar1
 
Introduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDBIntroduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDB
Ahmed Farag
 
Mongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorialMongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorial
Mohan Rathour
 
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
Hariharan Ganesan
 
Hybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS ApplicationsHybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS Applications
Steven Francia
 
SQL vs MongoDB
SQL vs MongoDBSQL vs MongoDB
SQL vs MongoDB
calltutors
 
Introduction to mongodb
Introduction to mongodbIntroduction to mongodb
Introduction to mongodb
Mohammed Ragab
 
Webinar: When to Use MongoDB
Webinar: When to Use MongoDBWebinar: When to Use MongoDB
Webinar: When to Use MongoDB
MongoDB
 
A Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsA Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - Habilelabs
HabileLabs
 
Big Data, NoSQL with MongoDB and Cassasdra
Big Data, NoSQL with MongoDB and CassasdraBig Data, NoSQL with MongoDB and Cassasdra
Big Data, NoSQL with MongoDB and Cassasdra
Brian Enochson
 
NoSQL and MongoDB Introdction
NoSQL and MongoDB IntrodctionNoSQL and MongoDB Introdction
NoSQL and MongoDB Introdction
Brian Enochson
 
Database Multitenancy in Ruby
Database Multitenancy in RubyDatabase Multitenancy in Ruby
Database Multitenancy in Ruby
João Soares
 
Ad

Recently uploaded (20)

UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Ad

MongoDB.pptx

  • 2. Contents • SQL vs NoSQL • NoSQL Features & Types • What is MongoDB? • MongoDB Features • MongoDB Data Types • Installation MongoDB on Windows • MongoDB CRUD Operations • Node.js with MongoDB
  • 4. SQL VS NoSQL • NoSQL (often interpreted as Not only SQL) database • It provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases. SQL NoSQL Relational Database Management System (RDBMS) Non-relational or distributed database system. These databases have fixed or static or predefined schema They have dynamic schema These databases are best suited for complex queries These databases are not so good for complex queries Vertically Scalable Horizontally scalable Follows ACID property Follows BASE property
  • 5. SQL VS NoSQL • ACID Properties: 1. Atomicity; The entire transaction takes place at once or doesn't happen at all 2. Consistency; The database is consistent before and after the transaction 3. Isolation; Multiple transactions occur independently without interference 4. Durability; The changes of successful transaction occurs even if the systems failure occurs Relational Databases Durability Isolation Atomicity Consistency ACID
  • 6. SQL VS NoSQL • CAP Properties: 1. Consistency; that the nodes will have the same copies of a replicated data item visible for various transactions 2. Availability; that each read or write request for a data item will either be processed successfully or will receive a message that the operation cannot be completed 3. Partition tolerance; the system can continue operating even if the network connecting the nodes has a fault that results in two or more partitions, where the nodes in each partition can only communicate among each other. NoSQL Databases Consistency Availability Partition tolerance CAP
  • 8. NoSQL Features & Types Fexible Schemas Horizotal scaling Fast queries due to the data model Ease of use for developers FEATURES
  • 9. NoSQL Features & Types Fexible Schemas Horizotal scaling Fast queries due to the data model Ease of use for developers FEATURES Document databases Wide-column stores Key-value databases Graph databases TYPES
  • 11. What is MongoDB ? A database management system designed to rapidly develop web applications and internet infrastructure. A general-purpose document database designed for modern application development and for the cloud. A good NoSQL document database with a range of features that, in the open-source NoSQL world, are hard to beat.
  • 12. What is MongoDB ? A database management system designed to rapidly develop web applications and internet infrastructure. A general-purpose document database designed for modern application development and for the cloud. A good NoSQL document database with a range of features that, in the open-source NoSQL world, are hard to beat. Document-Oriented, No Sequel (NoSQL)
  • 13. What is MongoDB ? Database Collections MongoDB stores data as JSON/BSON (Binary JSON) documents In MongoDB, a collection is a group of documents
  • 17. MongoDB Data Types • String This is the most commonly used datatype to store the data. String in MongoDB must be UTF-8 valid. • Integer This type is used to store a numerical value. Integer can be 32 bit or 64 bit depending upon your server. • Double This type is used to store floating point values. • Date This datatype is used to store the current date or time in UNIX time format. You can specify your own date time by creating object of Date and passing day, month, year into it. • Boolean This type is used to store a boolean (true/ false) value.
  • 18. MongoDB Data Types • Object ID This datatype is used to store the document’s ID. • Array This type is used to store arrays or list or multiple values into one key. • Timestamp ctimestamp. This can be handy for recording when a document has been modified or added. • Code This datatype is used to store JavaScript code into the document. • Regular Expression This datatype is used to store regular expression.
  • 20. Installation on Windows • Step 1: Go to MongoDB download Page and click download as shown in the screenshot. A .msi file like this mongodb-win32-x86_64-2008plus-ssl- 3.4.7-signed will be downloaded in your system. Double click on the file to run the installer.
  • 21. Installation on Windows • Step 2: Click Run when the MongoDB installation windows pops up.
  • 22. Installation on Windows • Step 3: Click Next when the MongoDB installation windows pops up.
  • 23. Installation on Windows • Step 4: Accept the MongoDB user Agreement and click Next.
  • 24. Installation on Windows • Step 5: When the setup asks you to choose the Setup type, choose Complete.
  • 25. Installation on Windows • Step 6: Click Next when the MongoDB service configuration. MongoDB will be installed in the windows service
  • 26. Installation on Windows • Step 7: Choose Install MongoDB Compass if you want to use the MongoDB User Interface, or ignore it and continue by clicking Next in the Install MongoDB Compass window
  • 27. Installation on Windows • Step 8: Click Install to begin the installation.
  • 29. MongoDB CRUD RDBMS MongoDB Database Database Table Collection Tuple/Row Document column Field Table Join Embedded Documents Primary Key Primary Key (Default key _id provided by MongoDB itself)
  • 30. MongoDB CRUD CREATE DATABASE MongoDB use DATABASE_NAME is used to create database. The command will create a new database if it doesn't exist, otherwise it will return the existing database.
  • 31. SQL Create Database • SQL Server CREATE DATABASE databasename; Example: CREATE DATABASE testdb; • MySQL CREATE DATABASE databasename; Example: CREATE DATABASE testdb;
  • 32. MongoDB CRUD INSERT DOCUMENT Single Insert Multiple Insert
  • 33. SQL Insert Query • SQL Server  Single INSERT INTO tablename (c1,c2,...) VALUES (v11,v12,...);  Multiple INSERT INTO tablename (c1,c2,...) VALUES (v11,v12,...), (v21,v22,...), ….. , (vnn,vn2,...); • MySQL  Single INSERT INTO tablename (c1,c2,...) VALUES (v11,v12,...);  Multiple INSERT INTO tablename (c1,c2,...) VALUES (v11,v12,...), (v21,v22,...), ….. , (vnn,vn2,...);
  • 36. MongoDB CRUD QUERY DOCUMENTS Select All Documents Specify Equality Specify Conditions Using Query Operators SELECT * FROM tablename; SELECT * FROM tablename WHERE column; SELECT * FROM tablename WHERE columnname IN ;
  • 39. MongoDB CRUD SPECIFY CONDITIONS USING QUERY OPERATORS
  • 40. MongoDB CRUD QUERY DOCUMENTS Specify “AND” Conditions Specify “OR” Conditions Specify “AND” as well as “OR” Conditions
  • 43. MongoDB CRUD SPECIFY “AND” AS WELL AS “OR” CONDITIONS
  • 44. MongoDB CRUD UPDATES DOCUMENTS Single Update Updates a single document within the collection based on the filter.
  • 45. SQL Update Query • SQL Server UPDATE table_name SET column1 = value1, column2 = value2, ... WHERE condition; • MySQL UPDATE table_name SET column_name1 = expr1, column_name2 = expr2, ... WHERE condition;
  • 47. MongoDB CRUD UPDATES DOCUMENTS Multiple Update Updates all documents that match the specified filter for a collection.
  • 49. MongoDB CRUD UPDATES DOCUMENTS Replace One Replaces a single document within the collection based on the filter.
  • 52. SQL Delete Query • SQL Server DELETE FROM table_name WHERE condition; • MySQL DELETE FROM table_name WHERE condition;

Editor's Notes

  • #16: MongoDB memberikan kinerja tinggi (High Performance). Sebagian besar operasi di MongoDB lebih cepat dibandingkan dengan database relasional. MongoDB menyediakan fitur replikasi otomatis (Auto Replication) yang memungkinkan Anda memulihkan data dengan cepat jika terjadi kegagalan. Penskalaan horizontal (Horizontal Scalability) dimungkinkan di MongoDB karena berbagi. Sharding adalah mempartisi data dan menempatkannya di beberapa mesin sedemikian rupa sehingga urutan data dipertahankan. Penskalaan horizontal vs penskalaan vertikal: Penskalaan vertikal berarti menambahkan lebih banyak sumber daya ke mesin yang ada sementara penskalaan horizontal berarti menambahkan lebih banyak mesin untuk menangani data. Penskalaan vertikal tidak mudah diimplementasikan, di sisi lain penskalaan horizontal mudah diimplementasikan. Contoh basis data penskalaan horizontal: MongoDB, Cassandra dll. Penyeimbangan beban (Load Balancing): Penskalaan horizontal memungkinkan MongoDB untuk menyeimbangkan beban. Ketersediaan Tinggi (High Avalaibility): Replikasi Otomatis meningkatkan ketersediaan database MongoDB. Pengindeksan (Indexing): Indeks adalah bidang tunggal dalam dokumen. Indeks digunakan untuk menemukan data dengan cepat tanpa harus mencari setiap dokumen dalam database MongoDB. Ini meningkatkan kinerja operasi yang dilakukan pada database MongoDB.