SlideShare a Scribd company logo
1 of 34
Introduction to Mongo DB
(NO SQL data Base)
PREPARED BY: NABEEL RAZA
Overview
 What is NO SQL Data base?
 Types of NO SQL Data base.
 What is Mongo DB?
 RDBMs vs MongoDB
 Why Mongo DB?
 Limitation of MongoDB
 Mongo DB Architecture.
 Document (JSON) Structure.
 MongoDB environment setup
 Different Methods.
 Demo
 When to use Mongo DB?
What is No SQL data base
 It’s Not No SQL it’s NOT ONLY SQL.
 NoSQL is a non-relational DBMS, that does not require a fixed schema,
avoids joins, and is easy to scale.
 It’s not even a replacement to RDBMS.
 NoSQL databases are increasingly used in big data and real-time web
applications.
 For example, companies like Twitter, Facebook, Google that collect
terabytes of user data every single day.
Types of No SQl data base
 Key Value pair
Dynamo DB
Azure Table Storage (ATS )
 Graph database
 Document Based
Mango Db
AmazonSimple DB
Couch DB
 Column Oriented database
(#key,#value)
(Name, Tom)
(Age,25)
(Role, Student)
(University, CU)
[
{
"Name": "Tom",
"Age": 30,
"Role": "Student",
"University":
"CU",
}
]
Student
Tom
CU
25
Masters
Ottawa Location
• Neo4j
• Infogrid
Row Id Columns
1
Name Tom
Age 25
Role Student
Bigtable(Google)
HBase
What is Mongo DB
 MongoDB is a cross-platform, document oriented database that provides
 High performance.
 High availability.
 Easy scalability.
 MongoDB uses JSON-like documents with schema.
 MongoDB works on concept of collection and document.
 Developed by: MongoDB Inc.
RDBMS vs MongoDB
Why Mongo DB?
 All the modern applications deals with huge data.
 Development with ease is possible with mongo DB.
 Flexibility in deployment.
 Older database systems may not be compatible with the design.
And it’s a document oriented storage:- Data is stored in the form of
JSON Style.
Who are Using MongoDB?
 A survey by Siftery on MongoDB, there are around 4000+ company confirmed
that they are using MongoDB as Database. Some of the key names are :
• Castlight Health
• IBM
• Citrix
• Twitter
• T-Mobile
• Zendesk
• Sony
• BrightRoll
• Foursquare
• HTC
• InVision
• Intercom etc.
Limitation of MongoDB
 Nothing is fully complete or perfect.
 Joins not Supported( Joins functionality by adding by coding it manually)
 High Memory Usage.
 Limited Data Size(document size, not more than 16MB.)
 Limited Nesting(cannot perform nesting of documents for more than 100
levels.)
Mongo DB architecture
Mongo DB architecture
Architecture : -
Database
ContainerDocument
Document(JSON) structure
 The document has simple structure and very easy to
understand the content
 JSON is smaller, faster and lightweight compared to XML.
 For data delivery between servers and browsers, JSON is a
better choice
 Easy in parsing, processing, validating in all languages
 JSON can be mapped more easily into object oriented
system.
 [
 {
 "Name": "Tom",
 "Age": 30,
 "Role": "Student",
 "University": "CU",
}
{
 "Name": “Sam",
 "Age": 32,
 "Role": "Student",
 "University": “OU",
}
]
Difference Between XML And JSON
XML JSON
It is a markup language. It is a way of representing objects.
This is more verbose than JSON. This format uses less words.
It is used to describe the structured data. It is used to describe unstructured data
which include arrays.
Example:
<car>
<company>Volkswagen</company>
<name>Vento</name>
<price>800000</price> </car>
{
"company": Volkswagen,
"name": "Vento",
"price": 800000
}
MongoDB Environment Setup
 Know your Windows architecture
 Download MongoDB setup file
 Install MongoDB setup
 Set up MongoDB Environment
 Connect to the MongoDB server
 MongoDB as a Windows service
 Create configuration file
 Run MongoDB Environment setup
Know your Windows Architecture
 You must know which Windows version you are using.
 To know about your system architecture, open the command prompt and
execute some commands given below.
 Command: wmic os get osarchitecture.
 Download the MongoDB setup accordingly.
Download MongoDB Setup File
 Download the latest version of MongoDB from the official website.
 Link: ttps://www.mongodb.org/downloads
 Download the MSI file from this server.
 And install mongodb setup.
 There is an option to install MongoDB Compass too.
MongoDB Environment Setup
 MongoDB stored data in a specified directory.
 Create it manually in the MongoDB Folder on the C drive.
 Run the command in Command Prompt.(md datadb)
Start MongoDB
 To start mongodb server, we need to run the specific file.
Contd….
Connect to MongoDB Server
 After executing the MongoDB.exe file, Now we need to connect it to the
MongoDB server.
 We will connect it through Mongo.exe shell by opening another
command prompt.
MongoDB as a Windows Service
 Create some directories using command prompt & executing the following
commands:
 mkdir c:datadb
 mkdir c:datalog
 All of your database and the log files will be stored in these two folders.
MongoDB Document Structure
 There are TWO types of documents
 Referenced Documents
 Embedded Documents
Referenced Document
 Store the relationship between data by including links from one data to
another.
Embedded Documents
 Embedded documents create relationships between data by storing
related data in a single document structure.
MongoDB with Kafka
Demo
Some commonly used
Commands
 Use Command: to use the database.
 DB Command: to check selected DB
 Show dbs: list all databases
 dropDatabase: to drop selected db
 Example: -
• Use database_name;
• Db;
• Show dbs;
• dropDatabase()
The createCollection()
Method
 First we create database
 As we know there are table(s) in a
database
 And tables are know as documents
 First create Collection using command
“db. createCollection(name,option)”
 Example: -
Db.createCollection(“myTable”)
The insert() Method
 To insert data into MongoDB collection, you
need to use
MongoDB's insert() or save() method.
 The basic syntax of insert() command is as
follows −
“db.COLLECTION_NAME.insert(document)”
 Example: -
db.StudentRecord.insert (
{
"Name": "Tom",
"Age": 30,
"Role": "Student",
"University": "CU",
},
{
"Name": “Sam",
"Age": 22,
"Role": "Student",
"University": “OU",
}
)
The find() Method
 To query data from MongoDB collection, you need
to use MongoDB's find() method.
 The basic syntax of find() method is as follows −
“db.COLLECTION_NAME.find()”
 find() method will display all the documents in a
non-structured way.
 To display the results in a formatted way, you can
use pretty() method.
“db.mycol.find().pretty() “
 Example: -
db.StudentRecord.find()
.pretty()
The update() Method
 As we know that database consists of
some Collection and each collection
have some documents.
 Update this document by adding some
more information.
 “db.collection_name.update(criteria,
update_data )”
db.studentRecord.update(
{
"Name":"Tom",
"Age":30},
{
$set: {
"Name":"Tommy“,
"Age":35
}
}
}
)
The remove() Method
 MongoDB's remove() method is used to
