SlideShare a Scribd company logo
Mongo DB: Fundamentals & Basics
By Pawan
 We have INSTRUCTOR LED - both Online LIVE & Classroom Session
 Present for classroom sessions in Bangalore & Delhi (NCR)
 We are the ONLY Education delivery partners for Mulesoft, Elastic, Pivotal & Lightbend in India
 We have delivered more than 5000 trainings and have over 400 courses and a vast pool of over 200 experts to
make YOU the EXPERT!
FOLLOW US ON SOCIAL MEDIA TO STAY UPDATED ON THE UPCOMING WEBINARS
Online and Classroom Training on Technology Courses at
SpringPeople
Non-Certified Courses
…and many more
Certified Partners
What is MongoDB
 MongoDB is an open-source document database and leading NoSQL database
 Schema less
 Stores JSON objects
 document oriented database that provides
 high performance
 high availability
 easy scalability
7/28/2016Pawan Tiwari
Why MongoDB
 Document Oriented Storage: Data is stored in the form of JSON style
documents.
 Index on any attribute
 Geo Location support
 Replication and high availability
 Auto-sharding
 Rich queries
 Fast in-place updates
 Professional support by MongoDB
7/28/2016Pawan Tiwari
MongoDB Overview
 Database
 Physical Container of Collection
 Collections
 Collection is a group of MongoDB documents
 equivalent of an RDBMS table
 Collections do not enforce a schema.
 Document
 set of key-value pairs.
 Documents have dynamic schema
7/28/2016Pawan Tiwari
RDBMS and MongoDB
 Database  Database
 Table  Collection
 Row  Document
 Column  Field
7/28/2016Pawan Tiwari
Sample Document
{
_id: ObjectId(7df78ad8902c)
a: ‘1’,
b: ‘2’
}
7/28/2016Pawan Tiwari
Advantages of MongoDB
 Schema less
 Structure of a single object is clear.
 No complex joins.
 Supports dynamic queries on documents using a document-based query
language that's nearly as powerful as SQL.
 Tuning.
 Ease of scale-out: MongoDB is easy to scale.
 Conversion/mapping of application objects to database objects not needed.
 Uses internal memory for storing the (windowed) working set, enabling faster
access of data
7/28/2016Pawan Tiwari
Create Collection
 Db.createcollection(“collection_name” Options)
 Example:
MongoDB shell version: 2.4.14
connecting to: test
> show dbs
local 0.078125GB
test 0.203125GB
> use test
switched to db test
> db.createCollection("test_collection")
{ "ok" : 1 }
>
7/28/2016Pawan Tiwari
Drop Collection
 db.COLLECTION_NAME.drop()
MongoDB shell version: 2.4.14
connecting to: test
> show collections
system.indexes
test_collection
> db.test_collection.drop()
true
7/28/2016Pawan Tiwari
Insert Document
 db.COLLECTION_NAME.insert(document)
>db.test_collection.insert({
title: 'MongoDB Webinar',
description: 'MongoDB is a high-performance, open source, schema- free,
document/object-oriented database optimized for web application environments, and
is perhaps one of the most disruptive software technologies in years. MongoDB will
fundamentally change the way participants think about data persistence. In this
webinar know the fundamentals of designing and building applications using
MongoDB',
by: 'SpringPeople',
url: 'http://www.springpeople.com/webinars/mongodb-developer-fundamentals-and-
basics',
})
7/28/2016Pawan Tiwari
Query Document
 db.COLLECTION_NAME.find(document)
