How to solve `Failed to unlink socket file /tmp/mongodb-27017.sock Operation not permitted` in MongoDB Solution for `Failed to unlink socket file /tmp/mongodb-27017.sock Operation not permitted` error n MongoDB and Linux.
How to fix connection timeout problem with MongoDB Some of us have encountered a problem problem right after installing MongoDB, turns out we can't connect. I personally get this: root@ghost:~# mongo MongoDB shell version v4.2.8 connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb 2020-10-30T12:10:51.955+0100
How to solve "mongod.service main process exited code=exited status=100/n/a" For me, this did the trick: chown -R mongodb:mongodb /data Source: - https://stackoverflow.com/questions/45691032/mongod-service-start-exits-with-code-100
How to solve "mongod.service: Main process exited, code=exited, status=14/n/a" For me this did the trick: chown mongodb:mongodb /tmp/mongodb-27017.sock More about this, in the link below. Source: - https://askubuntu.com/questions/823288/mongodb-loads-but-breaks-returning-status-14
How to configure a MongoDB replica set (local machine) This post will guide you through the steps to set up a local replica set with two members and one arbiter. In a production environment the steps must be almost the same except that instead of starting three local MongoDB instances in different ports you would start an instance of
How to remove documents from a capped collection in MongoDB You can’t remove one or all documents from a capped collection in MongoDB. BUT! you can drop the collection! Execute the following command: db.getCollection('myCollection').drop() The result for me is: true There you go, quick and easy. Sources: * https://docs.mongodb.com/manual/core/capped-collections/
How to count documents of a collection in MongoDB Today, I had to do this at work. turns out it is very easy. I am using Robomongo 1.0-RC1. I just double click on the collection that I want, in this case knives and I just execute the following query: db.getCollection('knives').count() The result in