remove a document from the collection.
remove() method accepts two parameters.
One is deletion criteria and second is
justOne flag.
 deletion criteria − (Optional) deletion
criteria according to documents will be
removed.
 justOne − (Optional) if set to true or 1, then
remove only one document.
 Syntax
 db.COLLECTION_NAME.remove(DELLETI
ON_CRITTERIA)
Remove based on
DELETION_CRITERIA
db.StudentRecord.remove({"Name":
"Tommy})
Remove Only One:-Removes first
record
db.StudentRecord.remove(DELETION
_CRITERIA,1)
Remove all Records
db.StudentRecord.remove()
When to use Mongo Db?
When your requirements has these properties :
 You absolutely must store unstructured data.
 Things coming from 3rd-party API you don’t control.
 Logs whose format may change any minute.
 You change your schema very often on a large dataset.
Mongodb Introduction

More Related Content

What's hot

Connecting NodeJS & MongoDB
Connecting NodeJS & MongoDBConnecting NodeJS & MongoDB
Connecting NodeJS & MongoDBEnoch Joshua
 
Get expertise with mongo db
Get expertise with mongo dbGet expertise with mongo db
Get expertise with mongo dbAmit Thakkar
 
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsMongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsSpringPeople
 
Intro to mongo db
Intro to mongo dbIntro to mongo db
Intro to mongo dbChi Lee
 
MongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World ExamplesMongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World ExamplesMike Friedman
 
MongoDB basics & Introduction
MongoDB basics & IntroductionMongoDB basics & Introduction
MongoDB basics & IntroductionJerwin Roy
 
Schema Design by Example ~ MongoSF 2012
Schema Design by Example ~ MongoSF 2012Schema Design by Example ~ MongoSF 2012
Schema Design by Example ~ MongoSF 2012hungarianhc
 
MongoDB Schema Design
MongoDB Schema DesignMongoDB Schema Design
MongoDB Schema DesignMongoDB
 
Mongo Presentation by Metatagg Solutions
Mongo Presentation by Metatagg SolutionsMongo Presentation by Metatagg Solutions
Mongo Presentation by Metatagg SolutionsMetatagg Solutions
 
MongoDB NYC Python
MongoDB NYC PythonMongoDB NYC Python
MongoDB NYC PythonMike Dirolf
 
PhpstudyTokyo MongoDB PHP CakePHP
PhpstudyTokyo MongoDB PHP CakePHPPhpstudyTokyo MongoDB PHP CakePHP
PhpstudyTokyo MongoDB PHP CakePHPichikaway
 
OSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB TutorialOSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB TutorialSteven Francia
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBMike Dirolf
 

What's hot (20)

Connecting NodeJS & MongoDB
Connecting NodeJS & MongoDBConnecting NodeJS & MongoDB
Connecting NodeJS & MongoDB
 
Get expertise with mongo db
Get expertise with mongo dbGet expertise with mongo db
Get expertise with mongo db
 
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsMongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
 
MongoDB
MongoDBMongoDB
MongoDB
 
Intro to mongo db
Intro to mongo dbIntro to mongo db
Intro to mongo db
 
MongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World ExamplesMongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World Examples
 
MongoDB basics & Introduction
MongoDB basics & IntroductionMongoDB basics & Introduction
MongoDB basics & Introduction
 
MongoDB 101
MongoDB 101MongoDB 101
MongoDB 101
 
Mongo db workshop # 02
Mongo db workshop # 02Mongo db workshop # 02
Mongo db workshop # 02
 
Mongo db commands
Mongo db commandsMongo db commands
Mongo db commands
 
Schema Design by Example ~ MongoSF 2012
Schema Design by Example ~ MongoSF 2012Schema Design by Example ~ MongoSF 2012
Schema Design by Example ~ MongoSF 2012
 
MongoDB Schema Design
MongoDB Schema DesignMongoDB Schema Design
MongoDB Schema Design
 
Mongo Presentation by Metatagg Solutions
Mongo Presentation by Metatagg SolutionsMongo Presentation by Metatagg Solutions
Mongo Presentation by Metatagg Solutions
 
MongoDB NYC Python
MongoDB NYC PythonMongoDB NYC Python
MongoDB NYC Python
 
MongoDb - Details on the POC
MongoDb - Details on the POCMongoDb - Details on the POC
MongoDb - Details on the POC
 
MongoDB
MongoDBMongoDB
MongoDB
 
PhpstudyTokyo MongoDB PHP CakePHP
PhpstudyTokyo MongoDB PHP CakePHPPhpstudyTokyo MongoDB PHP CakePHP
PhpstudyTokyo MongoDB PHP CakePHP
 
OSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB TutorialOSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB Tutorial
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
MongoDB
MongoDBMongoDB
MongoDB
 

Similar to Mongodb Introduction

Jumpstart: Building Your First MongoDB App
Jumpstart: Building Your First MongoDB AppJumpstart: Building Your First MongoDB App
Jumpstart: Building Your First MongoDB AppMongoDB
 
Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)Kai Zhao
 
MongoDB - An Introduction
MongoDB - An IntroductionMongoDB - An Introduction
MongoDB - An Introductionsethfloydjr
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB Habilelabs
 
Building your first app with MongoDB
Building your first app with MongoDBBuilding your first app with MongoDB
Building your first app with MongoDBNorberto Leite
 
Introduction to MongoDB.pptx
Introduction to MongoDB.pptxIntroduction to MongoDB.pptx
Introduction to MongoDB.pptxSurya937648
 
Introduction to MongoDB and its best practices
Introduction to MongoDB and its best practicesIntroduction to MongoDB and its best practices
Introduction to MongoDB and its best practicesAshishRathore72
 
mongodb11 (1) (1).pptx
mongodb11 (1) (1).pptxmongodb11 (1) (1).pptx
mongodb11 (1) (1).pptxRoopaR36
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentationHyphen Call
 
MongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDB
MongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDBMongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDB
MongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDBMongoDB
 
introtomongodb
introtomongodbintrotomongodb
introtomongodbsaikiran
 
MongoDB installation,CRUD operation & JavaScript shell
MongoDB installation,CRUD operation & JavaScript shellMongoDB installation,CRUD operation & JavaScript shell
MongoDB installation,CRUD operation & JavaScript shellShahDhruv21
 

Similar to Mongodb Introduction (20)

Mongodb By Vipin
Mongodb By VipinMongodb By Vipin
Mongodb By Vipin
 
Mongo DB
Mongo DBMongo DB
Mongo DB
 
Jumpstart: Building Your First MongoDB App
Jumpstart: Building Your First MongoDB AppJumpstart: Building Your First MongoDB App
Jumpstart: Building Your First MongoDB App
 
Mongo db
Mongo dbMongo db
Mongo db
 
Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)
 