Example:
>db.test_collection.find()
>db.test_collection.find().pretty()
>db.test_collection.find({"title" : "MongoDB Webinar"})
> db.test_collection.find({"title" : "MongoDB Webinar"},{"by":1}).pretty()
{ "_id" : ObjectId("5791d58760a74da5b3e51eb9"), "by" : "SpringPeople" }
> db.test_collection.find({"title" : "MongoDB Webinar"},{"by":1,_id:0}).pretty()
{ "by" : "SpringPeople" }
7/28/2016Pawan Tiwari
SQL vs Mongodb
SQL SELECT Statements MongoDB find() Statements
SELECT * FROM users db.users.find()
SELECT id, user_id, status FROM users db.users.find( { }, { user_id: 1, status: 1 } )
SELECT user_id, status FROM users db.users.find( { }, { user_id: 1, status: 1, _id: 0 } )
SELECT * FROM users WHERE status = "A" db.users.find( { status: "A" } )
SELECT user_id, status FROM users WHERE status = "A" db.users.find( { status: "A" }, { user_id: 1, status: 1, _id: 0 } )
SELECT * FROM users WHERE status != "A" db.users.find( { status: { $ne: "A" } } )
SELECT * FROM users WHERE status = "A" AND age = 50 db.users.find( { status: "A", age: 50 } )
SELECT * FROM users WHERE status = "A" OR age = 50 db.users.find( { $or: [ { status: "A" } , { age: 50 } ] } )
SELECT * FROM users WHERE age > 25 db.users.find( { age: { $gt: 25 } } )
7/28/2016Pawan Tiwari
SQL vs Mongodb
7/28/2016Pawan Tiwari
SELECT * FROM users WHERE age < 25 db.users.find( { age: { $lt: 25 } } )
SELECT * FROM users WHERE age > 25 AND age <= 50 db.users.find( { age: { $gt: 25, $lte: 50 } } )
SELECT * FROM users WHERE user_id like "%bc%" db.users.find( { user_id: /bc/ } )
SELECT * FROM users WHERE user_id like "bc%" db.users.find( { user_id: /^bc/ } )
SELECT * FROM users WHERE status = "A" ORDER BY user_id ASC db.users.find( { status: "A" } ).sort( { user_id: 1 } )
SELECT * FROM users WHERE status = "A" ORDER BY user_id DESC db.users.find( { status: "A" } ).sort( { user_id: -1 } )
SELECT COUNT(*) FROM users
db.users.count()
or
db.users.find().count()
SELECT COUNT(user_id) FROM users
db.users.count( { user_id: { $exists: true } } )
or
db.users.find( { user_id: { $exists: true } } ).count()
Usefull MongoDB commands
7/28/2016Pawan Tiwari
 Db.createcollection(users)
 Db.users.insert({“name”: “XYZ”})
 db.users.createIndex( { user_id: 1 } )
 db.users.update(
{ age: { $gt: 25 } },
{ $set: { status: "C" } },
{ multi: true }
)
 db.users.remove( { status: "D" } )
db.users.remove( { status:"D" } )
Thank You
7/28/2016Pawan Tiwari
www.springpeople.comtraining@springpeople.com
Upcoming Mongo DB Classes at SpringPeople
Classroom (Bengaluru) 16 - 18 Sept
Online LIVE 08 - 17 Aug
Ad

Recommended

Introduction to MongoDB.pptx
Introduction to MongoDB.pptx
Surya937648
 
Introduction to MongoDB
Introduction to MongoDB
MongoDB
 
Mongo DB 102
Mongo DB 102
Abhijeet Vaikar
 
An introduction to MongoDB
An introduction to MongoDB
Universidade de São Paulo
 
The Basics of MongoDB
The Basics of MongoDB
valuebound
 
Introduction to database & sql
Introduction to database & sql
zahid6
 
Mongodb basics and architecture
Mongodb basics and architecture
Bishal Khanal
 
Introduction to mongodb
Introduction to mongodb
neela madheswari
 
Basic Concept of Database
Basic Concept of Database
Marlon Jamera
 
Basics of MongoDB
Basics of MongoDB
HabileLabs
 
Mongo db
Mongo db
Gyanendra Yadav
 
Database systems - Chapter 2
Database systems - Chapter 2
shahab3
 
Basic Concept Of Database Management System (DBMS) [Presentation Slide]
Basic Concept Of Database Management System (DBMS) [Presentation Slide]
Atik Israk
 
MongoDB 101
MongoDB 101
Abhijeet Vaikar
 
Object relational and extended relational databases
Object relational and extended relational databases
Suhad Jihad
 
Introduction to Object Oriented databases
Introduction to Object Oriented databases
Dr. C.V. Suresh Babu
 
introduction to NOSQL Database
introduction to NOSQL Database
nehabsairam
 
OLAP Cubes in Datawarehousing
OLAP Cubes in Datawarehousing
Prithwis Mukerjee
 
Mysql
Mysql
TSUBHASHRI
 
introdution to SQL and SQL functions
introdution to SQL and SQL functions
farwa waqar
 
Advanced Database System
Advanced Database System
sushmita rathour
 
