MongoDB Commands
Export collection without ID field: mongo --host dfwlnpmgdb-03:27018 cpq_prod --quiet --eval "db.PricingTable.find({}, {_id: 0}).forEach(printjson)" > /home/kolguk01/export/out.json Create/DROP Index: Note: Always use background set to true while creating the indexes db.css.dropIndex("ts_365_days") db.css.dropIndex("url_1_src_1") db.css.dropIndex("_id_") db.css.createIndex( { "ts" : 1}, {"name" : "ts_365_days", "expireAfterSeconds" : 31536000,background : true}) db.css.createIndex( { "url" : 1, "src" : 1}, {"name" : "url_1_src_1", "unique" :true,background : true}) db.css.createIndex( { "_id" : 1}, {"name" : "_id_" ,background : true}) Select documents without the _id field db . collection . find ({}, { _id : 0 }) How to configure Replica set in MongoDB Step 1 : In th...