SlideShare ist ein Scribd-Unternehmen logo
1 von 51
javascript for your datajavascript for your data
MongoDB
Bridge the gap between key/val stores and
traditional RDBMS
MongoDB
Bridge the gap between key/val stores and
traditional RDBMS
MongoDB
the gap
● table
MongoDB
the gap
● table → collection
MongoDB
collection
MongoDB
collection
● BSON document
MongoDB
collection
● BSON document
● a set of fields
MongoDB
collection
● BSON document
● a set of fields
– key-value pair
MongoDB
collection
● BSON document
● a set of fields
– key-value pair
● key: a name (string)
MongoDB
collection
● BSON document
● a set of fields
– key-value pair
● key: a name (string)
● val: any basic type
– string, int, float, date, binary, array, document, ...
MongoDB
collection
● of BSON documents
● queryable
MongoDB
the gap
● table → collection
● SQL
MongoDB
the gap
● table → collection
● SQL → query objects
MongoDB
Query object
MongoDB
Query object
● JSON-like query representation
MongoDB
Query object
● JSON-like query representation
● db.users.find({ 'lastname': 'Heckmann' });
MongoDB
Query object
{ 'lastname': 'Heckmann' }
MongoDB
Query object
{ 'lastname': 'Heckmann' }
could even be an array
MongoDB
Query object
{ 'lastname': 'Heckmann'
, 'body.odor': 'nasty'
, 'age': { $gt: 32 }
, ...
}
MongoDB
Query object
{ 'lastname': 'Heckmann'
, 'body.odor': 'nasty'
, 'age': { $gt: 32 }
, ...
}
MongoDB
Query object
{ 'lastname': 'Heckmann'
, 'body.odor': 'nasty'
, 'age': { $gt: 32 }
, ...
}
MongoDB
Query object
{ 'lastname': 'Heckmann'
, 'body.odor': 'nasty'
, 'age': { $gt: 32, $lt: 65 }
, ...
}
MongoDB
Query object
$gt
$lt
$ne
$in
$nin
$all
$not
$size
$exists
… more
MongoDB
Query object
RegExp too!
MongoDB
Query object
RegExp too
db.users.find({ 'lastname': /eckmann$/i });
MongoDB
Query object
Subsets
db.users.find({ 'lastname': /eckmann$/i }, { 'age': true });
MongoDB
Query object
db.users
.find({ 'lastname': /eckmann$/i })
.sort({ 'lastname': -1 })
.limit(10)
.skip(10*(pageNumber - 1))
;
MongoDB
Query object
db.users
.find({ 'lastname': /eckmann$/i })
.sort({ 'lastname': -1 }) ← descending
.limit(10)
.skip(10*(pageNumber - 1))
;
MongoDB
Query object
db.users
.find({ 'lastname': /eckmann$/i })
.count()
;
MongoDB
● no JOINs
MongoDB
● no JOINs
● less normalization
MongoDB
● no JOINs
● less normalization
● embedded documents
MongoDB
embedded documents
MongoDB
embedded documents
{ name: 'aaron'
, scores:
[ { total: 93, class: ObjectID }
, { total: 46, class: ObjectID }
, { total: 20, class: ObjectID }
]
}
MongoDB
embedded documents
{ name: 'aaron'
, scores:
[ { total: 93, class: ObjectID }
, { total: 46, class: ObjectID }
, { total: 20, class: ObjectID }
]
}
think foreign keys
MongoDB
embedded documents
{ name: 'aaron'
, scores:
[ { total: 93, class: ObjectID }
, { total: 46, class: ObjectID }
, { total: 20, class: ObjectID }
]
}
{ _id: ObjectID
, name: 'how to be a good neighbor'
, teacher: 'mr rogers'
}
MongoDB
ObjectID
● unique identifier of a document
● each document has one
● auto inserted if missing
MongoDB
Insertion and UpdationInsertion and Updation
MongoDB
cheesy
Atomic OperationsAtomic Operations
MongoDB
$set
$unset
$inc
$push
$pushAll
$pop
$pull
$pullAll
$addToSet
$rename
Atomic Ops
MongoDB
IndexingIndexing
MongoDB
Indexing
● any property
● into embedded documents
● into arrays
MongoDB
Indexing
db.users.ensureIndex({ lastname: 1 })
db.users.ensureIndex({ 'body.odor': 1 })
db.users.ensureIndex({ 'body.odor': 1, age: 1 })
MongoDB
HTTP InterfaceHTTP Interface
MongoDB
HTTP Interface
● http://localhost:28017/
● http://localhost:28017/database/collection/?limit=5
● http://localhost:28017/database/collection/?filter_key=value
MongoDB
● Document oriented
● Schema-less
● Rich queries
● Full index support
● Atomic operations
● MapReduce
● Auto-sharding / replication / GridFS
MongoDB
Mongoose
● https://github.com/learnboost/mongoose/tree/1.0
Thank You
http://www.mongodb.org
https://github.com/mongodb
https://github.com/learnboost/mongoose
https://github.com/christkv/node-mongodb-native
http://www.mongodb.org/display/DOCS/Production+Deployments
https://github.com/aheckmann
http://twitter.com/#!/aaronheckmann

