SlideShare a Scribd company logo
Introduction to
MongoDB
by Raghunath Akula
Data stored in 4 types
• Document
• Graph
• Key-value
• Wide-column
Overview - NoSQL Family
• An open source and Document Oriented Database.
• Data is stored in JSON like documents with no particular format.
• Developed by 10gen - Generic Public License & Commercial License.
• Designed with both Scalability and developer agility.
• High performance Database
• JSONiq – Query Language
What is MongoDB?
• Download and install suitable package for each
platform [Windows, Linux, Mac OSX, Solaris]
• Go to bin of installation folder: C:mongodb
• Type following command: mongodb – to run the server
• Run another command: mongo.exe
Installation
SQL Vs MongoDB
SQL Terms / Concepts MongoDB Terms / Concepts
database database
table collection
row document
column field
index index
Table joins (e.g. select queries) Embedded documents and linking
Primary keys _id field is always the primary key
Aggregation (e.g. group_by) Aggregation pipeline
Collections
• MongoDB stores documents in collections. Collections are analogous
to tables in relational databases.
• If a collection does not exist, MongoDB creates the collection
when you first store data for that collection.
CRUD (Create – Update – Delete)
db.createCollection(name,options)
db.myProject.insert(
[
{name:"Raghu",status:"A",grade:30,groups:["CTC","Amadeus"]},
{name:“Advik",status:"B",technologies:["Datastage","SQL"]},
{name:“Avish",grade:50,status:"A",address:{street:"2nd Avenue",zipcode:"10075"}}
]
);
db.myProject.find()  (equivalent SQL : SElECT * FROM myProject )
db.myProject.find(
{ status: “A” },  query criteria
{ name: 1, address: 1}  Projections
).limit(5)
db.myProject.find(
{ $or: [ {status: B}, { grade: { $gt: 30 } }] }
)  $lt: lesser; $gte: greater than or equal
MongoDB - Queries:
CRUD (Create – Update – Delete)
db.myProject.update (
{ grade: 30 },  update criteria
{ $set: { status: “B” } }  update action
)
MongoDB - Queries:
CRUD (Create – Update – Delete)
db.myProject.remove (
{ grade: 30 },  remove criteria
)
3 ways to perform aggregation
1. Aggregation pipeline
2. Map-Reduce function
3. Single purpose aggregation methods
1. Aggregation pipeline
db.myProject.aggregate(
[
{ $match : { grade : "A" } },  Match Stage
{ $group: { _id: “Group_A", count: { $sum: 1 } } },  Group Stage
]
)
MongoDB - Aggregation:
2. Map-Reduce function
db.myProject.aggregate(
function() { emit(this._id, this.grade); },  Map function
function(key,value){ return Array.sum(values)},  Reduce function
{
query: {status: “A”}  Query
out: “grade_total”  Output
}
)
3. Single purpose aggregation methods
• db.collection.count()
• db.collection.group()
• db.collection.distinct()
MongoDB - Aggregation:
Reference documents or linking documents
MongoDB – Embed Documents:
Use-cases
Use-case: 1– Storing Log Data
Problem Statement:
Servers generate a large number of
events (i.e. logging,) that contain useful
information about their operation including
errors, warnings, and users behavior. By
default, most servers, store these data in
plain text log files on their local file
systems.
While plain-text logs are accessible
and human-readable, they are difficult to use,
reference, and analyze without holistic
systems for aggregating and storing these
data.
Solution:
Extract the relevant information from standard request logs data into individual fields
into a document. Relevant information might be host, timestamp, user agent and referrer.
Eventually your system’s events will exceed the capacity of a single event logging
database instance. In these situations you will want to use a sharded cluster, which takes
advantage of MongoDB’s sharding functionality.
Use-case: 2 – TV Shows
Solution:
The set of information about a particular TV show is one big nested key/value data
structure. Inside a TV show, there’s an array of seasons, each of which is also a hash. Within
each season, an array of episodes, each of which is a hash, and so on. This is how MongoDB models
the data. Each TV show is a document that contains all the information we need for one show. All
of the data we need for a TV show is under one document, so it’s very fast to retrieve all this
information at once, even if the document is very large.
Problem Statement:
Each show has many seasons, each season has
many episodes, and each episode has many reviews and
many cast members. When users come into this site,
typically they go directly to the page for a
particular TV show. On that page they see all the
seasons and all the episodes and all the reviews and
all the cast members from that show, all on one page.
Thank you!!

More Related Content

What's hot (20)

MongoDb - Details on the POC
MongoDb - Details on the POCMongoDb - Details on the POC
MongoDb - Details on the POC
Amardeep Vishwakarma
 
How to leverage MongoDB for Big Data Analysis and Operations with MongoDB's A...
How to leverage MongoDB for Big Data Analysis and Operations with MongoDB's A...How to leverage MongoDB for Big Data Analysis and Operations with MongoDB's A...
How to leverage MongoDB for Big Data Analysis and Operations with MongoDB's A...
Gianfranco Palumbo
 
Open source Technology
Open source TechnologyOpen source Technology
Open source Technology
Amardeep Vishwakarma
 
MongoDB
MongoDBMongoDB
MongoDB
Bembeng Arifin
 
Social Data and Log Analysis Using MongoDB
Social Data and Log Analysis Using MongoDBSocial Data and Log Analysis Using MongoDB
Social Data and Log Analysis Using MongoDB
Takahiro Inoue
 
MongoDB for Beginners
MongoDB for BeginnersMongoDB for Beginners
MongoDB for Beginners
Enoch Joshua
 
MongoDB 101
MongoDB 101MongoDB 101
MongoDB 101
Abhijeet Vaikar
 
Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)
Kai Zhao
 
Mongo DB Presentation
Mongo DB PresentationMongo DB Presentation
Mongo DB Presentation
Jaya Naresh Kovela
 
MongoDB Schema Design by Examples
MongoDB Schema Design by ExamplesMongoDB Schema Design by Examples
MongoDB Schema Design by Examples
Hadi Ariawan
 
11 schema design & crud
11 schema design & crud11 schema design & crud
11 schema design & crud
Ahmed Elbassel
 
Mongo DB 102
Mongo DB 102Mongo DB 102
Mongo DB 102
Abhijeet Vaikar
 
MongoDB World 2019: Lessons Learned: Migrating Buffer's Production Database t...
MongoDB World 2019: Lessons Learned: Migrating Buffer's Production Database t...MongoDB World 2019: Lessons Learned: Migrating Buffer's Production Database t...
MongoDB World 2019: Lessons Learned: Migrating Buffer's Production Database t...
MongoDB
 
Connecting NodeJS & MongoDB
Connecting NodeJS & MongoDBConnecting NodeJS & MongoDB
Connecting NodeJS & MongoDB
Enoch Joshua
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentation
Hyphen Call
 
MongoDB
MongoDBMongoDB
MongoDB
Albin John
 
The Basics of MongoDB
The Basics of MongoDBThe Basics of MongoDB
The Basics of MongoDB
valuebound
 
Mongodb basics and architecture
Mongodb basics and architectureMongodb basics and architecture
Mongodb basics and architecture
Bishal Khanal
 
R statistics with mongo db
R statistics with mongo dbR statistics with mongo db
R statistics with mongo db
MongoDB
 
Introduction to MongoDB (Webinar Jan 2011)
Introduction to MongoDB (Webinar Jan 2011)Introduction to MongoDB (Webinar Jan 2011)
Introduction to MongoDB (Webinar Jan 2011)
MongoDB
 
How to leverage MongoDB for Big Data Analysis and Operations with MongoDB's A...
How to leverage MongoDB for Big Data Analysis and Operations with MongoDB's A...How to leverage MongoDB for Big Data Analysis and Operations with MongoDB's A...
How to leverage MongoDB for Big Data Analysis and Operations with MongoDB's A...
Gianfranco Palumbo
 
Social Data and Log Analysis Using MongoDB
Social Data and Log Analysis Using MongoDBSocial Data and Log Analysis Using MongoDB
Social Data and Log Analysis Using MongoDB
Takahiro Inoue
 
MongoDB for Beginners
MongoDB for BeginnersMongoDB for Beginners
MongoDB for Beginners
Enoch Joshua
 
Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)
Kai Zhao
 
MongoDB Schema Design by Examples
MongoDB Schema Design by ExamplesMongoDB Schema Design by Examples
MongoDB Schema Design by Examples
Hadi Ariawan
 
11 schema design & crud
11 schema design & crud11 schema design & crud
11 schema design & crud
Ahmed Elbassel
 
MongoDB World 2019: Lessons Learned: Migrating Buffer's Production Database t...
MongoDB World 2019: Lessons Learned: Migrating Buffer's Production Database t...MongoDB World 2019: Lessons Learned: Migrating Buffer's Production Database t...
MongoDB World 2019: Lessons Learned: Migrating Buffer's Production Database t...
MongoDB
 
Connecting NodeJS & MongoDB
Connecting NodeJS & MongoDBConnecting NodeJS & MongoDB
Connecting NodeJS & MongoDB
Enoch Joshua
 
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
 
Mongodb basics and architecture
Mongodb basics and architectureMongodb basics and architecture
Mongodb basics and architecture
Bishal Khanal
 
R statistics with mongo db
R statistics with mongo dbR statistics with mongo db
R statistics with mongo db
MongoDB
 
Introduction to MongoDB (Webinar Jan 2011)
Introduction to MongoDB (Webinar Jan 2011)Introduction to MongoDB (Webinar Jan 2011)
Introduction to MongoDB (Webinar Jan 2011)
MongoDB
 

Similar to Introduction to MongoDB (20)

Introduction To MongoDB
Introduction To MongoDBIntroduction To MongoDB
Introduction To MongoDB
ElieHannouch
 
Mongodb By Vipin
Mongodb By VipinMongodb By Vipin
Mongodb By Vipin
Vipin Mundayad
 
MongoDB installation,CRUD operation & JavaScript shell
MongoDB installation,CRUD operation & JavaScript shellMongoDB installation,CRUD operation & JavaScript shell
MongoDB installation,CRUD operation & JavaScript shell
ShahDhruv21
 
Mongo db
Mongo dbMongo db
Mongo db
Gyanendra Yadav
 
MongoDB
MongoDBMongoDB
MongoDB
wiTTyMinds1
 
Mdb dn 2016_06_query_primer
Mdb dn 2016_06_query_primerMdb dn 2016_06_query_primer
Mdb dn 2016_06_query_primer
Daniel M. Farrell
 
Mongo db basics
Mongo db basicsMongo db basics
Mongo db basics
Dhaval Mistry
 
3 scenarios when to use MongoDB!
3 scenarios when to use MongoDB!3 scenarios when to use MongoDB!
3 scenarios when to use MongoDB!
Edureka!
 
2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo
Michael Bright
 
Using MongoDB and Python
Using MongoDB and PythonUsing MongoDB and Python
Using MongoDB and Python
Mike Bright
 
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBMongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB
 
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBMongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
Lisa Roth, PMP
 
MongoDB is a document database. It stores data in a type of JSON format calle...
MongoDB is a document database. It stores data in a type of JSON format calle...MongoDB is a document database. It stores data in a type of JSON format calle...
MongoDB is a document database. It stores data in a type of JSON format calle...
amintafernandos
 
MongoDB Aggregation MongoSF May 2011
MongoDB Aggregation MongoSF May 2011MongoDB Aggregation MongoSF May 2011
MongoDB Aggregation MongoSF May 2011
Chris Westin
 
MongoDB NoSQL database a deep dive -MyWhitePaper
MongoDB  NoSQL database a deep dive -MyWhitePaperMongoDB  NoSQL database a deep dive -MyWhitePaper
MongoDB NoSQL database a deep dive -MyWhitePaper
Rajesh Kumar
 
Accra MongoDB User Group
Accra MongoDB User GroupAccra MongoDB User Group
Accra MongoDB User Group
MongoDB
 
Mongo db Quick Guide
Mongo db Quick GuideMongo db Quick Guide
Mongo db Quick Guide
Sourabh Sahu
 
MongoDB World 2019: Fast Machine Learning Development with MongoDB
MongoDB World 2019: Fast Machine Learning Development with MongoDBMongoDB World 2019: Fast Machine Learning Development with MongoDB
MongoDB World 2019: Fast Machine Learning Development with MongoDB
MongoDB
 
MediaGlu and Mongo DB
MediaGlu and Mongo DBMediaGlu and Mongo DB
MediaGlu and Mongo DB
Sundar Nathikudi
 
Novedades de MongoDB 3.6
Novedades de MongoDB 3.6Novedades de MongoDB 3.6
Novedades de MongoDB 3.6
MongoDB
 
Introduction To MongoDB
Introduction To MongoDBIntroduction To MongoDB
Introduction To MongoDB
ElieHannouch
 
MongoDB installation,CRUD operation & JavaScript shell
MongoDB installation,CRUD operation & JavaScript shellMongoDB installation,CRUD operation & JavaScript shell
MongoDB installation,CRUD operation & JavaScript shell
ShahDhruv21
 
3 scenarios when to use MongoDB!
3 scenarios when to use MongoDB!3 scenarios when to use MongoDB!
3 scenarios when to use MongoDB!
Edureka!
 
2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo
Michael Bright
 
Using MongoDB and Python
Using MongoDB and PythonUsing MongoDB and Python
Using MongoDB and Python
Mike Bright
 
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBMongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB
 
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBMongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
Lisa Roth, PMP
 
MongoDB is a document database. It stores data in a type of JSON format calle...
MongoDB is a document database. It stores data in a type of JSON format calle...MongoDB is a document database. It stores data in a type of JSON format calle...
MongoDB is a document database. It stores data in a type of JSON format calle...
amintafernandos
 
MongoDB Aggregation MongoSF May 2011
MongoDB Aggregation MongoSF May 2011MongoDB Aggregation MongoSF May 2011
MongoDB Aggregation MongoSF May 2011
Chris Westin
 
MongoDB NoSQL database a deep dive -MyWhitePaper
MongoDB  NoSQL database a deep dive -MyWhitePaperMongoDB  NoSQL database a deep dive -MyWhitePaper
MongoDB NoSQL database a deep dive -MyWhitePaper
Rajesh Kumar
 
Accra MongoDB User Group
Accra MongoDB User GroupAccra MongoDB User Group
Accra MongoDB User Group
MongoDB
 
Mongo db Quick Guide
Mongo db Quick GuideMongo db Quick Guide
Mongo db Quick Guide
Sourabh Sahu
 
MongoDB World 2019: Fast Machine Learning Development with MongoDB
MongoDB World 2019: Fast Machine Learning Development with MongoDBMongoDB World 2019: Fast Machine Learning Development with MongoDB
MongoDB World 2019: Fast Machine Learning Development with MongoDB
MongoDB
 
Novedades de MongoDB 3.6
Novedades de MongoDB 3.6Novedades de MongoDB 3.6
Novedades de MongoDB 3.6
MongoDB
 

Recently uploaded (20)

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
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
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
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
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
 
#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
 
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
 
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
 
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
 
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
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
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
 
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
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
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
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
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
 
#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
 
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
 
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
 
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
 
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
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
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
 

Introduction to MongoDB

  • 2. Data stored in 4 types • Document • Graph • Key-value • Wide-column Overview - NoSQL Family
  • 3. • An open source and Document Oriented Database. • Data is stored in JSON like documents with no particular format. • Developed by 10gen - Generic Public License & Commercial License. • Designed with both Scalability and developer agility. • High performance Database • JSONiq – Query Language What is MongoDB?
  • 4. • Download and install suitable package for each platform [Windows, Linux, Mac OSX, Solaris] • Go to bin of installation folder: C:mongodb • Type following command: mongodb – to run the server • Run another command: mongo.exe Installation
  • 5. SQL Vs MongoDB SQL Terms / Concepts MongoDB Terms / Concepts database database table collection row document column field index index Table joins (e.g. select queries) Embedded documents and linking Primary keys _id field is always the primary key Aggregation (e.g. group_by) Aggregation pipeline
  • 6. Collections • MongoDB stores documents in collections. Collections are analogous to tables in relational databases. • If a collection does not exist, MongoDB creates the collection when you first store data for that collection.
  • 7. CRUD (Create – Update – Delete) db.createCollection(name,options) db.myProject.insert( [ {name:"Raghu",status:"A",grade:30,groups:["CTC","Amadeus"]}, {name:“Advik",status:"B",technologies:["Datastage","SQL"]}, {name:“Avish",grade:50,status:"A",address:{street:"2nd Avenue",zipcode:"10075"}} ] ); db.myProject.find()  (equivalent SQL : SElECT * FROM myProject ) db.myProject.find( { status: “A” },  query criteria { name: 1, address: 1}  Projections ).limit(5) db.myProject.find( { $or: [ {status: B}, { grade: { $gt: 30 } }] } )  $lt: lesser; $gte: greater than or equal MongoDB - Queries:
  • 8. CRUD (Create – Update – Delete) db.myProject.update ( { grade: 30 },  update criteria { $set: { status: “B” } }  update action ) MongoDB - Queries: CRUD (Create – Update – Delete) db.myProject.remove ( { grade: 30 },  remove criteria )
  • 9. 3 ways to perform aggregation 1. Aggregation pipeline 2. Map-Reduce function 3. Single purpose aggregation methods 1. Aggregation pipeline db.myProject.aggregate( [ { $match : { grade : "A" } },  Match Stage { $group: { _id: “Group_A", count: { $sum: 1 } } },  Group Stage ] ) MongoDB - Aggregation:
  • 10. 2. Map-Reduce function db.myProject.aggregate( function() { emit(this._id, this.grade); },  Map function function(key,value){ return Array.sum(values)},  Reduce function { query: {status: “A”}  Query out: “grade_total”  Output } ) 3. Single purpose aggregation methods • db.collection.count() • db.collection.group() • db.collection.distinct() MongoDB - Aggregation:
  • 11. Reference documents or linking documents MongoDB – Embed Documents:
  • 13. Use-case: 1– Storing Log Data Problem Statement: Servers generate a large number of events (i.e. logging,) that contain useful information about their operation including errors, warnings, and users behavior. By default, most servers, store these data in plain text log files on their local file systems. While plain-text logs are accessible and human-readable, they are difficult to use, reference, and analyze without holistic systems for aggregating and storing these data. Solution: Extract the relevant information from standard request logs data into individual fields into a document. Relevant information might be host, timestamp, user agent and referrer. Eventually your system’s events will exceed the capacity of a single event logging database instance. In these situations you will want to use a sharded cluster, which takes advantage of MongoDB’s sharding functionality.
  • 14. Use-case: 2 – TV Shows Solution: The set of information about a particular TV show is one big nested key/value data structure. Inside a TV show, there’s an array of seasons, each of which is also a hash. Within each season, an array of episodes, each of which is a hash, and so on. This is how MongoDB models the data. Each TV show is a document that contains all the information we need for one show. All of the data we need for a TV show is under one document, so it’s very fast to retrieve all this information at once, even if the document is very large. Problem Statement: Each show has many seasons, each season has many episodes, and each episode has many reviews and many cast members. When users come into this site, typically they go directly to the page for a particular TV show. On that page they see all the seasons and all the episodes and all the reviews and all the cast members from that show, all on one page.