Contenu connexe
Similaire à MongoDB, it's not just about big data (20)
MongoDB, it's not just about big data
- 5. { _id: 1234, author: { name: “Bob Davis”, email : [email_address] }, post: “In these troubled times I like to …“, date: { $date: “2010-07-12 13:23UTC” }, location: [ -121.2322, 42.1223222 ], rating: 2.2, comments: [ { user: “jgs32@hotmail.com”, upVotes: 22, downVotes: 14, text: “Great point! I agree” }, { user: “holly.davidson@gmail.com”, upVotes: 421, downVotes: 22, text: “You are a moron” } ] } Documents (a.k.a. Objects)
- 6. { _id: 1234, author: { name: “Bob Davis”, email : [email_address] }, post: “In these troubled times I like to …“, date: { $date: “2010-07-12 13:23UTC” }, location: [ -121.2322, 42.1223222 ], rating: 2.2, comments: [ { user: “jgs32@hotmail.com”, upVotes: 22, downVotes: 14, text: “Great point! I agree” }, { user: “holly.davidson@gmail.com”, upVotes: 421, downVotes: 22, text: “You are a moron” } ], tags: [ “Politics”, “Virginia” ] } Flexible “Schemas”
- 7. dynamic queries db.posts.find({ author.name: “mike” }) db.posts.find({ rating: { $gt: 2 }}) db.posts.find({ tags: “Software” }) db.posts.find().sort({date: -1}).limit(10)
- 11. atomic updates Comment c = {author: “will@objectlabs.com”, date: new Date(), text: “great post!”} db.posts.update({_id: post._id}, {$push: {comments: c}})
- 20. { _id: 1234, author: { name: “Bob Davis”, email : [email_address] }, post: “In these troubled times I like to …“, date: { $date: “2010-07-12 13:23UTC” }, location: [ -121.2322, 42.1223222 ], rating: 2.2, comments: [ { user: “jgs32@hotmail.com”, upVotes: 22, downVotes: 14, text: “Great point! I agree” }, { user: “holly.davidson@gmail.com”, upVotes: 421, downVotes: 22, text: “You are a moron” } ], tags: [ “Politics”, “Virginia” ] } … vs. this loveliness
Notes de l'éditeur
- Market Product Business Model Team [Plan]
- nosql started bc bd but also revisit ds