Cyber Space
  • Home
  • Acronyms
  • Cheat-Sheets
  • User Manuals

MongoDB

A collection of 4 posts
MongoDB

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.
Jun 26, 2023
MongoDB

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
Oct 21, 2020 2 min read
MongoDB

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.
Mar 14, 2018
MongoDB

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
Mar 13, 2018
Page 1 of 1
Cyber Space © 2023
Powered by Ghost