MYSQL.ppt
MYSQL.ppt
webhostingguy
 
Postgresql
Postgresql
NexThoughts Technologies
 
Python pandas Library
Python pandas Library
Md. Sohag Miah
 
Document Database
Document Database
Heman Hosainpana
 
Sql queries presentation
Sql queries presentation
NITISH KUMAR
 
NoSQL Data Architecture Patterns
NoSQL Data Architecture Patterns
Maynooth University
 
MongoDB
MongoDB
nikhil2807
 
Mongo DB
Mongo DB
Tata Consultancy Services
 
MongoDB for Beginners
MongoDB for Beginners
Enoch Joshua
 

More Related Content

What's hot (20)

Basic Concept of Database
Basic Concept of Database
Marlon Jamera
 
Basics of MongoDB
Basics of MongoDB
HabileLabs
 
Mongo db
Mongo db
Gyanendra Yadav
 
Database systems - Chapter 2
Database systems - Chapter 2
shahab3
 
Basic Concept Of Database Management System (DBMS) [Presentation Slide]
Basic Concept Of Database Management System (DBMS) [Presentation Slide]
Atik Israk
 
MongoDB 101
MongoDB 101
Abhijeet Vaikar
 
Object relational and extended relational databases
Object relational and extended relational databases
Suhad Jihad
 
Introduction to Object Oriented databases
Introduction to Object Oriented databases
Dr. C.V. Suresh Babu
 
introduction to NOSQL Database
introduction to NOSQL Database
nehabsairam
 
OLAP Cubes in Datawarehousing
OLAP Cubes in Datawarehousing
Prithwis Mukerjee
 
Mysql
Mysql
TSUBHASHRI
 
introdution to SQL and SQL functions
introdution to SQL and SQL functions
farwa waqar
 
Advanced Database System
Advanced Database System
sushmita rathour
 
MYSQL.ppt
MYSQL.ppt
webhostingguy
 
Postgresql
Postgresql
NexThoughts Technologies
 
Python pandas Library
Python pandas Library
Md. Sohag Miah
 
Document Database
Document Database
Heman Hosainpana
 
Sql queries presentation
Sql queries presentation
NITISH KUMAR
 
NoSQL Data Architecture Patterns
NoSQL Data Architecture Patterns
Maynooth University
 
MongoDB
MongoDB
nikhil2807
 
Basic Concept of Database
Basic Concept of Database
Marlon Jamera
 
Basics of MongoDB
Basics of MongoDB
HabileLabs
 
Database systems - Chapter 2
Database systems - Chapter 2
shahab3
 
Basic Concept Of Database Management System (DBMS) [Presentation Slide]
Basic Concept Of Database Management System (DBMS) [Presentation Slide]
Atik Israk
 
Object relational and extended relational databases
Object relational and extended relational databases
Suhad Jihad
 
Introduction to Object Oriented databases
Introduction to Object Oriented databases
Dr. C.V. Suresh Babu
 
introduction to NOSQL Database
introduction to NOSQL Database
nehabsairam
 
OLAP Cubes in Datawarehousing
OLAP Cubes in Datawarehousing
Prithwis Mukerjee
 
introdution to SQL and SQL functions
introdution to SQL and SQL functions
farwa waqar
 
Sql queries presentation
Sql queries presentation
NITISH KUMAR
 
NoSQL Data Architecture Patterns
NoSQL Data Architecture Patterns
Maynooth University
 

Viewers also liked (20)

Mongo DB
Mongo DB
Tata Consultancy Services
 
MongoDB for Beginners
MongoDB for Beginners
Enoch Joshua
 
Mongo DB
Mongo DB
Karan Kukreja
 
Intro To MongoDB
Intro To MongoDB
Alex Sharp
 
Mongo db
Mongo db
Noman Ellahi
 
Mongo DB
Mongo DB
Edureka!
 
Introduction to MongoDB
Introduction to MongoDB
Ravi Teja
 
Getting Started with MongoDB and Node.js
Getting Started with MongoDB and Node.js
Grant Goodale
 
Connecting NodeJS & MongoDB
Connecting NodeJS & MongoDB
Enoch Joshua
 
Mongodb
Mongodb
SARAVANAN GOPALAKRISHNAN
 
Mongo db
Mongo db
Akshay Mathur
 
