SlideShare a Scribd company logo
MongoDB In Action超群.com@fuchaoqunhttp://www.fuchaoqun.com
I will talk ….About MongoDB
Dynamic querys
Replication
Sharding
GridFS
Performance
About MongoDB?Document-oriented
JSON-style documents
Schema-free
Written in C++ for high  performance
Scalable
MapReduce
Many supported platforms & languagesDynamic querysSelectMySQL:SELECT * FROM userMongo:    db.user.find()MySQL:SELECT * FROM user WHERE name = 'foobar'Mongo:    db.user.find({'name' : 'foobar'})
Dynamic querysInsertMySQL:INSERT INOT user (`name`, `age`) values ('foobar',25)Mongo:    db.user.insert({'name' : 'foobar', 'age' : 25})if you want add a  column `email` on MySQL,you must :ALTER TABLE user….But in Mongo,you can just:    db.user.insert({'name' : 'foobar', 'age' : 25, 'email' : 'foo@bar.com'})
Dynamic querysDeleteMySQL:DELETE * FROM userMongo:    db.user.remove({})MySQL:DELETE FROM user WHERE age < 30Mongo:    db.user.remove({'age' : {$lt : 30}})$gt : > ; $gte : >= ; $lt : < ; $lte : <= ; $ne : !=
Dynamic querysUpdateMySQL:UPDATE user SET `age` = 36 WHERE `name` = 'foobar'Mongo:    db.user.update({'name' : 'foobar'}, {$set : {'age' : 36}})MySQL:    UPDATE user SET `age` = `age` + 3 WHERE `name` = 'foobar'Mongo:    db.user.update({'name' : 'foobar'}, {$inc : {'age' : 3}})See more @ http://tinyurl.com/yka6ras
Dynamic querysAdvancedMySQL:SELECT COUNT(*) FROM user WHERE `name` = 'foobar'Mongo:    db.user.find({'name' : 'foobar'}).count()MySQL:    SELECT * FROM user limit 10,20Mongo:    db.user.find().skip(10).limit(20)
Dynamic querysAdvancedMySQL:SELECT * FROM user WHERE `age` IN (25, 35,45)Mongo:    db.user.find({'age' : {$in : [25, 35, 45]}})MySQL:    SELECT * FROM user limit 10,20Mongo:    db.user.find().skip(10).limit(20)
Dynamic querysAdvancedMySQL:SELECT * FROM user ORDER BY age DESCMongo:    db.user.find().sort({'age' : -1})MySQL:    SELECT DISTINCT(name) FROM user WHERE age > 20Mongo:    db.user.distinct('name', {'age': {$lt : 20}})
Dynamic querysAdvancedMySQL:SELECT name, sum(marks) FROM user GROUP BY nameMongo:    db.user.group({        key : {'name' : true},cond: {'name' : 'foo'},        reduce: function(obj,prev) { prev.msum += obj.marks; },        initial: {msum : 0}    });MySQL:    SELECT name FROM user WHERE age < 20Mongo:    db.user.find('this.age < 20', {name : 1})See more @ http://tinyurl.com/ykyuuwo

More Related Content

PDF
MongoDB a document store that won't let you down.
PDF
Programming Language: Ruby
KEY
MongoDB: How it Works
PDF
MongoDB dla administratora
PDF
NOSQL: il rinascimento dei database?
PDF
FrozenRails Training
PDF
MongoUK - PHP Development
PDF
#RuPostgresLive 4: как писать и читать сложные SQL-запросы
MongoDB a document store that won't let you down.
Programming Language: Ruby
MongoDB: How it Works
MongoDB dla administratora
NOSQL: il rinascimento dei database?
FrozenRails Training
MongoUK - PHP Development
#RuPostgresLive 4: как писать и читать сложные SQL-запросы

What's hot (15)