MongoDB - An Introduction
MongoDB - An IntroductionMongoDB - An Introduction
MongoDB - An Introduction
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
 
Mongo learning series
Mongo learning series Mongo learning series
Mongo learning series
 
Building your first app with MongoDB
Building your first app with MongoDBBuilding your first app with MongoDB
Building your first app with MongoDB
 
Introduction to MongoDB.pptx
Introduction to MongoDB.pptxIntroduction to MongoDB.pptx
Introduction to MongoDB.pptx
 
Introduction to MongoDB and its best practices
Introduction to MongoDB and its best practicesIntroduction to MongoDB and its best practices
Introduction to MongoDB and its best practices
 
mongodb11 (1) (1).pptx
mongodb11 (1) (1).pptxmongodb11 (1) (1).pptx
mongodb11 (1) (1).pptx
 
Mongodb
MongodbMongodb
Mongodb
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentation
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Presentation mongodb
Presentation mongodbPresentation mongodb
Presentation mongodb
 
MongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDB
MongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDBMongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDB
MongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDB
 
Mongo db
Mongo dbMongo db
Mongo db
 
introtomongodb
introtomongodbintrotomongodb
introtomongodb
 
MongoDB installation,CRUD operation & JavaScript shell
MongoDB installation,CRUD operation & JavaScript shellMongoDB installation,CRUD operation & JavaScript shell
MongoDB installation,CRUD operation & JavaScript shell
 

