SlideShare a Scribd company logo
MongoDB
MongoDB is a document-oriented database, not a relational one.
A document-oriented database replaces the concept of a “row” with a more flexible
model, the “document.”
MongoDB is intended to be a general-purpose database so aside from creating, reading,
updating, and deleting data
Indexing
Aggregation
Special collection types
MongoDB is made up of databases which contain collections. A collection is made up of
documents.
Each document is made up of fields. Collections can be indexed, which improves lookup and
sorting performance.
Finally, when we get data from MongoDB we do so through a cursor whose actual execution is
delayed until necessary.
In JavaScript, for example, documents are represented as objects:
{
"greeting“ : "Hello, world!“
}
This simple document contains a single key, "greeting“ , with a value of "Hello,
world!“ . Most documents will be more complex than this simple one and often will
contain multiple key/value pairs:
{ "greeting“ :"Hello, world!","foo":3 }
The keys in a document are strings. Any UTF-8 character is allowed in a key, with a few
notable exceptions:
Keys must not contain the character 0 (the null character). This character is used
to signify the end of a key
The . and $ characters have some special properties and should be used only in certain
circumstances, as described in later chapters. In general, they should be considered reserved,
and drivers will complain if they are used inappropriately.
MongoDB is type-sensitive and case-sensitive
Collections:
A collection is a group of documents.
Dynamic Schemas:
Collections have dynamic schemas . This means that the documents within a single col‐
lection can have any number of different “shapes.”
{"greeting“ : "Hello, world!"}
{ "foo":5}
Naming:
A collection is identified by its name. Collection names can be any UTF-8 string, with
a few restrictions:
The empty string ("") is not a valid collection name
Collection names may not contain the character 0 (the null character) because this delineates
the end of a collection name.
Getting and Starting MongoDB
MongoDB is almost always run as a network server that clients can connect to and
perform operations on
$ mongod
mongod --help
for help and startup options.
When run with no arguments, mongod will use the default data directory, /data/db/
(or datadb on the current volume on Windows).
If the data directory does not already exist or is not writable, the server will fail to start. It is
important to create the data directory (e.g., mkdir -p /data/db/ ) and to make sure your user
has permission to write to the directory before starting MongoDB
Running the Shell
To start the shell, run the mongo executable:
$Mongo
MongoDB shell
version : 2.4 . 0
connecting to : test >
The shell is a full-featured JavaScript interpreter, capable of running arbitrary JavaScript
programs. To illustrate this, let’s perform some basic math:
>x
=200
200
>x/5;
40
A MongoDB Client
To see the database db is currently assigned to, type in db and hit Enter:
>db
Test
Basic Operations with the Shel
CRUD:
create, read, update, and delete to manipulate and view data in the shell.
Data Types
Basic Data Types
Documents in MongoDB can be thought of as “JSON-like” in that they are conceptually
similar to objects in JavaScript.
JSON is a simple representation of data: the specification can be described in about one
paragraph (their website proves it) and lists only six data types.
The most common types are
Null
Dates
Arrays
Embedded documents
Running Scripts with the Shel
Creating, Updating, and
Deleting Documents
Adding new documents to a collection
• Removing documents from a collection
• Updating existing documents
• Choosing the correct level of safety versus speed for all of these operations
Inserting and Saving Documents
Inserts are the basic method for adding data to MongoDB.
Batch Insert
Batch inserts allow you to pass an array of documents to the database.
Insert Validation
MongoDB does minimal checks on data being inserted:
Removing Documents
Now that there’s data in our database, let’s delete it:
Remove Speed
Removing documents is usually a fairly quick operation.
Updating Documents
Setting a Write Concern
Querying
Find method is used to perform queries in MongoDB.
Specifying Which Keys to Return
Sometimes you do not need all of the key/value pairs in a document returned.
Cursors
The database returns results from find using a cursor.
Ad

More Related Content

What's hot (20)

Mongo DB 102
Mongo DB 102Mongo DB 102
Mongo DB 102
Abhijeet Vaikar
 
Get expertise with mongo db
Get expertise with mongo dbGet expertise with mongo db
Get expertise with mongo db
Amit Thakkar
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
HabileLabs
 
Top 10 frameworks of node js
Top 10 frameworks of node jsTop 10 frameworks of node js
Top 10 frameworks of node js
HabileLabs
 
Connecting NodeJS & MongoDB
Connecting NodeJS & MongoDBConnecting NodeJS & MongoDB
Connecting NodeJS & MongoDB
Enoch Joshua
 
MongoDB 101
MongoDB 101MongoDB 101
MongoDB 101
Abhijeet Vaikar
 
Mongo db
Mongo dbMongo db
Mongo db
Noman Ellahi
 
Mongo DB Presentation
Mongo DB PresentationMongo DB Presentation
Mongo DB Presentation
Jaya Naresh Kovela
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentation
Hyphen Call
 
MongoDB
MongoDBMongoDB
MongoDB
nikhil2807
 
Mongo db workshop # 01
Mongo db workshop # 01Mongo db workshop # 01
Mongo db workshop # 01
FarhatParveen10
 
Mongodb intro
Mongodb introMongodb intro
Mongodb intro
christkv
 
MongoDB: An Introduction - june-2011
MongoDB:  An Introduction - june-2011MongoDB:  An Introduction - june-2011
MongoDB: An Introduction - june-2011
Chris Westin
 
The Basics of MongoDB
The Basics of MongoDBThe Basics of MongoDB
The Basics of MongoDB
valuebound
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Mike Dirolf
 
Introduction to mongodb
Introduction to mongodbIntroduction to mongodb
Introduction to mongodb
neela madheswari
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
César Trigo
 
Mongo db
Mongo dbMongo db
Mongo db
Akshay Mathur
 
Mongo db dhruba
Mongo db dhrubaMongo db dhruba
Mongo db dhruba
Dhrubaji Mandal ♛
 
Introduction to mongo db
Introduction to mongo dbIntroduction to mongo db
Introduction to mongo db
Rohit Bishnoi
 
Get expertise with mongo db
Get expertise with mongo dbGet expertise with mongo db
Get expertise with mongo db
Amit Thakkar
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
HabileLabs
 
Top 10 frameworks of node js
Top 10 frameworks of node jsTop 10 frameworks of node js
Top 10 frameworks of node js
HabileLabs
 
Connecting NodeJS & MongoDB
Connecting NodeJS & MongoDBConnecting NodeJS & MongoDB
Connecting NodeJS & MongoDB
Enoch Joshua
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentation
Hyphen Call
 
Mongodb intro
Mongodb introMongodb intro
Mongodb intro
christkv
 
MongoDB: An Introduction - june-2011
MongoDB:  An Introduction - june-2011MongoDB:  An Introduction - june-2011
MongoDB: An Introduction - june-2011
Chris Westin
 
The Basics of MongoDB
The Basics of MongoDBThe Basics of MongoDB
The Basics of MongoDB
valuebound
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Mike Dirolf
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
César Trigo
 
Introduction to mongo db
Introduction to mongo dbIntroduction to mongo db
Introduction to mongo db
Rohit Bishnoi
 

Viewers also liked (20)

Innovative
InnovativeInnovative
Innovative
ameenath2015
 
Steve Carpenter Art | Four Seasons Mural | Press Release 2014
Steve Carpenter Art | Four Seasons Mural | Press Release 2014Steve Carpenter Art | Four Seasons Mural | Press Release 2014
Steve Carpenter Art | Four Seasons Mural | Press Release 2014
Debra VanWert
 
Open educational resources - Pros and Cons
Open educational resources - Pros and ConsOpen educational resources - Pros and Cons
Open educational resources - Pros and Cons
MediaLib
 
How to leave smoking
How to leave smokingHow to leave smoking
How to leave smoking
Generic Drug Limited
 
Siddhant Resume 1
Siddhant Resume 1Siddhant Resume 1
Siddhant Resume 1
siddhant suhas joshi Sidjoshi92
 
Rehabilitacion Psicosicial Jornada cd lleida 2011
Rehabilitacion Psicosicial Jornada cd lleida 2011Rehabilitacion Psicosicial Jornada cd lleida 2011
Rehabilitacion Psicosicial Jornada cd lleida 2011
jrbellidomainar
 
דוקטור מוטי משיח על התמכרות לאלכוהול
דוקטור מוטי משיח על התמכרות לאלכוהולדוקטור מוטי משיח על התמכרות לאלכוהול
דוקטור מוטי משיח על התמכרות לאלכוהול
מוטי משיח
 
M F -CV 2015
M F -CV 2015M F -CV 2015
M F -CV 2015
Mohammed Fatayer
 
CURRICULUM VITAE GR
CURRICULUM VITAE GRCURRICULUM VITAE GR
CURRICULUM VITAE GR
Girdhari Ram
 
Appreciating differences certificate
Appreciating differences certificateAppreciating differences certificate
Appreciating differences certificate
Rehan Mohamed
 
Alejandro Exarcheas-Ibarra's Personal Persona Project
Alejandro Exarcheas-Ibarra's Personal Persona ProjectAlejandro Exarcheas-Ibarra's Personal Persona Project
Alejandro Exarcheas-Ibarra's Personal Persona Project
Alejandro Ibarra
 
на барикадах кенгіра
на барикадах кенгірана барикадах кенгіра
на барикадах кенгіра
kayasavchuk
 
Oracle sql material
Oracle sql materialOracle sql material
Oracle sql material
prathap kumar
 
AFNetworking
AFNetworking AFNetworking
AFNetworking
joaopmaia
 
E
EE
E
Ankur Raina
 
27 fcs157al3
27 fcs157al327 fcs157al3
27 fcs157al3
CHANDRA BHUSHAN
 
J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Tour
oscon2007
 
Web services tutorial
Web services tutorialWeb services tutorial
Web services tutorial
prathap kumar
 
Steve Carpenter Art | Four Seasons Mural | Press Release 2014
Steve Carpenter Art | Four Seasons Mural | Press Release 2014Steve Carpenter Art | Four Seasons Mural | Press Release 2014
Steve Carpenter Art | Four Seasons Mural | Press Release 2014
Debra VanWert
 
Open educational resources - Pros and Cons
Open educational resources - Pros and ConsOpen educational resources - Pros and Cons
Open educational resources - Pros and Cons
MediaLib
 
Rehabilitacion Psicosicial Jornada cd lleida 2011
Rehabilitacion Psicosicial Jornada cd lleida 2011Rehabilitacion Psicosicial Jornada cd lleida 2011
Rehabilitacion Psicosicial Jornada cd lleida 2011
jrbellidomainar
 
דוקטור מוטי משיח על התמכרות לאלכוהול
דוקטור מוטי משיח על התמכרות לאלכוהולדוקטור מוטי משיח על התמכרות לאלכוהול
דוקטור מוטי משיח על התמכרות לאלכוהול
מוטי משיח
 
CURRICULUM VITAE GR
CURRICULUM VITAE GRCURRICULUM VITAE GR
CURRICULUM VITAE GR
Girdhari Ram
 
Appreciating differences certificate
Appreciating differences certificateAppreciating differences certificate
Appreciating differences certificate
Rehan Mohamed
 
Alejandro Exarcheas-Ibarra's Personal Persona Project
Alejandro Exarcheas-Ibarra's Personal Persona ProjectAlejandro Exarcheas-Ibarra's Personal Persona Project
Alejandro Exarcheas-Ibarra's Personal Persona Project
Alejandro Ibarra
 
на барикадах кенгіра
на барикадах кенгірана барикадах кенгіра
на барикадах кенгіра
kayasavchuk
 
AFNetworking
AFNetworking AFNetworking
AFNetworking
joaopmaia
 
J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Tour
oscon2007
 
Web services tutorial
Web services tutorialWeb services tutorial
Web services tutorial
prathap kumar
 
Ad

Similar to Mongo db (20)

MongoDB - An Introduction
MongoDB - An IntroductionMongoDB - An Introduction
MongoDB - An Introduction
sethfloydjr
 
Mongo db
Mongo dbMongo db
Mongo db
Gyanendra Yadav
 
Mongo DB
Mongo DBMongo DB
Mongo DB
SRM University Delhi-NCR sonepat
 
lecture_34e.pptx
lecture_34e.pptxlecture_34e.pptx
lecture_34e.pptx
janibashashaik25
 
3-Mongodb and Mapreduce Programming.pdf
3-Mongodb and Mapreduce Programming.pdf3-Mongodb and Mapreduce Programming.pdf
3-Mongodb and Mapreduce Programming.pdf
MarianJRuben
 
Top MongoDB interview Questions and Answers
Top MongoDB interview Questions and AnswersTop MongoDB interview Questions and Answers
Top MongoDB interview Questions and Answers
jeetendra mandal
 
MongoDB introduction features -presentation - 2.pptx
MongoDB introduction features -presentation - 2.pptxMongoDB introduction features -presentation - 2.pptx
MongoDB introduction features -presentation - 2.pptx
sampathkumar546444
 
Kalp Corporate MongoDB Tutorials
Kalp Corporate MongoDB TutorialsKalp Corporate MongoDB Tutorials
Kalp Corporate MongoDB Tutorials
Kalp Corporate
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
S.Shayan Daneshvar
 
Mongodb By Vipin
Mongodb By VipinMongodb By Vipin
Mongodb By Vipin
Vipin Mundayad
 
MongoDB Interview Questions PDF By ScholarHat
MongoDB Interview Questions PDF By ScholarHatMongoDB Interview Questions PDF By ScholarHat
MongoDB Interview Questions PDF By ScholarHat
Scholarhat
 
Mongodb Introduction
Mongodb IntroductionMongodb Introduction
Mongodb Introduction
Raghvendra Parashar
 
Mondodb
MondodbMondodb
Mondodb
Paulo Fagundes
 
MongoDB Interview Questions PDF By ScholarHat
MongoDB Interview Questions PDF By ScholarHatMongoDB Interview Questions PDF By ScholarHat
MongoDB Interview Questions PDF By ScholarHat
Scholarhat
 
MongoDB - An Introduction
MongoDB - An IntroductionMongoDB - An Introduction
MongoDB - An Introduction
dinkar thakur
 
Mongo learning series
Mongo learning series Mongo learning series
Mongo learning series
Prashanth Panduranga
 
MongoDB
MongoDBMongoDB
MongoDB
Ganesh Kunwar
 
Building your first app with MongoDB
Building your first app with MongoDBBuilding your first app with MongoDB
Building your first app with MongoDB
Norberto Leite
 
Mongodb - NoSql Database
Mongodb - NoSql DatabaseMongodb - NoSql Database
Mongodb - NoSql Database
Prashant Gupta
 
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
 
MongoDB - An Introduction
MongoDB - An IntroductionMongoDB - An Introduction
MongoDB - An Introduction
sethfloydjr
 
3-Mongodb and Mapreduce Programming.pdf
3-Mongodb and Mapreduce Programming.pdf3-Mongodb and Mapreduce Programming.pdf
3-Mongodb and Mapreduce Programming.pdf
MarianJRuben
 
Top MongoDB interview Questions and Answers
Top MongoDB interview Questions and AnswersTop MongoDB interview Questions and Answers
Top MongoDB interview Questions and Answers
jeetendra mandal
 
MongoDB introduction features -presentation - 2.pptx
MongoDB introduction features -presentation - 2.pptxMongoDB introduction features -presentation - 2.pptx
MongoDB introduction features -presentation - 2.pptx
sampathkumar546444
 
Kalp Corporate MongoDB Tutorials
Kalp Corporate MongoDB TutorialsKalp Corporate MongoDB Tutorials
Kalp Corporate MongoDB Tutorials
Kalp Corporate
 
MongoDB Interview Questions PDF By ScholarHat
MongoDB Interview Questions PDF By ScholarHatMongoDB Interview Questions PDF By ScholarHat
MongoDB Interview Questions PDF By ScholarHat
Scholarhat
 
MongoDB Interview Questions PDF By ScholarHat
MongoDB Interview Questions PDF By ScholarHatMongoDB Interview Questions PDF By ScholarHat
MongoDB Interview Questions PDF By ScholarHat
Scholarhat
 
MongoDB - An Introduction
MongoDB - An IntroductionMongoDB - An Introduction
MongoDB - An Introduction
dinkar thakur
 
Building your first app with MongoDB
Building your first app with MongoDBBuilding your first app with MongoDB
Building your first app with MongoDB
Norberto Leite
 
Mongodb - NoSql Database
Mongodb - NoSql DatabaseMongodb - NoSql Database
Mongodb - NoSql Database
Prashant Gupta
 
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
 
Ad

More from Raghu nath (20)

Ftp (file transfer protocol)
Ftp (file transfer protocol)Ftp (file transfer protocol)
Ftp (file transfer protocol)
Raghu nath
 
MS WORD 2013
MS WORD 2013MS WORD 2013
MS WORD 2013
Raghu nath
 
Msword
MswordMsword
Msword
Raghu nath
 
Ms word
Ms wordMs word
Ms word
Raghu nath
 
Javascript part1
Javascript part1Javascript part1
Javascript part1
Raghu nath
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
Raghu nath
 
Selection sort
Selection sortSelection sort
Selection sort
Raghu nath
 
Binary search
Binary search Binary search
Binary search
Raghu nath
 
JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)
Raghu nath
 
Stemming algorithms
Stemming algorithmsStemming algorithms
Stemming algorithms
Raghu nath
 
Step by step guide to install dhcp role
Step by step guide to install dhcp roleStep by step guide to install dhcp role
Step by step guide to install dhcp role
Raghu nath
 
Network essentials chapter 4
Network essentials  chapter 4Network essentials  chapter 4
Network essentials chapter 4
Raghu nath
 
Network essentials chapter 3
Network essentials  chapter 3Network essentials  chapter 3
Network essentials chapter 3
Raghu nath
 
Network essentials chapter 2
Network essentials  chapter 2Network essentials  chapter 2
Network essentials chapter 2
Raghu nath
 
Network essentials - chapter 1
Network essentials - chapter 1Network essentials - chapter 1
Network essentials - chapter 1
Raghu nath
 
Python chapter 2
Python chapter 2Python chapter 2
Python chapter 2
Raghu nath
 
python chapter 1
python chapter 1python chapter 1
python chapter 1
Raghu nath
 
Linux Shell Scripting
Linux Shell ScriptingLinux Shell Scripting
Linux Shell Scripting
Raghu nath
 
Perl
PerlPerl
Perl
Raghu nath
 
Adv excel® 2013
Adv excel® 2013Adv excel® 2013
Adv excel® 2013
Raghu nath
 
Ftp (file transfer protocol)
Ftp (file transfer protocol)Ftp (file transfer protocol)
Ftp (file transfer protocol)
Raghu nath
 
Javascript part1
Javascript part1Javascript part1
Javascript part1
Raghu nath
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
Raghu nath
 
Selection sort
Selection sortSelection sort
Selection sort
Raghu nath
 
Binary search
Binary search Binary search
Binary search
Raghu nath
 
JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)
Raghu nath
 
