SlideShare a Scribd company logo
1 of 18
Thanasis Efthymiou
Service Delivery Manager




                           Introduction to



                            Athens MongoDB User group
Thanasis Efthymiou,




                       But wait!




              What’s our group all about?
                                            2
Thanasis Efthymiou,




                      What we want is to:
   • Explore MongoDB and related technologies
         – “NoSQL” design culture
         – Map/Reduce
         – Hadoop, Hive, …
   • Learn from each other while having fun
   • Connect with the experts (and become one)
   • Free coffee

                                                 3
Thanasis Efthymiou,




                      Our Sponsors




                                     4
Thanasis Efthymiou,




              So what is                                                                   ?
   • Open-source database
         – Free to download and use
         – Subscription services for support offered by 10gen
   • Document-oriented database
         –   Fields, documents and collections instead of columns, rows and tables as in RDBMS
         –   Flexible and dynamic schema, no predefined or rigid as in RDBMS
         –   JSON documents, e.g.: {field1 : value1, field2 : value2 }
         –   Possibility to embed documents within others, e.g.: {f1 : v1, f2 : { f3: v3, f4: v4 } }
   • Built for scalability and high availability
         – Replica sets with automatic failover for redundancy
         – Auto-sharding for performance and load balancing
         – Built for the web, built to live in the fluffy clouds
   • Rich query interface
         – Javascript-powered shell
   • Easy to setup and administer
                                                                                                       5
Thanasis Efthymiou,




                      Replica set sneak peek




                                               6
Thanasis Efthymiou,




                      Sharding sneak peek




                                            7
Thanasis Efthymiou,




              So what is                                                        ?
                           SQL world                  MongoDB
                           Database                    Database
                             Table                     Collection
                             Index                       Index
                             Row                      Document
                            Column                       Field
                            Joining               Embedding & linking

                                      JSON document examples
     • {a:1}
     • { b : 2, c : "Hello world!", d : new Date('Jan 16, 2013')}
     • {        name                 :         "Thanasis",
                'company'            :         "Persado",
                "address"            :         "Kastorias 4, 15344, Gerakas",
                likes                :         ["photography", "cycling"],
                drinksCoffee         :         true      }
                                                                                    8
Thanasis Efthymiou,




              So what is                                                      ?
                                                                               GROUP BY
   • Map/Reduce                                     SELECT and
                                                                                clause
         – Map: transform and filter data          WHERE clause
         – Reduce: combine multiple rows into fewer records, i.e. aggregate
   • Hadoop connector
         – If you have really, really huge data sets
   • Capped collections
         – Guarantee preservation of the insertion order
         – Guarantee insertion order is identical to the order on disk
         – Powerful for logging
   • GridFS
         – Storing/retrieving files exceeding the 16MB document size limit (e.g. video)
         – Divides a file into parts, or chunks and stores them as separate documents

                                                                                          9
Thanasis Efthymiou,




              So what is                                                              ?
   • It goes…
         – Said to be 2 to 10 times faster than MySQL, depending on the “write concern”
               • Fire and forget versus wait for acknowledgement from n servers
         – Designed to be shared across multiple machines
         – In-place updates (typical example the incremental operator $inc)
         – Typically makes use of commodity servers with enough RAM to keep the entire data set
           in memory
   • Great index support
         – Pretty similar concepts apply as in RDBMS
         – Take it easy on the indexes, your write operations might slow down
         – The query optimizer selects the index empirically by occasionally running alternate
           query plans and by selecting the plan with the best response time
         – Can be unique, compound, multikey indexes on arrays, sparse
         – Can be created in a non-blocking fashion in the background
         – And the mobile web’s favorite…

                                                                                                  10
Thanasis Efthymiou,

                              Geospatial index example
           Create it: db.places.ensureIndex( {coord : '2d'} )
           Use it: db.places.find( { coord: {$near : [38.008003, 23.865303] } } )




                                                                                    11