TXT
Fcontratos
PPTX
Shankar's mongo db presentation
PDF
JavaScript Code Formatting With Prettier by Christopher Chedeau
PDF
言語の設計判断
PDF
2011 09-pdfjs
PDF
Apache CouchDB Presentation @ Sept. 2104 GTALUG Meeting
PDF
NoSQL - An introduction to CouchDB
PDF
The Lesser Known Features of ECMAScript 6
PDF
DeepLearning ハンズオン資料 20161220
ODP
MySQL vs. PostgreSQL
PPTX
Introduction to MongoDB for C# developers
DOCX
งานย่อยที่ 6
PDF
Making Mongo realtime - oplog tailing in Meteor
PDF
File-I/O -- ist doch ganz einfach, oder?
PPTX
Super Advanced Python –act1
Fcontratos
Shankar's mongo db presentation
JavaScript Code Formatting With Prettier by Christopher Chedeau
言語の設計判断
2011 09-pdfjs
Apache CouchDB Presentation @ Sept. 2104 GTALUG Meeting
NoSQL - An introduction to CouchDB
The Lesser Known Features of ECMAScript 6
DeepLearning ハンズオン資料 20161220
MySQL vs. PostgreSQL
Introduction to MongoDB for C# developers
งานย่อยที่ 6
Making Mongo realtime - oplog tailing in Meteor
File-I/O -- ist doch ganz einfach, oder?
Super Advanced Python –act1
Ad

Similar to MongoDb In Action (20)

PPTX
Mongodbinaction 100122230824-phpapp01
PPT
A Brief MongoDB Intro
ODP
This upload requires better support for ODP format
PPT
Mongo-Drupal
PPTX
Introduction to MongoDB
PDF
MongoDB
PPTX
MongoDB + Java - Everything you need to know
PPTX
Mongo+java (1)
PDF
Python and MongoDB
PPTX
introtomongodb
PPTX
Back to Basics, webinar 2: La tua prima applicazione MongoDB
PDF
MongoDB and Python
PPT
A practical intro to web development with mongo db and nodejs when, why and ...
PPT
A practical intro to web development with mongo db and nodejs when, why and how
PDF
MongoDB user group israel May
PPTX
Sekilas PHP + mongoDB
PDF
BigQuery JavaScript User-Defined Functions by THOMAS PARK and FELIPE HOFFA at...
PPT
Mongo db basics
PDF
mongoDB Performance
PDF
mongodb-introduction
Mongodbinaction 100122230824-phpapp01
A Brief MongoDB Intro
This upload requires better support for ODP format
Mongo-Drupal
Introduction to MongoDB
MongoDB
MongoDB + Java - Everything you need to know
Mongo+java (1)
Python and MongoDB
introtomongodb
Back to Basics, webinar 2: La tua prima applicazione MongoDB
MongoDB and Python
A practical intro to web development with mongo db and nodejs when, why and ...
A practical intro to web development with mongo db and nodejs when, why and how
MongoDB user group israel May
Sekilas PHP + mongoDB
BigQuery JavaScript User-Defined Functions by THOMAS PARK and FELIPE HOFFA at...
Mongo db basics
mongoDB Performance
mongodb-introduction
Ad

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPT
Teaching material agriculture food technology
PPTX
Big Data Technologies - Introduction.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Encapsulation theory and applications.pdf
PPTX
Cloud computing and distributed systems.
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
cuic standard and advanced reporting.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
MYSQL Presentation for SQL database connectivity
Spectral efficient network and resource selection model in 5G networks
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Machine learning based COVID-19 study performance prediction
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Diabetes mellitus diagnosis method based random forest with bat algorithm
The AUB Centre for AI in Media Proposal.docx
Review of recent advances in non-invasive hemoglobin estimation
Teaching material agriculture food technology
Big Data Technologies - Introduction.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Encapsulation_ Review paper, used for researhc scholars
Encapsulation theory and applications.pdf
Cloud computing and distributed systems.
Assigned Numbers - 2025 - Bluetooth® Document
Per capita expenditure prediction using model stacking based on satellite ima...
cuic standard and advanced reporting.pdf
A comparative analysis of optical character recognition models for extracting...
“AI and Expert System Decision Support & Business Intelligence Systems”
MYSQL Presentation for SQL database connectivity

MongoDb In Action