Mongo Db Crud Summary

This post aims to list the basic operation of mongo database in the mongodb shell prompt.

1
2
w, {Number/String, > -1 || ‘majority’ || tag name} the write concern for the operation where < 1 is no acknowlegement of write and w >= 1, w = ‘majority’ or tag acknowledges the write
j, (Boolean, default:false) write waits for journal sync before returning

system admin

1
2
3
4
5
mongod --fork --logpath /root/mongodb/log/mongodb.log
mongod —shutdown
mongo hostname:port/dbschema -u username -p password
db.serverStatus()
db.serverStatus().connections

Read More