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

What's hot (10)

ODP
MySQL vs. PostgreSQL
Zhivko Angelov
 
PPTX
NoSQL with MongoDB
Ikram Manseri
 
PDF
NoSQL - An introduction to CouchDB
Jonathan Weiss
 
PDF
Apache CouchDB Presentation @ Sept. 2104 GTALUG Meeting
Myles Braithwaite
 
PDF
AST + Better Reflection (PHP Benelux 2016 Unconference)
James Titcumb
 
PPT
Mongodb
Manav Prasad
 
PPTX
Android Guava
丞廷 鄭
 
PDF
2011 09-pdfjs
Julian Viereck
 
PPTX
Mongodb
kalai s
 
PPT
Kill the DBA
Knut Haugen
 
MySQL vs. PostgreSQL
Zhivko Angelov
 
NoSQL with MongoDB
Ikram Manseri
 
NoSQL - An introduction to CouchDB
Jonathan Weiss
 
Apache CouchDB Presentation @ Sept. 2104 GTALUG Meeting
Myles Braithwaite
 
AST + Better Reflection (PHP Benelux 2016 Unconference)
James Titcumb
 
Mongodb
Manav Prasad
 
Android Guava
丞廷 鄭
 
2011 09-pdfjs
Julian Viereck
 
Mongodb
kalai s
 
Kill the DBA
Knut Haugen
 

Viewers also liked (20)

PPT
Bp to go home 1
anabela
 
PDF
Chile Forecast
hsplastic
 
PDF
Pneumonia Hospitalar
Alex Eduardo Ribeiro
 
PPTX
Evan's Exhibition-How to throw a boomerang
jtiggs
 
PPT
Sofia
francibondan
 
PPS
Selected banks performance analysis
ANM Farukh
 
PPT
Work Order Summary From Mp2 Database2003
Mbisset
 
PPT
Social Unit
Ciprian Gavriliu
 
PDF
El objeto de consumo, maureira ramirez
karla777
 
PDF
Timyang新浪微博设计谈
Cevin Cheung
 
DOC
Community Management Blaupause
n:sight / Kongress Media
 
PPT
"Ouçamos a voz de Deus, não dos falsos profetas"
JUERP
 
PPTX
Disección de un corazón
tmi4eso
 
PDF
A protest in respect to my sir
ANM Farukh
 
PDF
Berufliches Schulungszentrum Freital
SoftwareSaxony
 
PPTX
Last evolution of french practices by Bruno Florence
Florence consultant
 
DOC
Programas Gambas
RZYMJ
 
PDF
Markensymposium 2009 - Sophie Karmasin
Austrian National Tourist Office
 
PDF
Erasmuslaan 10 Zeist (www.boonmakelaars.nl)
DIRK Makelaars Taxateurs BV
 
Bp to go home 1
anabela
 
Chile Forecast
hsplastic
 
Pneumonia Hospitalar
Alex Eduardo Ribeiro
 
Evan's Exhibition-How to throw a boomerang
jtiggs
 
Selected banks performance analysis
ANM Farukh
 
Work Order Summary From Mp2 Database2003
Mbisset
 
Social Unit
Ciprian Gavriliu
 
El objeto de consumo, maureira ramirez
karla777
 
Timyang新浪微博设计谈
Cevin Cheung
 
Community Management Blaupause
n:sight / Kongress Media
 
"Ouçamos a voz de Deus, não dos falsos profetas"
JUERP
 
Disección de un corazón
tmi4eso
 
A protest in respect to my sir
ANM Farukh
 
Berufliches Schulungszentrum Freital
SoftwareSaxony
 
Last evolution of french practices by Bruno Florence
Florence consultant
 
Programas Gambas
RZYMJ
 
Markensymposium 2009 - Sophie Karmasin
Austrian National Tourist Office
 
Erasmuslaan 10 Zeist (www.boonmakelaars.nl)
DIRK Makelaars Taxateurs BV
 
Ad

Similar to Mongodbinaction 100122230824-phpapp01 (20)

PPTX
MongoDB Knowledge share
Mr Kyaing
 
