Installation
mh-install-mongodb
UI tools =
git clone https://github.com/hatamiarash7/MongoDB_Admin
cd MongoDB_Admin
npm start &
~/apps/robo3t/bin/robo3t &
Querying
{"$or": [{"firstName": "Michael"}, {"firstName": "Tom"}]}
- To remove all documents that do not have a certain value:
db.inventory.remove( { type : { $ne: "food" } } )
- To remove all documents that do not have a range of values:
db.inventory.remove( { type : { $nin: ["Apple", "Mango"] } } )
Run a script or statement from command line
# This will drop the bookstore db
mongo bookstore --eval "printjson(db.dropDatabase())"