Recently uploaded

Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightDelhi Call girls
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceDelhi Call girls
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Delhi Call girls
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Delhi Call girls
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023ymrp368
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Delhi Call girls
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Researchmichael115558
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxJohnnyPlasten
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 

Recently uploaded (20)

Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
 
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 

Mongodb Introduction

  • 1. Introduction to Mongo DB (NO SQL data Base) PREPARED BY: NABEEL RAZA
  • 2. Overview  What is NO SQL Data base?  Types of NO SQL Data base.  What is Mongo DB?  RDBMs vs MongoDB  Why Mongo DB?  Limitation of MongoDB  Mongo DB Architecture.  Document (JSON) Structure.  MongoDB environment setup  Different Methods.  Demo  When to use Mongo DB?
  • 3. What is No SQL data base  It’s Not No SQL it’s NOT ONLY SQL.  NoSQL is a non-relational DBMS, that does not require a fixed schema, avoids joins, and is easy to scale.  It’s not even a replacement to RDBMS.  NoSQL databases are increasingly used in big data and real-time web applications.  For example, companies like Twitter, Facebook, Google that collect terabytes of user data every single day.
  • 4. Types of No SQl data base  Key Value pair Dynamo DB Azure Table Storage (ATS )  Graph database  Document Based Mango Db AmazonSimple DB Couch DB  Column Oriented database (#key,#value) (Name, Tom) (Age,25) (Role, Student) (University, CU) [ { "Name": "Tom", "Age": 30, "Role": "Student", "University": "CU", } ] Student Tom CU 25 Masters Ottawa Location • Neo4j • Infogrid Row Id Columns 1 Name Tom Age 25 Role Student Bigtable(Google) HBase
  • 5. What is Mongo DB  MongoDB is a cross-platform, document oriented database that provides  High performance.  High availability.  Easy scalability.  MongoDB uses JSON-like documents with schema.  MongoDB works on concept of collection and document.  Developed by: MongoDB Inc.
  • 7. Why Mongo DB?  All the modern applications deals with huge data.  Development with ease is possible with mongo DB.  Flexibility in deployment.  Older database systems may not be compatible with the design. And it’s a document oriented storage:- Data is stored in the form of JSON Style.
  • 8. Who are Using MongoDB?  A survey by Siftery on MongoDB, there are around 4000+ company confirmed that they are using MongoDB as Database. Some of the key names are : • Castlight Health • IBM • Citrix • Twitter • T-Mobile • Zendesk • Sony • BrightRoll • Foursquare • HTC • InVision • Intercom etc.
  • 9. Limitation of MongoDB  Nothing is fully complete or perfect.  Joins not Supported( Joins functionality by adding by coding it manually)  High Memory Usage.  Limited Data Size(document size, not more than 16MB.)  Limited Nesting(cannot perform nesting of documents for more than 100 levels.)
  • 11. Mongo DB architecture Architecture : - Database ContainerDocument
  • 12. Document(JSON) structure  The document has simple structure and very easy to understand the content  JSON is smaller, faster and lightweight compared to XML.  For data delivery between servers and browsers, JSON is a better choice  Easy in parsing, processing, validating in all languages  JSON can be mapped more easily into object oriented system.  [  {  "Name": "Tom",  "Age": 30,  "Role": "Student",  "University": "CU", } {  "Name": “Sam",  "Age": 32,  "Role": "Student",  "University": “OU", } ]
  • 13. Difference Between XML And JSON XML JSON It is a markup language. It is a way of representing objects. This is more verbose than JSON. This format uses less words. It is used to describe the structured data. It is used to describe unstructured data which include arrays. Example: <car> <company>Volkswagen</company> <name>Vento</name> <price>800000</price> </car> { "company": Volkswagen, "name": "Vento", "price": 800000 }
  • 14. MongoDB Environment Setup  Know your Windows architecture  Download MongoDB setup file  Install MongoDB setup  Set up MongoDB Environment  Connect to the MongoDB server  MongoDB as a Windows service  Create configuration file  Run MongoDB Environment setup
  • 15. Know your Windows Architecture  You must know which Windows version you are using.  To know about your system architecture, open the command prompt and execute some commands given below.  Command: wmic os get osarchitecture.  Download the MongoDB setup accordingly.
  • 16. Download MongoDB Setup File  Download the latest version of MongoDB from the official website.  Link: ttps://www.mongodb.org/downloads  Download the MSI file from this server.  And install mongodb setup.  There is an option to install MongoDB Compass too.
  • 17. MongoDB Environment Setup  MongoDB stored data in a specified directory.  Create it manually in the MongoDB Folder on the C drive.  Run the command in Command Prompt.(md datadb)
  • 18. Start MongoDB  To start mongodb server, we need to run the specific file.
  • 20. Connect to MongoDB Server  After executing the MongoDB.exe file, Now we need to connect it to the MongoDB server.  We will connect it through Mongo.exe shell by opening another command prompt.
  • 21. MongoDB as a Windows Service  Create some directories using command prompt & executing the following commands:  mkdir c:datadb  mkdir c:datalog  All of your database and the log files will be stored in these two folders.
  • 22. MongoDB Document Structure  There are TWO types of documents  Referenced Documents  Embedded Documents
  • 23. Referenced Document  Store the relationship between data by including links from one data to another.
  • 24. Embedded Documents  Embedded documents create relationships between data by storing related data in a single document structure.
  • 26. Demo
  • 27. Some commonly used Commands  Use Command: to use the database.  DB Command: to check selected DB  Show dbs: list all databases  dropDatabase: to drop selected db  Example: - • Use database_name; • Db; • Show dbs; • dropDatabase()
  • 28. The createCollection() Method  First we create database  As we know there are table(s) in a database  And tables are know as documents  First create Collection using command “db. createCollection(name,option)”  Example: - Db.createCollection(“myTable”)
  • 29. The insert() Method  To insert data into MongoDB collection, you need to use MongoDB's insert() or save() method.  The basic syntax of insert() command is as follows − “db.COLLECTION_NAME.insert(document)”  Example: - db.StudentRecord.insert ( { "Name": "Tom", "Age": 30, "Role": "Student", "University": "CU", }, { "Name": “Sam", "Age": 22, "Role": "Student", "University": “OU", } )
  • 30. The find() Method  To query data from MongoDB collection, you need to use MongoDB's find() method.  The basic syntax of find() method is as follows − “db.COLLECTION_NAME.find()”  find() method will display all the documents in a non-structured way.  To display the results in a formatted way, you can use pretty() method. “db.mycol.find().pretty() “  Example: - db.StudentRecord.find() .pretty()
  • 31. The update() Method  As we know that database consists of some Collection and each collection have some documents.  Update this document by adding some more information.  “db.collection_name.update(criteria, update_data )” db.studentRecord.update( { "Name":"Tom", "Age":30}, { $set: { "Name":"Tommy“, "Age":35 } } } )
  • 32. The remove() Method  MongoDB's remove() method is used to remove a document from the collection. remove() method accepts two parameters. One is deletion criteria and second is justOne flag.  deletion criteria − (Optional) deletion criteria according to documents will be removed.  justOne − (Optional) if set to true or 1, then remove only one document.  Syntax  db.COLLECTION_NAME.remove(DELLETI ON_CRITTERIA) Remove based on DELETION_CRITERIA db.StudentRecord.remove({"Name": "Tommy}) Remove Only One:-Removes first record db.StudentRecord.remove(DELETION _CRITERIA,1) Remove all Records db.StudentRecord.remove()
  • 33. When to use Mongo Db? When your requirements has these properties :  You absolutely must store unstructured data.  Things coming from 3rd-party API you don’t control.  Logs whose format may change any minute.  You change your schema very often on a large dataset.

Editor's Notes

  1. Ad-hoc Queries Schema-Less Database Document-Oriented Indexing Replication Aggregation GridFS Sharding High Performance
  2. Flexible database – Sharding(1-3) - High Speed - Ad-hoc Query Support -
  3. Joins:  But it may slow execution and affect performance. Memory: due to no functionality of joins, there is data redundancy. This results in increasing unnecessary usage of memory.
  4. MongoDB Compass is the GUI for MongoDB. Compass allows you to analyze and understand the contents of your data without formal knowledge of MongoDB query syntax.
  5. >db.createCollection(“mongodb”, { capped:true, size:1000000, max:2})