Stemming algorithms
Stemming algorithmsStemming algorithms
Stemming algorithms
Raghu nath
 
Step by step guide to install dhcp role
Step by step guide to install dhcp roleStep by step guide to install dhcp role
Step by step guide to install dhcp role
Raghu nath
 
Network essentials chapter 4
Network essentials  chapter 4Network essentials  chapter 4
Network essentials chapter 4
Raghu nath
 
Network essentials chapter 3
Network essentials  chapter 3Network essentials  chapter 3
Network essentials chapter 3
Raghu nath
 
Network essentials chapter 2
Network essentials  chapter 2Network essentials  chapter 2
Network essentials chapter 2
Raghu nath
 
Network essentials - chapter 1
Network essentials - chapter 1Network essentials - chapter 1
Network essentials - chapter 1
Raghu nath
 
Python chapter 2
Python chapter 2Python chapter 2
Python chapter 2
Raghu nath
 
python chapter 1
python chapter 1python chapter 1
python chapter 1
Raghu nath
 
Linux Shell Scripting
Linux Shell ScriptingLinux Shell Scripting
Linux Shell Scripting
Raghu nath
 
Adv excel® 2013
Adv excel® 2013Adv excel® 2013
Adv excel® 2013
Raghu nath
 

Recently uploaded (20)

YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Unit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdfUnit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdf
KanchanPatil34
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Unit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdfUnit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdf
KanchanPatil34
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 

Mongo db

  • 2. MongoDB is a document-oriented database, not a relational one. A document-oriented database replaces the concept of a “row” with a more flexible model, the “document.”
  • 3. MongoDB is intended to be a general-purpose database so aside from creating, reading, updating, and deleting data Indexing Aggregation Special collection types
  • 4. MongoDB is made up of databases which contain collections. A collection is made up of documents. Each document is made up of fields. Collections can be indexed, which improves lookup and sorting performance. Finally, when we get data from MongoDB we do so through a cursor whose actual execution is delayed until necessary.
  • 5. In JavaScript, for example, documents are represented as objects: { "greeting“ : "Hello, world!“ }
  • 6. This simple document contains a single key, "greeting“ , with a value of "Hello, world!“ . Most documents will be more complex than this simple one and often will contain multiple key/value pairs: { "greeting“ :"Hello, world!","foo":3 }
  • 7. The keys in a document are strings. Any UTF-8 character is allowed in a key, with a few notable exceptions: Keys must not contain the character 0 (the null character). This character is used to signify the end of a key
  • 8. The . and $ characters have some special properties and should be used only in certain circumstances, as described in later chapters. In general, they should be considered reserved, and drivers will complain if they are used inappropriately.
  • 9. MongoDB is type-sensitive and case-sensitive Collections: A collection is a group of documents. Dynamic Schemas: Collections have dynamic schemas . This means that the documents within a single col‐ lection can have any number of different “shapes.”
  • 10. {"greeting“ : "Hello, world!"} { "foo":5} Naming: A collection is identified by its name. Collection names can be any UTF-8 string, with a few restrictions: The empty string ("") is not a valid collection name
  • 11. Collection names may not contain the character 0 (the null character) because this delineates the end of a collection name.
  • 12. Getting and Starting MongoDB MongoDB is almost always run as a network server that clients can connect to and perform operations on $ mongod mongod --help for help and startup options.
  • 13. When run with no arguments, mongod will use the default data directory, /data/db/ (or datadb on the current volume on Windows). If the data directory does not already exist or is not writable, the server will fail to start. It is important to create the data directory (e.g., mkdir -p /data/db/ ) and to make sure your user has permission to write to the directory before starting MongoDB
  • 14. Running the Shell To start the shell, run the mongo executable: $Mongo MongoDB shell version : 2.4 . 0 connecting to : test >
  • 15. The shell is a full-featured JavaScript interpreter, capable of running arbitrary JavaScript programs. To illustrate this, let’s perform some basic math: >x =200 200 >x/5; 40
  • 16. A MongoDB Client To see the database db is currently assigned to, type in db and hit Enter: >db Test
  • 17. Basic Operations with the Shel CRUD: create, read, update, and delete to manipulate and view data in the shell.
  • 18. Data Types Basic Data Types Documents in MongoDB can be thought of as “JSON-like” in that they are conceptually similar to objects in JavaScript. JSON is a simple representation of data: the specification can be described in about one paragraph (their website proves it) and lists only six data types.
  • 19. The most common types are Null Dates Arrays Embedded documents
  • 21. Creating, Updating, and Deleting Documents Adding new documents to a collection • Removing documents from a collection • Updating existing documents • Choosing the correct level of safety versus speed for all of these operations
  • 22. Inserting and Saving Documents Inserts are the basic method for adding data to MongoDB. Batch Insert Batch inserts allow you to pass an array of documents to the database. Insert Validation MongoDB does minimal checks on data being inserted:
  • 23. Removing Documents Now that there’s data in our database, let’s delete it: Remove Speed Removing documents is usually a fairly quick operation. Updating Documents Setting a Write Concern
  • 24. Querying Find method is used to perform queries in MongoDB. Specifying Which Keys to Return Sometimes you do not need all of the key/value pairs in a document returned.
  • 25. Cursors The database returns results from find using a cursor.