NoSQL stores data in distribued machines.
Split a file and distribute into multiple nodes to distribute the load of accessing the file m=by multiple users
Sharding + replication of shards help load balancing and data availablity.
db.createCollection(name, collection_options)
db.createCollection("posts", {capped:true, size:1310720, max:500})
db.<collection_name>.insert(<documents>)
db.<collection_name>.find(<condtion>)
db.<collection_name>.update(<documents>)
db.<collection_name>.remove(<condition>)
Download MongoDB at https://www.mongodb.com/lp/download
mkdir <direcory-name>
mongodb --dbpath <directory-name>
mongo
db
show dbs
use <db-name>
show collections
> db.createCollection("employees", {'capped':true, size=10000, mX:50})
> show collections
> db.movies.insert({Name:'Alex', Age:37, City:'Detroit', Department: 'IT'})
> db.movies.insert({Name:'Bob', Age:25, City:'Detroit', Department: 'HR', Marital_status: 'Single'})
> db.movies.insert({Name:'John', Age:32, City:'An Arbor', Department: 'IT'})
Find records
> db.employees.find({City: 'Ann Arbor'})
> db.employees.find({Marital_status: {$exists: true}})
$eq
and $ne
$gt
and $gte
$lt
and $lte
$in
and $nin
$or
and $and
$not
and $nor
$exists
In [ ]: