https://www.thoughtworks.com/insights/blog/nosql-databases-overview apt-get install mongodb mongoimport --db test --collection restaurants --drop --file r.json show dbs use test db.restaurants.find( { "borough": "Manhattan" } ) db.restaurants.find( { "borough": "Manhattan" } ).pretty() db.restaurants.find( { "address.zipcode": "10075" } ) db.restaurants.find( { "grades.grade": "B" } ) db.restaurants.find( { "grades.score": { $lt: 10 } } ) db.restaurants.find( { "cuisine": "Italian", "address.zipcode": "10075" } ) db.restaurants.find( { $or: [ { "cuisine": "Italian" }, { "address.zipcode": "10075" } ] } ) db.restaurants.find().sort( { "borough": 1, "address.zipcode": 1 } ) db.restaurants.update( { "name" : "Juni" }, { $set: { "cuisine": "American (New)" }, $currentDate: { "lastModified": true } } ) db.restaurants.remove( { "borough": "Manhattan" } ) db.restaurants.aggregate( [ { $group: { "_id": "$borough", "count": { $sum: 1 } } } ] ) db.restaurants.aggregate( [ { $match: { "borough": "Queens", "cuisine": "Brazilian" } }, { $group: { "_id": "$address.zipcode" , "count": { $sum: 1 } } } ] )