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 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/ * https://stackoverflow.
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 my case