SlideShare una empresa de Scribd logo
1 de 18
Descargar para leer sin conexión
Introduction
• Why No SQL
• The Different Types Of NoSQL Database
• Overview Of MongoDB
• Basic Operations In Mongo Shell
• More Concepts
Relational
The World Has Changed
Types of NoSQL Database
Key Value
Stores
Column
Stores
Graph
Stores
Multi-Model
Databases
Document Stores
MongoDb Document are Typed
String Fields
Nested Document
Array
Geo-spatial Coordinates
RDBMS Vs MongoDB Terminology
RDBMS MongoDB
Database Database
Table Collection
Tuple/Row Document
Column Field
Table Join Embedded Documents
Primary Key
Primary Key (Default key _id provided
by mongodb itself)
Why Document ?
• Dynamic schema
• Elimination of object
relational mapping layer
• Implicit demoralization of
the data for performance.
Basic Operations In Mongo Shell
Commands Use
>use db_name
This command create database with the name mydb, but not show
newly created database in database list until unless it have at least
one document in it
>db This command shows currently selected database
>show dbs This command shows database list
>db.dropDatabase() Drop the database currently in use
Basic Operations In Mongo Shell
Commands Use
>db.createCollection(Na
me,Options)
This create a new collection in database which is currently under use
example
db.createCollection("mycol", { capped : true, autoIndexID : true, size :
6142800, max : 10000 } )
>db.COLLECTION_NAM
E.drop()
This command use to drop collection from database currently in use
Basic Operations In Mongo Shell
Commands Use
>db.COLLECTION_NAM
E.insert(document)
This command insert single data/document in specifient collection
and if collection is not already exist it will create one.
>db.COLLECTION_NAM
E.insert([document]) This command use to insert multiple documents, in the form of array
*if we don't specify the _id parameter, then MongoDB assigns a unique ObjectId for this
document.
*_id: ObjectId(4 bytes timestamp, 3 bytes machine id, 2 bytes process id, 3 bytes incrementer)
Basic Operations In Mongo Shell
Commands Use
>db.COLLECTION_NAME.update(S
ELECTION_CRITERIA,
UPDATED_DATA)
This command updates the values in the existing
document
>db.COLLECTION_NAME.save({_id
:ObjectId(),NEW_DATA})
This command replaces the existing document with the
document passed in save() method.
>db.COLLECTION_NAME.remove(
DELLETION_CRITTERIA)
Remove all the documents with deletion criteria
>db.COLLECTION_NAME.remove(
DELETION_CRITERIA,1)
If there are multiple records and you want to delete only
the first record, then set justOne parameter in remove()
method.
Basic Operations In Mongo Shell
Commands Use
>db.mycol.remove()
If you don't specify deletion criteria, then MongoDB will
delete whole documents from the collection.
>db.mycol.find().pretty()
To query data from MongoDB collection, you need to use
MongoDB's find() method. To display the results in a
formatted way, you can use pretty() method.
>db.mycol.find( { $and: [ {key1:
value1}, {key2:value2} ] } ).pretty()
In the find() method, if you pass multiple keys by
separating them by ',' then MongoDB treats it
as AND condition.
>db.mycol.find( { $or: [ {key1:
value1}, {key2:value2} ] } ).pretty()
To query documents based on the OR condition, you
need to use $or keyword.
Basic Operations In Mongo Shell
Commands Use
>db.mycol.createIndex({"title":1,"des
cription":-1})
This command pass multiple fields, to create index on
multiple fields.
>db.COLLECTION_NAME.find({},{K
EY:1})
In MongoDB, when you execute find() method, then it
displays all fields of a document. To limit this, you need to
set a list of fields with value 1 or 0. 1 is used to show the
field while 0 is used to hide the fields.
>db.COLLECTION_NAME.createInd
ex({"title":1})
This command is use for giving index to specified field
Embedded Relationships
{
“name": “Nouman Ellahi",
“title": “Software engineer",
"address_ids": [123, 1234]
}
( [ { "_id": 123,
"area": "G9/4",
"city": "Islamabad",
"state": "Pakistan“ },
{ "_id": 1234,
"area": "Wapda Town",
"city": "Chicago",
"state": "Pakistan“ } ] )
Address Collection
Employee Collection
More Concepts
• Replica set
• Sharding
• Aggregation
• GridFS
References and Recommended Readings
• https://www.mongodb.com/presentations/back-to-basics-webinar-1-
introduction-to-nosql
• https://www.tutorialspoint.com/mongodb/index.htm
• http://mongodb.github.io/mongo-java-driver/3.4/driver/getting-
started/quick-start/
• https://docs.mongodb.com/manual/
• https://docs.mongodb.com/getting-started/node/insert/

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Mongo db
Mongo dbMongo db
Mongo db
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Mongo DB 102
Mongo DB 102Mongo DB 102
Mongo DB 102
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
 
Mongo db basics
Mongo db basicsMongo db basics
Mongo db basics
 
Mongo DB Presentation
Mongo DB PresentationMongo DB Presentation
Mongo DB Presentation
 
Mongo db basics
Mongo db basicsMongo db basics
Mongo db basics
 
Connecting NodeJS & MongoDB
Connecting NodeJS & MongoDBConnecting NodeJS & MongoDB
Connecting NodeJS & MongoDB
 
MongoDB basics & Introduction
MongoDB basics & IntroductionMongoDB basics & Introduction
MongoDB basics & Introduction
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Mongo db
Mongo dbMongo db
Mongo db
 
Mongodb basics and architecture
Mongodb basics and architectureMongodb basics and architecture
Mongodb basics and architecture
 
MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
The Basics of MongoDB
The Basics of MongoDBThe Basics of MongoDB
The Basics of MongoDB
 
Mongodb - NoSql Database
Mongodb - NoSql DatabaseMongodb - NoSql Database
Mongodb - NoSql Database
 
MongoDB 101
MongoDB 101MongoDB 101
MongoDB 101
 
Mongo db operations_v2
Mongo db operations_v2Mongo db operations_v2
Mongo db operations_v2
 
Mongo DB
Mongo DBMongo DB
Mongo DB
 
Mongo db dhruba
Mongo db dhrubaMongo db dhruba
Mongo db dhruba
 

Destacado

Administration (Eliot Horowitz)
Administration (Eliot Horowitz)Administration (Eliot Horowitz)
Administration (Eliot Horowitz)
MongoSF
 

Destacado (18)

Mongo DB
Mongo DBMongo DB
Mongo DB
 
Intro To MongoDB
Intro To MongoDBIntro To MongoDB
Intro To MongoDB
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Mongo db
Mongo dbMongo db
Mongo db
 
Administration (Eliot Horowitz)
Administration (Eliot Horowitz)Administration (Eliot Horowitz)
Administration (Eliot Horowitz)
 
MediaGlu and Mongo DB
MediaGlu and Mongo DBMediaGlu and Mongo DB
MediaGlu and Mongo DB
 
Mongo db tutorials
Mongo db tutorialsMongo db tutorials
Mongo db tutorials
 
Shankar's mongo db presentation
Shankar's mongo db presentationShankar's mongo db presentation
Shankar's mongo db presentation
 
Big data Career Opportunuties
Big data  Career OpportunutiesBig data  Career Opportunuties
Big data Career Opportunuties
 
Broadcasting 3.0
Broadcasting 3.0Broadcasting 3.0
Broadcasting 3.0
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Intro to NoSQL and MongoDB
 Intro to NoSQL and MongoDB Intro to NoSQL and MongoDB
Intro to NoSQL and MongoDB
 
MongoDB
MongoDBMongoDB
MongoDB
 
An Evening with MongoDB - Orlando: Welcome and Keynote
An Evening with MongoDB - Orlando: Welcome and KeynoteAn Evening with MongoDB - Orlando: Welcome and Keynote
An Evening with MongoDB - Orlando: Welcome and Keynote
 
mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Mongodb intro
Mongodb introMongodb intro
Mongodb intro
 
Seth Edwards on MongoDB
Seth Edwards on MongoDBSeth Edwards on MongoDB
Seth Edwards on MongoDB
 

Similar a Mongo db

171_74_216_Module_5-Non_relational_database_-mongodb.pptx
171_74_216_Module_5-Non_relational_database_-mongodb.pptx171_74_216_Module_5-Non_relational_database_-mongodb.pptx
171_74_216_Module_5-Non_relational_database_-mongodb.pptx
sukrithlal008
 
Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)
Kai Zhao
 
introtomongodb
introtomongodbintrotomongodb
introtomongodb
saikiran
 

Similar a Mongo db (20)

Getting Started with MongoDB
Getting Started with MongoDBGetting Started with MongoDB
Getting Started with MongoDB
 
Experiment no 2
Experiment no 2Experiment no 2
Experiment no 2
 
171_74_216_Module_5-Non_relational_database_-mongodb.pptx
171_74_216_Module_5-Non_relational_database_-mongodb.pptx171_74_216_Module_5-Non_relational_database_-mongodb.pptx
171_74_216_Module_5-Non_relational_database_-mongodb.pptx
 
Mongo db basics
Mongo db basicsMongo db basics
Mongo db basics
 
fard car.pptx
fard car.pptxfard car.pptx
fard car.pptx
 
MongoDB-presentation.pptx
MongoDB-presentation.pptxMongoDB-presentation.pptx
MongoDB-presentation.pptx
 
How to use MongoDB with CakePHP
How to use MongoDB with CakePHPHow to use MongoDB with CakePHP
How to use MongoDB with CakePHP
 
Mongo db queries
Mongo db queriesMongo db queries
Mongo db queries
 
mongo.pptx
mongo.pptxmongo.pptx
mongo.pptx
 
Overview on NoSQL and MongoDB
Overview on NoSQL and MongoDBOverview on NoSQL and MongoDB
Overview on NoSQL and MongoDB
 
Introduction To MongoDB
Introduction To MongoDBIntroduction To MongoDB
Introduction To MongoDB
 
Mongo db
Mongo dbMongo db
Mongo db
 
Mongo db
Mongo dbMongo db
Mongo db
 
MongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behlMongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behl
 
Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)
 
London MongoDB User Group April 2011
London MongoDB User Group April 2011London MongoDB User Group April 2011
London MongoDB User Group April 2011
 
MongoDB_ppt.pptx
MongoDB_ppt.pptxMongoDB_ppt.pptx
MongoDB_ppt.pptx
 
MongoDB
MongoDBMongoDB
MongoDB
 
MongoDB - An Introduction
MongoDB - An IntroductionMongoDB - An Introduction
MongoDB - An Introduction
 
introtomongodb
introtomongodbintrotomongodb
introtomongodb
 

Último

➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
amitlee9823
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men 🔝Ongole🔝 Escorts S...
➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men  🔝Ongole🔝   Escorts S...➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men  🔝Ongole🔝   Escorts S...
➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men 🔝Ongole🔝 Escorts S...
amitlee9823
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
amitlee9823
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
karishmasinghjnh
 
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
gajnagarg
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
amitlee9823
 
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
amitlee9823
 
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
amitlee9823
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
amitlee9823
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
amitlee9823
 
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...
gajnagarg
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
amitlee9823
 

Último (20)

➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men 🔝Ongole🔝 Escorts S...
➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men  🔝Ongole🔝   Escorts S...➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men  🔝Ongole🔝   Escorts S...
➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men 🔝Ongole🔝 Escorts S...
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
 
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
 
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
 
Detecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning ApproachDetecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning Approach
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
 
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 

Mongo db

  • 1.
  • 2. Introduction • Why No SQL • The Different Types Of NoSQL Database • Overview Of MongoDB • Basic Operations In Mongo Shell • More Concepts
  • 4. The World Has Changed
  • 5.
  • 6. Types of NoSQL Database Key Value Stores Column Stores Graph Stores Multi-Model Databases Document Stores
  • 7. MongoDb Document are Typed String Fields Nested Document Array Geo-spatial Coordinates
  • 8. RDBMS Vs MongoDB Terminology RDBMS MongoDB Database Database Table Collection Tuple/Row Document Column Field Table Join Embedded Documents Primary Key Primary Key (Default key _id provided by mongodb itself)
  • 9. Why Document ? • Dynamic schema • Elimination of object relational mapping layer • Implicit demoralization of the data for performance.
  • 10. Basic Operations In Mongo Shell Commands Use >use db_name This command create database with the name mydb, but not show newly created database in database list until unless it have at least one document in it >db This command shows currently selected database >show dbs This command shows database list >db.dropDatabase() Drop the database currently in use
  • 11. Basic Operations In Mongo Shell Commands Use >db.createCollection(Na me,Options) This create a new collection in database which is currently under use example db.createCollection("mycol", { capped : true, autoIndexID : true, size : 6142800, max : 10000 } ) >db.COLLECTION_NAM E.drop() This command use to drop collection from database currently in use
  • 12. Basic Operations In Mongo Shell Commands Use >db.COLLECTION_NAM E.insert(document) This command insert single data/document in specifient collection and if collection is not already exist it will create one. >db.COLLECTION_NAM E.insert([document]) This command use to insert multiple documents, in the form of array *if we don't specify the _id parameter, then MongoDB assigns a unique ObjectId for this document. *_id: ObjectId(4 bytes timestamp, 3 bytes machine id, 2 bytes process id, 3 bytes incrementer)
  • 13. Basic Operations In Mongo Shell Commands Use >db.COLLECTION_NAME.update(S ELECTION_CRITERIA, UPDATED_DATA) This command updates the values in the existing document >db.COLLECTION_NAME.save({_id :ObjectId(),NEW_DATA}) This command replaces the existing document with the document passed in save() method. >db.COLLECTION_NAME.remove( DELLETION_CRITTERIA) Remove all the documents with deletion criteria >db.COLLECTION_NAME.remove( DELETION_CRITERIA,1) If there are multiple records and you want to delete only the first record, then set justOne parameter in remove() method.
  • 14. Basic Operations In Mongo Shell Commands Use >db.mycol.remove() If you don't specify deletion criteria, then MongoDB will delete whole documents from the collection. >db.mycol.find().pretty() To query data from MongoDB collection, you need to use MongoDB's find() method. To display the results in a formatted way, you can use pretty() method. >db.mycol.find( { $and: [ {key1: value1}, {key2:value2} ] } ).pretty() In the find() method, if you pass multiple keys by separating them by ',' then MongoDB treats it as AND condition. >db.mycol.find( { $or: [ {key1: value1}, {key2:value2} ] } ).pretty() To query documents based on the OR condition, you need to use $or keyword.
  • 15. Basic Operations In Mongo Shell Commands Use >db.mycol.createIndex({"title":1,"des cription":-1}) This command pass multiple fields, to create index on multiple fields. >db.COLLECTION_NAME.find({},{K EY:1}) In MongoDB, when you execute find() method, then it displays all fields of a document. To limit this, you need to set a list of fields with value 1 or 0. 1 is used to show the field while 0 is used to hide the fields. >db.COLLECTION_NAME.createInd ex({"title":1}) This command is use for giving index to specified field
  • 16. Embedded Relationships { “name": “Nouman Ellahi", “title": “Software engineer", "address_ids": [123, 1234] } ( [ { "_id": 123, "area": "G9/4", "city": "Islamabad", "state": "Pakistan“ }, { "_id": 1234, "area": "Wapda Town", "city": "Chicago", "state": "Pakistan“ } ] ) Address Collection Employee Collection
  • 17. More Concepts • Replica set • Sharding • Aggregation • GridFS
  • 18. References and Recommended Readings • https://www.mongodb.com/presentations/back-to-basics-webinar-1- introduction-to-nosql • https://www.tutorialspoint.com/mongodb/index.htm • http://mongodb.github.io/mongo-java-driver/3.4/driver/getting- started/quick-start/ • https://docs.mongodb.com/manual/ • https://docs.mongodb.com/getting-started/node/insert/