how to remove all data from specific MongoDB collections

HI all, this document shows you how to remove all data from specific MongoDB collections. MongoDB is NoSQL database, MongoDB uses JSON-like documents with optional schemas. Sometimes there will be a requirement to delete all the data of specific MongoDB collection. Here we will provide the steps for that. Step 1: log in to mongo shell Step 2: Now choose your database, Step 3: now display your collections under scrapper database, Step 4: Now delete all the data from user collection.   Success, now you deleted all the data from…

Read More

Failed to set up listener: SocketException: Permission denied

Hi All, this document deals with how to fix Failed to set up listener: SocketException: Permission denied error. This issue is related to permission issues where MongoDB is not able to start the service. Check the permission of tmp location Change the permission and ownership of temp folder. chown root:root /tmp chmod 1777 /tmp Now start the MongoDB service. service mongod start © 2019, Techrunnr. All rights reserved.

Read More

Change MongoDB Default Data Path in Linux

We will see how to change the default MongoDB database server directory, by default, it is stored all data in /var/lib/mongo. Now we will see how to change this directory. Before making any changes, stop MongoDB service Create a new directory where we need to move the storage location for Mongo Edit the configuration file /etc/mongod.conf and modify the following fields accordingly: Make sure the new directory has mongod user access. Now we need the SELinux Configuration if it is enforced. Configure SELinux, if it’s in enforcing mode. Since we…

Read More

MongoDb Authentication Setup and Mongo Dump

Hi All, this document deals with how to set up MongoDB authentication and perform MongoDB dumps.  Prerequisites MongoDB, If MongoDB is not installed please go through our blog https://www.techrunnr.com/how-to-install-mongodb-in-ubuntu-16-04/ check the status of the MongoDB If the service is down, bring it up starting mongodb service For authentication setup we need to create user and passwords for MongoDB, so connect to the mongo shell connect to the admin DB and then Create a user and password It will give an output as shown below Authentication Setup. Go to mongod.conf (/etc/mongod.conf)…

Read More

how to install MongoDB compass

Hi all, this document deals with how to install MongoDB compass. MongoDB Compass is a GUI application to visualize data in MongoDB. MongoDB compass allows you to view the real-time performance for DB server metrics. MongoDB Compass analyzes your documents and displays rich structures within your collections through an intuitive GUI. MongoDB Compass supports various operating systems like Windows, Mac OS X, and Linux Installation Here I will show you how to install MongoDB compass in ubuntu. Step 1: Update your operating system. Step 2: Download MongoDB compass Step 3:…

Read More