mongodb = huMONGOus database
- Initially released in 2009
- Developed by 10gen
- Written in C++
- Homepage: www.mongodb.org
- Great Tutorial: http://try.mongodb.org/
- NoSQL database
- Document-oriented
- JSON/BSON
- Drivers for loads of languages
- Open Source (GNU AGPL)
- Super programmer-friendly
- Ad hoc queries
- Indexing
- Replication
- GridFS
- Aggregation
Pros:
- Very Easy to work with
Cons:
- No joins
- No transactions
- JavaScript Shell
- Very similar to NodeJS drivers
- Drivers written in your language
db.presentation.save({
name:"Jonathan"
dbs:[
"Mongo",
"Marklogic",
"Redis"
]});
db.presentation.find();
db.presentation.find({name:"Jonathan"});
db.presentation.find({
dbs:{
$all:["Mongo", "Redis"]
}
});
- Comparison: $lt $gt $lte $gte
- Logical: $and $or $nor $not
- Element: $exists $type
- Arbitrary JavaScript: $where
- Regex: $regex
- Geospacial
- Run a "map" function over every item
- Run a "reduce" function over groups
- Continue until there's only one final result
- Map Reduce is powerful but often overkill
- Aggregation is a pipeline
- Transform, filter, create, unwind, at each step