MongoDB-Beginner tutorial explaining basic operation via mongo shell
MongoDB-Beginner tutorial explaining basic operation via mongo shell
Priti Solanki
 
Introduction to MongoDB
Introduction to MongoDB
Mike Dirolf
 
An Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDB
Lee Theobald
 
Intro To Mongo Db
Intro To Mongo Db
chriskite
 
Introduction to mongo db
Introduction to mongo db
Rohit Bishnoi
 
Business considerations for node.js applications
Business considerations for node.js applications
Aspenware
 
Mongo db
Mongo db
Surendra Nath Sahoo
 
Mongo db
Mongo db
Edmilson Neto
 
Mongo db day seattle keynote
Mongo db day seattle keynote
Ben Sabrin
 
MongoDB for Beginners
MongoDB for Beginners
Enoch Joshua
 
Intro To MongoDB
Intro To MongoDB
Alex Sharp
 
Introduction to MongoDB
Introduction to MongoDB
Ravi Teja
 
Getting Started with MongoDB and Node.js
Getting Started with MongoDB and Node.js
Grant Goodale
 
Connecting NodeJS & MongoDB
Connecting NodeJS & MongoDB
Enoch Joshua
 
MongoDB-Beginner tutorial explaining basic operation via mongo shell
MongoDB-Beginner tutorial explaining basic operation via mongo shell
Priti Solanki
 
Introduction to MongoDB
Introduction to MongoDB
Mike Dirolf
 
An Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDB
Lee Theobald
 
Intro To Mongo Db
Intro To Mongo Db
chriskite
 
Introduction to mongo db
Introduction to mongo db
Rohit Bishnoi
 
Business considerations for node.js applications
Business considerations for node.js applications
Aspenware
 
Mongo db day seattle keynote
Mongo db day seattle keynote
Ben Sabrin
 
Ad

Similar to Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials (20)

Mongo db basics
Mongo db basics
Dhaval Mistry
 
Introduction to MongoDB
Introduction to MongoDB
S.Shayan Daneshvar
 
MongoDB Knowledge share
MongoDB Knowledge share
Mr Kyaing
 
UNIT-1 MongoDB.pptx
UNIT-1 MongoDB.pptx
DharaDarji5
 
Mongo db
Mongo db
Girish Talekar
 
Getting Started with MongoDB
Getting Started with MongoDB
Ahasanul Kalam Akib
 
Introduction To MongoDB
Introduction To MongoDB
ElieHannouch
 
Introduction to MongoDB – A NoSQL Database
Introduction to MongoDB – A NoSQL Database
manikgupta2k04
 
MongoDB
MongoDB
kesavan N B
 
Mongo db nosql (1)
Mongo db nosql (1)
Bhavesh Sarvaiya
 
Mongodb Introduction
Mongodb Introduction
Raghvendra Parashar
 
Mongo db basics
Mongo db basics
Harischandra M K
 
Mongodb Training Tutorial in Bangalore
Mongodb Training Tutorial in Bangalore
rajkamaltibacademy
 
MongoDB_ppt.pptx
MongoDB_ppt.pptx
1AP18CS037ShirishKul
 
introtomongodb
introtomongodb
saikiran
 
mongodb introduction11111111111111111111
mongodb introduction11111111111111111111
VADAPALLYPRAVEENKUMA1
 
Tech Gupshup Meetup On MongoDB - 24/06/2016
Tech Gupshup Meetup On MongoDB - 24/06/2016
Mukesh Tilokani
 
mongo.pptx
mongo.pptx
tarungupta276841
 
MongoDB NoSQL database a deep dive -MyWhitePaper
MongoDB NoSQL database a deep dive -MyWhitePaper
Rajesh Kumar
 
3-Mongodb and Mapreduce Programming.pdf
3-Mongodb and Mapreduce Programming.pdf
MarianJRuben
 
MongoDB Knowledge share
MongoDB Knowledge share
Mr Kyaing
 
UNIT-1 MongoDB.pptx
UNIT-1 MongoDB.pptx
DharaDarji5
 
Introduction To MongoDB
Introduction To MongoDB
ElieHannouch
 
Introduction to MongoDB – A NoSQL Database
Introduction to MongoDB – A NoSQL Database
manikgupta2k04
 
