mongo db shell in terminal code example
Example 1: mongo shell commands
show dbs
use <db>
show collections
db.people.insert({name:"Ashwin",gender:"m"})
db.people.find(<any attributes or none>)
db.people.update({name:"Ashwin"},{gender:"f"})
db.people.remove({name:"Ashwin"})
db.people.drop()
Example 2: start mongodb in terminal
Start a terminal for your mongo server
Go to <mongodb-install-directory>/bin directory
Run the command./mongod
Start a terminal for your mongo shell
Go to <mongodb-install-directory>/bin directory
Run the command (make sure you put the name of the database)./mongo test