Weitere ähnliche Inhalte

Was ist angesagt?

MongoDB - A Document NoSQL Database
MongoDB - A Document NoSQL DatabaseMongoDB - A Document NoSQL Database
MongoDB - A Document NoSQL Database
Ruben Inoto Soto
 
Meetup#1: 10 reasons to fall in love with MongoDB
Meetup#1: 10 reasons to fall in love with MongoDBMeetup#1: 10 reasons to fall in love with MongoDB
Meetup#1: 10 reasons to fall in love with MongoDB
Minsk MongoDB User Group
 
MongoDb and NoSQL
MongoDb and NoSQLMongoDb and NoSQL
MongoDb and NoSQL
TO THE NEW | Technology
 
MongoDB : The Definitive Guide
MongoDB : The Definitive GuideMongoDB : The Definitive Guide
MongoDB : The Definitive Guide
Wildan Maulana
 

Was ist angesagt? (20)

MongoDB - Ekino PHP
MongoDB - Ekino PHPMongoDB - Ekino PHP
MongoDB - Ekino PHP
 
MongoDB - A Document NoSQL Database
MongoDB - A Document NoSQL DatabaseMongoDB - A Document NoSQL Database
MongoDB - A Document NoSQL Database
 
Introduction to MongoDB and Hadoop
Introduction to MongoDB and HadoopIntroduction to MongoDB and Hadoop
Introduction to MongoDB and Hadoop
 
Mongo Nosql CRUD Operations
Mongo Nosql CRUD OperationsMongo Nosql CRUD Operations
Mongo Nosql CRUD Operations
 
MongoDB
MongoDBMongoDB
MongoDB
 
Meetup#1: 10 reasons to fall in love with MongoDB
Meetup#1: 10 reasons to fall in love with MongoDBMeetup#1: 10 reasons to fall in love with MongoDB
Meetup#1: 10 reasons to fall in love with MongoDB
 
Back to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB ApplicationBack to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB Application
 
MySQL Without The SQL -- Oh My! PHP Detroit July 2018
MySQL Without The SQL -- Oh My! PHP Detroit July 2018MySQL Without The SQL -- Oh My! PHP Detroit July 2018
MySQL Without The SQL -- Oh My! PHP Detroit July 2018
 
MongoDB 101
MongoDB 101MongoDB 101
MongoDB 101
 
Back to Basics Webinar 1: Introduction to NoSQL
Back to Basics Webinar 1: Introduction to NoSQLBack to Basics Webinar 1: Introduction to NoSQL
Back to Basics Webinar 1: Introduction to NoSQL
 
Mongo Presentation by Metatagg Solutions
Mongo Presentation by Metatagg SolutionsMongo Presentation by Metatagg Solutions
Mongo Presentation by Metatagg Solutions
 
PhpstudyTokyo MongoDB PHP CakePHP
PhpstudyTokyo MongoDB PHP CakePHPPhpstudyTokyo MongoDB PHP CakePHP
PhpstudyTokyo MongoDB PHP CakePHP
 
MongoDB for Analytics
MongoDB for AnalyticsMongoDB for Analytics
MongoDB for Analytics
 
Introduction to CouchDB - LA Hacker News
Introduction to CouchDB - LA Hacker NewsIntroduction to CouchDB - LA Hacker News
Introduction to CouchDB - LA Hacker News
 
MongoDb and NoSQL
MongoDb and NoSQLMongoDb and NoSQL
MongoDb and NoSQL
 
MongoDB : The Definitive Guide
MongoDB : The Definitive GuideMongoDB : The Definitive Guide
MongoDB : The Definitive Guide
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
 
Doing Joins in MongoDB: Best Practices for Using $lookup
Doing Joins in MongoDB: Best Practices for Using $lookupDoing Joins in MongoDB: Best Practices for Using $lookup
Doing Joins in MongoDB: Best Practices for Using $lookup
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Simple MongoDB design for Rails apps
Simple MongoDB design for Rails appsSimple MongoDB design for Rails apps
Simple MongoDB design for Rails apps
 

Ähnlich wie MongoDB - Javascript for your Data

Marc s01 e02-crud-database
Marc s01 e02-crud-databaseMarc s01 e02-crud-database
Marc s01 e02-crud-database
MongoDB
 
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
MongoDB
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Alex Bilbie
 
Сергей Матвеенко: MongoEngine: NoORM for NoSQL
Сергей Матвеенко: MongoEngine: NoORM for NoSQLСергей Матвеенко: MongoEngine: NoORM for NoSQL
Сергей Матвеенко: MongoEngine: NoORM for NoSQL
it-people
 
Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)
Kai Zhao
 