PPT
Mongo db basics
Dhaval Mistry
 
PPTX
Intro To Mongo Db
chriskite
 
KEY
Introduction to MongoDB
Alex Bilbie
 
PPTX
MongoDB_ppt.pptx
1AP18CS037ShirishKul
 
PPTX
mongo.pptx
tarungupta276841
 
ODP
MongoDB
Martin Lazarov
 
ODP
MongoDB - A Document NoSQL Database
Ruben Inoto Soto
 
PDF
Mongo db
Toki Kanno
 
PPTX
UNIT-1 MongoDB.pptx
DharaDarji5
 
PPTX
Mongo DB
Pradeep Shanmugam
 
PDF
Full metal mongo
Israel Gutiérrez
 
PDF
Mongo db eveningschemadesign
MongoDB APAC
 
PPTX
lecture_34e.pptx
janibashashaik25
 
PDF
MongoDB
techwhizbang
 
PPTX
Introduction to MongoDB
S.Shayan Daneshvar
 
PPTX
introtomongodb
saikiran
 
PPTX
Mongo db – document oriented database
Wojciech Sznapka
 
PPT
Tech Gupshup Meetup On MongoDB - 24/06/2016
Mukesh Tilokani
 
PPT
Mongo Bb - NoSQL tutorial
Mohan Rathour
 
MongoDB Knowledge share
Mr Kyaing
 
Mongo db basics
Dhaval Mistry
 
Intro To Mongo Db
chriskite
 
Introduction to MongoDB
Alex Bilbie
 
MongoDB_ppt.pptx
1AP18CS037ShirishKul
 
mongo.pptx
tarungupta276841
 
MongoDB - A Document NoSQL Database
Ruben Inoto Soto
 
Mongo db
Toki Kanno
 
UNIT-1 MongoDB.pptx
DharaDarji5
 
Full metal mongo
Israel Gutiérrez
 
Mongo db eveningschemadesign
MongoDB APAC
 
lecture_34e.pptx
janibashashaik25
 
MongoDB
techwhizbang
 
Introduction to MongoDB
S.Shayan Daneshvar
 
introtomongodb
saikiran
 
Mongo db – document oriented database
Wojciech Sznapka
 
Tech Gupshup Meetup On MongoDB - 24/06/2016
Mukesh Tilokani
 
Mongo Bb - NoSQL tutorial
Mohan Rathour
 
Ad

More from Cevin Cheung (6)

PPT
Mvc架构在discuz!插件开发的应用 wps create_msoffice_check
Cevin Cheung
 
PDF
淘宝图片存储与Cdn系统
Cevin Cheung
 
PDF
淘宝网架构:解密淘宝网的开源架构
Cevin Cheung
 
PPT
Web缓存加速
Cevin Cheung
 
PPT
海量日志分析系统实践,Dba
Cevin Cheung
 
PPTX
My Sql优化(2009 08 28 系统架构师大会)
Cevin Cheung
 
Mvc架构在discuz!插件开发的应用 wps create_msoffice_check
Cevin Cheung
 
淘宝图片存储与Cdn系统
Cevin Cheung
 
淘宝网架构:解密淘宝网的开源架构
Cevin Cheung
 
Web缓存加速
Cevin Cheung
 
海量日志分析系统实践,Dba
Cevin Cheung
 
My Sql优化(2009 08 28 系统架构师大会)
Cevin Cheung
 

Recently uploaded (20)

PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
Per Axbom: The spectacular lies of maps
Nexer Digital
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
Market Insight : ETH Dominance Returns
CIFDAQ
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PPTX
AVL ( audio, visuals or led ), technology.
Rajeshwri Panchal
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PPTX
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
PDF
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Per Axbom: The spectacular lies of maps
Nexer Digital
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Market Insight : ETH Dominance Returns
CIFDAQ
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
The Future of Artificial Intelligence (AI)
Mukul
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
AVL ( audio, visuals or led ), technology.
Rajeshwri Panchal
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 

Mongodbinaction 100122230824-phpapp01