Mongodb Training Tutorial in Bangalore
Mongodb Training Tutorial in Bangalore
rajkamaltibacademy
 
introtomongodb
introtomongodb
saikiran
 
mongodb introduction11111111111111111111
mongodb introduction11111111111111111111
VADAPALLYPRAVEENKUMA1
 
Tech Gupshup Meetup On MongoDB - 24/06/2016
Tech Gupshup Meetup On MongoDB - 24/06/2016
Mukesh Tilokani
 
MongoDB NoSQL database a deep dive -MyWhitePaper
MongoDB NoSQL database a deep dive -MyWhitePaper
Rajesh Kumar
 
3-Mongodb and Mapreduce Programming.pdf
3-Mongodb and Mapreduce Programming.pdf
MarianJRuben
 
Ad

More from SpringPeople (20)

Growth hacking tips and tricks that you can try
Growth hacking tips and tricks that you can try
SpringPeople
 
Top Big data Analytics tools: Emerging trends and Best practices
Top Big data Analytics tools: Emerging trends and Best practices
SpringPeople
 
Introduction to Big Data
Introduction to Big Data
SpringPeople
 
Introduction to Microsoft Azure IaaS
Introduction to Microsoft Azure IaaS
SpringPeople
 
Introduction to Selenium WebDriver
Introduction to Selenium WebDriver
SpringPeople
 
Introduction to Open stack - An Overview
Introduction to Open stack - An Overview
SpringPeople
 
Best Practices for Administering Hadoop with Hortonworks Data Platform (HDP) ...
Best Practices for Administering Hadoop with Hortonworks Data Platform (HDP) ...
SpringPeople
 
Why 2 million Developers depend on MuleSoft
Why 2 million Developers depend on MuleSoft
SpringPeople
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium Successfully
SpringPeople
 
An Introduction of Big data; Big data for beginners; Overview of Big Data; Bi...
An Introduction of Big data; Big data for beginners; Overview of Big Data; Bi...
SpringPeople
 
SpringPeople - Introduction to Cloud Computing
SpringPeople - Introduction to Cloud Computing
SpringPeople
 
SpringPeople - Devops skills - Do you have what it takes?
SpringPeople - Devops skills - Do you have what it takes?
SpringPeople
 
Elastic - ELK, Logstash & Kibana
Elastic - ELK, Logstash & Kibana
SpringPeople
 
Hadoop data access layer v4.0
Hadoop data access layer v4.0
SpringPeople
 
Introduction To Core Java - SpringPeople
Introduction To Core Java - SpringPeople
SpringPeople
 
Introduction To Hadoop Administration - SpringPeople
Introduction To Hadoop Administration - SpringPeople
SpringPeople
 
Introduction To Cloud Foundry - SpringPeople
Introduction To Cloud Foundry - SpringPeople
SpringPeople
 
Introduction To Spring Enterprise Integration - SpringPeople
Introduction To Spring Enterprise Integration - SpringPeople
SpringPeople
 
Introduction To Groovy And Grails - SpringPeople
Introduction To Groovy And Grails - SpringPeople
SpringPeople
 
Introduction To Jenkins - SpringPeople
Introduction To Jenkins - SpringPeople
SpringPeople
 
Growth hacking tips and tricks that you can try
Growth hacking tips and tricks that you can try
SpringPeople
 
Top Big data Analytics tools: Emerging trends and Best practices
Top Big data Analytics tools: Emerging trends and Best practices
SpringPeople
 
Introduction to Big Data
Introduction to Big Data
SpringPeople
 
Introduction to Microsoft Azure IaaS
Introduction to Microsoft Azure IaaS
SpringPeople
 
Introduction to Selenium WebDriver
Introduction to Selenium WebDriver
SpringPeople
 
Introduction to Open stack - An Overview
Introduction to Open stack - An Overview
SpringPeople
 
Best Practices for Administering Hadoop with Hortonworks Data Platform (HDP) ...
Best Practices for Administering Hadoop with Hortonworks Data Platform (HDP) ...
SpringPeople
 
Why 2 million Developers depend on MuleSoft
Why 2 million Developers depend on MuleSoft
SpringPeople
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium Successfully
SpringPeople
 
An Introduction of Big data; Big data for beginners; Overview of Big Data; Bi...
An Introduction of Big data; Big data for beginners; Overview of Big Data; Bi...
SpringPeople
 