Ähnlich wie MongoDB - Javascript for your Data (20)

Mongo db
Mongo dbMongo db
Mongo db
 
Spray Json and MongoDB Queries: Insights and Simple Tricks.
Spray Json and MongoDB Queries: Insights and Simple Tricks.Spray Json and MongoDB Queries: Insights and Simple Tricks.
Spray Json and MongoDB Queries: Insights and Simple Tricks.
 
Mongo DB Presentation
Mongo DB PresentationMongo DB Presentation
Mongo DB Presentation
 
Webinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev TeamsWebinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev Teams
 
Mongo DB 102
Mongo DB 102Mongo DB 102
Mongo DB 102
 
Marc s01 e02-crud-database
Marc s01 e02-crud-databaseMarc s01 e02-crud-database
Marc s01 e02-crud-database
 
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Introduction to MongoDB and Workshop
Introduction to MongoDB and WorkshopIntroduction to MongoDB and Workshop
Introduction to MongoDB and Workshop
 
Analytics with MongoDB Aggregation Framework and Hadoop Connector
Analytics with MongoDB Aggregation Framework and Hadoop ConnectorAnalytics with MongoDB Aggregation Framework and Hadoop Connector
Analytics with MongoDB Aggregation Framework and Hadoop Connector
 
Mongo learning series
Mongo learning series Mongo learning series
Mongo learning series
 
Working with JSON Data in PostgreSQL vs. MongoDB
Working with JSON Data in PostgreSQL vs. MongoDBWorking with JSON Data in PostgreSQL vs. MongoDB
Working with JSON Data in PostgreSQL vs. MongoDB
 
Latinoware
LatinowareLatinoware
Latinoware
 
MongoDB Aggregation Framework
MongoDB Aggregation FrameworkMongoDB Aggregation Framework
MongoDB Aggregation Framework
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Сергей Матвеенко: MongoEngine: NoORM for NoSQL
Сергей Матвеенко: MongoEngine: NoORM for NoSQLСергей Матвеенко: MongoEngine: NoORM for NoSQL
Сергей Матвеенко: MongoEngine: NoORM for NoSQL
 
MongoDB Aggregations Indexing and Profiling
MongoDB Aggregations Indexing and ProfilingMongoDB Aggregations Indexing and Profiling
MongoDB Aggregations Indexing and Profiling
 
One BSON to Rule Them
One BSON to Rule ThemOne BSON to Rule Them
One BSON to Rule Them
 
Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)
 
Mongo DB schema design patterns
Mongo DB schema design patternsMongo DB schema design patterns
Mongo DB schema design patterns
 

Mehr von Paulo Fagundes

The Power of Relationships in Your Big Data
The Power of Relationships in Your Big DataThe Power of Relationships in Your Big Data
The Power of Relationships in Your Big Data
Paulo Fagundes
 
Oracle NoSQL Database release 3.0 overview
Oracle NoSQL Database release 3.0 overviewOracle NoSQL Database release 3.0 overview
Oracle NoSQL Database release 3.0 overview
Paulo Fagundes
 

Mehr von Paulo Fagundes (10)

Oracle exalytics deployment for high availability
Oracle exalytics deployment for high availabilityOracle exalytics deployment for high availability
Oracle exalytics deployment for high availability
 
Backup and Restore of database on 2-Node RAC
Backup and Restore of database on 2-Node RACBackup and Restore of database on 2-Node RAC
Backup and Restore of database on 2-Node RAC
 
Zero Downtime for Oracle E-Business Suite on Oracle Exalogic
Zero Downtime for Oracle E-Business Suite on Oracle ExalogicZero Downtime for Oracle E-Business Suite on Oracle Exalogic
Zero Downtime for Oracle E-Business Suite on Oracle Exalogic
 
Mongodb
MongodbMongodb
Mongodb
 
MongoDB for the SQL Server
MongoDB for the SQL ServerMongoDB for the SQL Server
MongoDB for the SQL Server
 
Capacityplanning
Capacityplanning Capacityplanning
Capacityplanning
 
The Little MongoDB Book - Karl Seguin
The Little MongoDB Book - Karl SeguinThe Little MongoDB Book - Karl Seguin
The Little MongoDB Book - Karl Seguin
 
Oracle NoSQL Database Compared to Cassandra and HBase
Oracle NoSQL Database Compared to Cassandra and HBaseOracle NoSQL Database Compared to Cassandra and HBase
Oracle NoSQL Database Compared to Cassandra and HBase
 
The Power of Relationships in Your Big Data
The Power of Relationships in Your Big DataThe Power of Relationships in Your Big Data
The Power of Relationships in Your Big Data
 
Oracle NoSQL Database release 3.0 overview
Oracle NoSQL Database release 3.0 overviewOracle NoSQL Database release 3.0 overview
Oracle NoSQL Database release 3.0 overview
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

MongoDB - Javascript for your Data