Thanasis Efthymiou,




                                                          is not…
   • SQL RDBMS like Oracle, MySQL or SQL Server
         –   No SQL supported but does have rich query syntax
         –   No transactions (and no commit necessary!)
         –   No referential integrity of data, no foreign keys, no constraints, no triggers!
         –   No joins!
   • What? No joins??
         – Go for embedded documents or
         – Emulate joining in your application (multiple queries using code)
   • No stored procedures or views, but stored Javascript
   • No tabular interface / data grid looks
         – No Toad or SQL Developer clients
         – No easy data copy-paste to Excel
   • No Alter Table commands that can take minutes or hours
                                                                                               12
Thanasis Efthymiou,




               Querying
   >db.people.insert( {name:"Thanasis",'company':"Persado","address":"Kastorias 4, 15344,
   Gerakas",likes:["photography", "cycling"],drinksCoffee:true} )
   >
   >db.people.find()
   { "_id" : ObjectId("50f57146fcb8b36343367b8f"), "name" : "Thanasis", "company" : "Persado",
   "address" : "Kastorias 4, 15344, Gerakas", "likes" : [ "photography", "cycling" ], "drinksCoffee" :
   true }
   >db.people.find().pretty()
   {
       "_id" : ObjectId("50f57146fcb8b36343367b8f"),
       "name" : "Thanasis",
       "company" : "Persado",
       "address" : "Kastorias 4, 15344, Gerakas",
       "likes" : [
            "photography",
            "cycling"
       ],
       "drinksCoffee" : true
   }                                                                                                     13
Thanasis Efthymiou,




                   Querying
    >db.people.find( … )

{ a: 10 }                        a is 10, or an array containing the value 10
{ a: 10, b: “hello” }            a is 10 and b is “hello”
{ a: {$gt: 10} }                 a is greater than 10. Also $lt (<), $gte (>=), $lte (<=), and $ne (!=)
{ a: {$in: [10, “hello”]} }      a is either 10 or “hello”
{ a: {$all: [10, “hello”]} }     a is an array containing both 10 and “hello”
{ “a.b”: 10 }                    a is an embedded document with b equal to 10
                                  a is an array containing a single item with both b equal to 1 and c equal
{ a: {$elemMatch: {b: 1, c: 2}} } to 2
{ $or: [{a: 1}, {b: 2}] }        a is 1 or b is 2
{ a: /^m/ }                      a begins with the letter “m”


                                                                                                          14
Thanasis Efthymiou,




               Updating
    >db.people.update( query, update, <upsert>, <multi> )
    >db.people.update({company:"Upstream"}, {$set:{company:"Persado"}},
                                                            false, true)
    >db.people.update({company:"Upstream"}, {company:"Persado"})
{ $inc: {a: 2} }                      Increment a by 2
{ $set: {a: 5} }                      Set a to the value 5
{ $unset: {a: 1} }                    Delete the a key
{ $push: {a: 1} }                     Append the value 1 to the array a
{ $pushAll: {a: [1, 2]} }             Append both 1 and 2 to the array a
{ $addToSet: {a: 1} }                 Append the value 1 to the array a (if it doesn’t already exist)
{ $addToSet: {a: {$each: [1, 2]}} }   Append both 1 and 2 to the array a (if they don’t already exist)
{ $pop: {a: 1} }                      Remove the last element from the array a
{ $pop: {a: -1} }                     Remove the first element from the array a
{ $pull: {a: 5} }                     Remove all occurrences of 5 from the array a
{ $pullAll: {a: [5, 6]} }             Remove all occurrences of 5 or 6 from the array a
                                                                                                         15
Thanasis Efthymiou,




           SQL versus
                      SQL                                        MongoDB
  SELECT * FROM users                      db.users.find()

  INSERT INTO users VALUES ('Bob', 32)     db.users.insert({name: "Bob", age: 32})
  SELECT name, age FROM users
  WHERE age = 33                           db.users.find({age: 33}, {name: 1, age: 1, _id:0})
  SELECT * FROM users WHERE age = 33
  ORDER BY name ASC                        db.users.find({age: 33}).sort({name: 1})

  SELECT * FROM users WHERE age > 33       db.users.find({age: {$gt: 33}})
  SELECT * FROM users
  WHERE name LIKE '%Joe%'                  db.users.find({name: /Joe/})
  SELECT COUNT(*) FROM users
  WHERE AGE > 30                           db.users.find({age: {$gt: 30}}).count()
  UPDATE users SET age = 33 WHERE name =   db.users.update({name: "Bob"}, {$set: {age: 33}}, false,
  'Bob'                                    true)

  DELETE FROM users WHERE name = 'Bob'     db.users.remove({name: "Bob"})
                                                                                                      16
Thanasis Efthymiou,




                                Find out more!

           Download and documentation             http://www.mongodb.org/

           Use cases, training, everything        http://www.10gen.com/

           Online training portal – don’t miss!   https://education.10gen.com/

           API and drivers                        http://api.mongodb.org/

           If you’re still hard to satisfy        http://www.google.com




                                                                                 17
Thanasis Efthymiou,




                             Thank you!
                      http://www.meetup.com/Athens-MongoDB/
                      Don’t forget to RSVP Yes to our Events!


                      thanasis.efthymiou@gmail.com


                      www.facebook.com/MongoDBGreece


                      www.linkedin.com/groups/MongoDB-Greece-4731560


                                                                       18

More Related Content

Viewers also liked

Schema design with MongoDB (Dwight Merriman)
Schema design with MongoDB (Dwight Merriman)Schema design with MongoDB (Dwight Merriman)
Schema design with MongoDB (Dwight Merriman)
MongoSF
 
Zero to Mongo in 60 Hours
Zero to Mongo in 60 HoursZero to Mongo in 60 Hours
Zero to Mongo in 60 Hours
MongoSF
 
Text databases and information retrieval
Text databases and information retrievalText databases and information retrieval
Text databases and information retrieval
unyil96
 
MongoDB: Intro & Application for Big Data
MongoDB: Intro & Application  for Big DataMongoDB: Intro & Application  for Big Data
MongoDB: Intro & Application for Big Data
Takahiro Inoue
 
MongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql DatabaseMongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql Database
Sudhir Patil
 

Viewers also liked (19)

Getting Started with MongoDB
Getting Started with MongoDBGetting Started with MongoDB
Getting Started with MongoDB
 
Seth Edwards on MongoDB
Seth Edwards on MongoDBSeth Edwards on MongoDB
Seth Edwards on MongoDB
 
Mongodb intro
Mongodb introMongodb intro
Mongodb intro
 
Schema design with MongoDB (Dwight Merriman)
Schema design with MongoDB (Dwight Merriman)Schema design with MongoDB (Dwight Merriman)
Schema design with MongoDB (Dwight Merriman)
 
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
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
MongoDB 3.0
MongoDB 3.0 MongoDB 3.0
MongoDB 3.0
 
Plan de entrenamiento Maratón de Madrid Mes 3
Plan de entrenamiento Maratón de Madrid Mes 3Plan de entrenamiento Maratón de Madrid Mes 3
Plan de entrenamiento Maratón de Madrid Mes 3
 
Mongo db intro new
Mongo db intro newMongo db intro new
Mongo db intro new
 
Zero to Mongo in 60 Hours
Zero to Mongo in 60 HoursZero to Mongo in 60 Hours
Zero to Mongo in 60 Hours
 
Mongo DB on the JVM - Brendan McAdams
Mongo DB on the JVM - Brendan McAdamsMongo DB on the JVM - Brendan McAdams
Mongo DB on the JVM - Brendan McAdams
 
Text databases and information retrieval
Text databases and information retrievalText databases and information retrieval
Text databases and information retrieval
 
MongoDB 3.2 Feature Preview
MongoDB 3.2 Feature PreviewMongoDB 3.2 Feature Preview
MongoDB 3.2 Feature Preview
 
Mongodb
MongodbMongodb
Mongodb
 
Mongodb
MongodbMongodb
Mongodb
 
MongoDB
MongoDBMongoDB
MongoDB
 
A Brief MongoDB Intro
A Brief MongoDB IntroA Brief MongoDB Intro
A Brief MongoDB Intro
 
MongoDB: Intro & Application for Big Data
MongoDB: Intro & Application  for Big DataMongoDB: Intro & Application  for Big Data
MongoDB: Intro & Application for Big Data
 
MongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql DatabaseMongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql Database
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

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
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
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, ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
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
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
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
 
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
 
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
 
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
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

Intro to MongoDB by Thanasis Efthymiou, Athens MongoDB User Group

  • 1. Thanasis Efthymiou Service Delivery Manager Introduction to Athens MongoDB User group
  • 2. Thanasis Efthymiou, But wait! What’s our group all about? 2
  • 3. Thanasis Efthymiou, What we want is to: • Explore MongoDB and related technologies – “NoSQL” design culture – Map/Reduce – Hadoop, Hive, … • Learn from each other while having fun • Connect with the experts (and become one) • Free coffee 3
  • 4. Thanasis Efthymiou, Our Sponsors 4
  • 5. Thanasis Efthymiou, So what is ? • Open-source database – Free to download and use – Subscription services for support offered by 10gen • Document-oriented database – Fields, documents and collections instead of columns, rows and tables as in RDBMS – Flexible and dynamic schema, no predefined or rigid as in RDBMS – JSON documents, e.g.: {field1 : value1, field2 : value2 } – Possibility to embed documents within others, e.g.: {f1 : v1, f2 : { f3: v3, f4: v4 } } • Built for scalability and high availability – Replica sets with automatic failover for redundancy – Auto-sharding for performance and load balancing – Built for the web, built to live in the fluffy clouds • Rich query interface – Javascript-powered shell • Easy to setup and administer 5
  • 6. Thanasis Efthymiou, Replica set sneak peek 6
  • 7. Thanasis Efthymiou, Sharding sneak peek 7
  • 8. Thanasis Efthymiou, So what is ? SQL world MongoDB Database Database Table Collection Index Index Row Document Column Field Joining Embedding & linking JSON document examples • {a:1} • { b : 2, c : "Hello world!", d : new Date('Jan 16, 2013')} • { name : "Thanasis", 'company' : "Persado", "address" : "Kastorias 4, 15344, Gerakas", likes : ["photography", "cycling"], drinksCoffee : true } 8
  • 9. Thanasis Efthymiou, So what is ? GROUP BY • Map/Reduce SELECT and clause – Map: transform and filter data WHERE clause – Reduce: combine multiple rows into fewer records, i.e. aggregate • Hadoop connector – If you have really, really huge data sets • Capped collections – Guarantee preservation of the insertion order – Guarantee insertion order is identical to the order on disk – Powerful for logging • GridFS – Storing/retrieving files exceeding the 16MB document size limit (e.g. video) – Divides a file into parts, or chunks and stores them as separate documents 9
  • 10. Thanasis Efthymiou, So what is ? • It goes… – Said to be 2 to 10 times faster than MySQL, depending on the “write concern” • Fire and forget versus wait for acknowledgement from n servers – Designed to be shared across multiple machines – In-place updates (typical example the incremental operator $inc) – Typically makes use of commodity servers with enough RAM to keep the entire data set in memory • Great index support – Pretty similar concepts apply as in RDBMS – Take it easy on the indexes, your write operations might slow down – The query optimizer selects the index empirically by occasionally running alternate query plans and by selecting the plan with the best response time – Can be unique, compound, multikey indexes on arrays, sparse – Can be created in a non-blocking fashion in the background – And the mobile web’s favorite… 10
  • 11. Thanasis Efthymiou, Geospatial index example Create it: db.places.ensureIndex( {coord : '2d'} ) Use it: db.places.find( { coord: {$near : [38.008003, 23.865303] } } ) 11
  • 12. Thanasis Efthymiou, is not… • SQL RDBMS like Oracle, MySQL or SQL Server – No SQL supported but does have rich query syntax – No transactions (and no commit necessary!) – No referential integrity of data, no foreign keys, no constraints, no triggers! – No joins! • What? No joins?? – Go for embedded documents or – Emulate joining in your application (multiple queries using code) • No stored procedures or views, but stored Javascript • No tabular interface / data grid looks – No Toad or SQL Developer clients – No easy data copy-paste to Excel • No Alter Table commands that can take minutes or hours 12
  • 13. Thanasis Efthymiou, Querying >db.people.insert( {name:"Thanasis",'company':"Persado","address":"Kastorias 4, 15344, Gerakas",likes:["photography", "cycling"],drinksCoffee:true} ) > >db.people.find() { "_id" : ObjectId("50f57146fcb8b36343367b8f"), "name" : "Thanasis", "company" : "Persado", "address" : "Kastorias 4, 15344, Gerakas", "likes" : [ "photography", "cycling" ], "drinksCoffee" : true } >db.people.find().pretty() { "_id" : ObjectId("50f57146fcb8b36343367b8f"), "name" : "Thanasis", "company" : "Persado", "address" : "Kastorias 4, 15344, Gerakas", "likes" : [ "photography", "cycling" ], "drinksCoffee" : true } 13
  • 14. Thanasis Efthymiou, Querying >db.people.find( … ) { a: 10 } a is 10, or an array containing the value 10 { a: 10, b: “hello” } a is 10 and b is “hello” { a: {$gt: 10} } a is greater than 10. Also $lt (<), $gte (>=), $lte (<=), and $ne (!=) { a: {$in: [10, “hello”]} } a is either 10 or “hello” { a: {$all: [10, “hello”]} } a is an array containing both 10 and “hello” { “a.b”: 10 } a is an embedded document with b equal to 10 a is an array containing a single item with both b equal to 1 and c equal { a: {$elemMatch: {b: 1, c: 2}} } to 2 { $or: [{a: 1}, {b: 2}] } a is 1 or b is 2 { a: /^m/ } a begins with the letter “m” 14
  • 15. Thanasis Efthymiou, Updating >db.people.update( query, update, <upsert>, <multi> ) >db.people.update({company:"Upstream"}, {$set:{company:"Persado"}}, false, true) >db.people.update({company:"Upstream"}, {company:"Persado"}) { $inc: {a: 2} } Increment a by 2 { $set: {a: 5} } Set a to the value 5 { $unset: {a: 1} } Delete the a key { $push: {a: 1} } Append the value 1 to the array a { $pushAll: {a: [1, 2]} } Append both 1 and 2 to the array a { $addToSet: {a: 1} } Append the value 1 to the array a (if it doesn’t already exist) { $addToSet: {a: {$each: [1, 2]}} } Append both 1 and 2 to the array a (if they don’t already exist) { $pop: {a: 1} } Remove the last element from the array a { $pop: {a: -1} } Remove the first element from the array a { $pull: {a: 5} } Remove all occurrences of 5 from the array a { $pullAll: {a: [5, 6]} } Remove all occurrences of 5 or 6 from the array a 15
  • 16. Thanasis Efthymiou, SQL versus SQL MongoDB SELECT * FROM users db.users.find() INSERT INTO users VALUES ('Bob', 32) db.users.insert({name: "Bob", age: 32}) SELECT name, age FROM users WHERE age = 33 db.users.find({age: 33}, {name: 1, age: 1, _id:0}) SELECT * FROM users WHERE age = 33 ORDER BY name ASC db.users.find({age: 33}).sort({name: 1}) SELECT * FROM users WHERE age > 33 db.users.find({age: {$gt: 33}}) SELECT * FROM users WHERE name LIKE '%Joe%' db.users.find({name: /Joe/}) SELECT COUNT(*) FROM users WHERE AGE > 30 db.users.find({age: {$gt: 30}}).count() UPDATE users SET age = 33 WHERE name = db.users.update({name: "Bob"}, {$set: {age: 33}}, false, 'Bob' true) DELETE FROM users WHERE name = 'Bob' db.users.remove({name: "Bob"}) 16
  • 17. Thanasis Efthymiou, Find out more! Download and documentation http://www.mongodb.org/ Use cases, training, everything http://www.10gen.com/ Online training portal – don’t miss! https://education.10gen.com/ API and drivers http://api.mongodb.org/ If you’re still hard to satisfy http://www.google.com 17
  • 18. Thanasis Efthymiou, Thank you! http://www.meetup.com/Athens-MongoDB/ Don’t forget to RSVP Yes to our Events! thanasis.efthymiou@gmail.com www.facebook.com/MongoDBGreece www.linkedin.com/groups/MongoDB-Greece-4731560 18