Mongo Won’t Restart

MongoDB does not start after a reboot, sudo tail -10 /var/log/mongodb/mongod.log indicates 1Failed to unlink socket file /tmp/mongodb-27017.sock Operation not permitted To resolve the issue, run commands 123sudo rm -f …

Mongo DB Troubleshooting

Useful commands to troubleshoot why Mongo DB is in an error state Mongo Change Log https://www.mongodb.com/docs/manual/release-notes/5.0/ Check for disk space 1df -h Check the version 1mongod -version Check the status …

Query MongoDB

1234567891011121314151617181920212223db.getCollection(‘logs’).find({   "datetime" : {     $lt: new Date(),     $gte: new Date(new Date().setDate(new Date().getDate()-1))   }   }) db.getCollection(‘plocsec_capacity’).find( {$and: [       {plocsecid:338},     …