SpringPeople - Introduction to Cloud Computing
SpringPeople - Introduction to Cloud Computing
SpringPeople
 
SpringPeople - Devops skills - Do you have what it takes?
SpringPeople - Devops skills - Do you have what it takes?
SpringPeople
 
Elastic - ELK, Logstash & Kibana
Elastic - ELK, Logstash & Kibana
SpringPeople
 
Hadoop data access layer v4.0
Hadoop data access layer v4.0
SpringPeople
 
Introduction To Core Java - SpringPeople
Introduction To Core Java - SpringPeople
SpringPeople
 
Introduction To Hadoop Administration - SpringPeople
Introduction To Hadoop Administration - SpringPeople
SpringPeople
 
Introduction To Cloud Foundry - SpringPeople
Introduction To Cloud Foundry - SpringPeople
SpringPeople
 
Introduction To Spring Enterprise Integration - SpringPeople
Introduction To Spring Enterprise Integration - SpringPeople
SpringPeople
 
Introduction To Groovy And Grails - SpringPeople
Introduction To Groovy And Grails - SpringPeople
SpringPeople
 
Introduction To Jenkins - SpringPeople
Introduction To Jenkins - SpringPeople
SpringPeople
 

Recently uploaded (20)

Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
SOFTTECHHUB
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
Safe Software
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
Edge AI and Vision Alliance
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Enabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FME
Safe Software
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
“From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
“From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
Edge AI and Vision Alliance
 
SAP Modernization Strategies for a Successful S/4HANA Journey.pdf
SAP Modernization Strategies for a Successful S/4HANA Journey.pdf
Precisely
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
SOFTTECHHUB
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
Safe Software
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
Edge AI and Vision Alliance
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Enabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FME
Safe Software
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
“From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
“From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
Edge AI and Vision Alliance
 
SAP Modernization Strategies for a Successful S/4HANA Journey.pdf
SAP Modernization Strategies for a Successful S/4HANA Journey.pdf
Precisely
 

Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials

  • 1. Mongo DB: Fundamentals & Basics By Pawan
  • 2.  We have INSTRUCTOR LED - both Online LIVE & Classroom Session  Present for classroom sessions in Bangalore & Delhi (NCR)  We are the ONLY Education delivery partners for Mulesoft, Elastic, Pivotal & Lightbend in India  We have delivered more than 5000 trainings and have over 400 courses and a vast pool of over 200 experts to make YOU the EXPERT! FOLLOW US ON SOCIAL MEDIA TO STAY UPDATED ON THE UPCOMING WEBINARS
  • 3. Online and Classroom Training on Technology Courses at SpringPeople Non-Certified Courses …and many more Certified Partners
  • 4. What is MongoDB  MongoDB is an open-source document database and leading NoSQL database  Schema less  Stores JSON objects  document oriented database that provides  high performance  high availability  easy scalability 7/28/2016Pawan Tiwari
  • 5. Why MongoDB  Document Oriented Storage: Data is stored in the form of JSON style documents.  Index on any attribute  Geo Location support  Replication and high availability  Auto-sharding  Rich queries  Fast in-place updates  Professional support by MongoDB 7/28/2016Pawan Tiwari
  • 6. MongoDB Overview  Database  Physical Container of Collection  Collections  Collection is a group of MongoDB documents  equivalent of an RDBMS table  Collections do not enforce a schema.  Document  set of key-value pairs.  Documents have dynamic schema 7/28/2016Pawan Tiwari
  • 7. RDBMS and MongoDB  Database  Database  Table  Collection  Row  Document  Column  Field 7/28/2016Pawan Tiwari
  • 8. Sample Document { _id: ObjectId(7df78ad8902c) a: ‘1’, b: ‘2’ } 7/28/2016Pawan Tiwari
  • 9. Advantages of MongoDB  Schema less  Structure of a single object is clear.  No complex joins.  Supports dynamic queries on documents using a document-based query language that's nearly as powerful as SQL.  Tuning.  Ease of scale-out: MongoDB is easy to scale.  Conversion/mapping of application objects to database objects not needed.  Uses internal memory for storing the (windowed) working set, enabling faster access of data 7/28/2016Pawan Tiwari
  • 10. Create Collection  Db.createcollection(“collection_name” Options)  Example: MongoDB shell version: 2.4.14 connecting to: test > show dbs local 0.078125GB test 0.203125GB > use test switched to db test > db.createCollection("test_collection") { "ok" : 1 } > 7/28/2016Pawan Tiwari
  • 11. Drop Collection  db.COLLECTION_NAME.drop() MongoDB shell version: 2.4.14 connecting to: test > show collections system.indexes test_collection > db.test_collection.drop() true 7/28/2016Pawan Tiwari
  • 12. Insert Document  db.COLLECTION_NAME.insert(document) >db.test_collection.insert({ title: 'MongoDB Webinar', description: 'MongoDB is a high-performance, open source, schema- free, document/object-oriented database optimized for web application environments, and is perhaps one of the most disruptive software technologies in years. MongoDB will fundamentally change the way participants think about data persistence. In this webinar know the fundamentals of designing and building applications using MongoDB', by: 'SpringPeople', url: 'http://www.springpeople.com/webinars/mongodb-developer-fundamentals-and- basics', }) 7/28/2016Pawan Tiwari
  • 13. Query Document  db.COLLECTION_NAME.find(document) Example: >db.test_collection.find() >db.test_collection.find().pretty() >db.test_collection.find({"title" : "MongoDB Webinar"}) > db.test_collection.find({"title" : "MongoDB Webinar"},{"by":1}).pretty() { "_id" : ObjectId("5791d58760a74da5b3e51eb9"), "by" : "SpringPeople" } > db.test_collection.find({"title" : "MongoDB Webinar"},{"by":1,_id:0}).pretty() { "by" : "SpringPeople" } 7/28/2016Pawan Tiwari
  • 14. SQL vs Mongodb SQL SELECT Statements MongoDB find() Statements SELECT * FROM users db.users.find() SELECT id, user_id, status FROM users db.users.find( { }, { user_id: 1, status: 1 } ) SELECT user_id, status FROM users db.users.find( { }, { user_id: 1, status: 1, _id: 0 } ) SELECT * FROM users WHERE status = "A" db.users.find( { status: "A" } ) SELECT user_id, status FROM users WHERE status = "A" db.users.find( { status: "A" }, { user_id: 1, status: 1, _id: 0 } ) SELECT * FROM users WHERE status != "A" db.users.find( { status: { $ne: "A" } } ) SELECT * FROM users WHERE status = "A" AND age = 50 db.users.find( { status: "A", age: 50 } ) SELECT * FROM users WHERE status = "A" OR age = 50 db.users.find( { $or: [ { status: "A" } , { age: 50 } ] } ) SELECT * FROM users WHERE age > 25 db.users.find( { age: { $gt: 25 } } ) 7/28/2016Pawan Tiwari
  • 15. SQL vs Mongodb 7/28/2016Pawan Tiwari SELECT * FROM users WHERE age < 25 db.users.find( { age: { $lt: 25 } } ) SELECT * FROM users WHERE age > 25 AND age <= 50 db.users.find( { age: { $gt: 25, $lte: 50 } } ) SELECT * FROM users WHERE user_id like "%bc%" db.users.find( { user_id: /bc/ } ) SELECT * FROM users WHERE user_id like "bc%" db.users.find( { user_id: /^bc/ } ) SELECT * FROM users WHERE status = "A" ORDER BY user_id ASC db.users.find( { status: "A" } ).sort( { user_id: 1 } ) SELECT * FROM users WHERE status = "A" ORDER BY user_id DESC db.users.find( { status: "A" } ).sort( { user_id: -1 } ) SELECT COUNT(*) FROM users db.users.count() or db.users.find().count() SELECT COUNT(user_id) FROM users db.users.count( { user_id: { $exists: true } } ) or db.users.find( { user_id: { $exists: true } } ).count()
  • 16. Usefull MongoDB commands 7/28/2016Pawan Tiwari  Db.createcollection(users)  Db.users.insert({“name”: “XYZ”})  db.users.createIndex( { user_id: 1 } )  db.users.update( { age: { $gt: 25 } }, { $set: { status: "C" } }, { multi: true } )  db.users.remove( { status: "D" } ) db.users.remove( { status:"D" } )
  • 18. [email protected] Upcoming Mongo DB Classes at SpringPeople Classroom (Bengaluru) 16 - 18 Sept Online LIVE 08 - 17 Aug