How to Delete Everything In A MongoDB Database?

Here we will learn How to Delete Everything In A MongoDB Database where we can delete documents in two ways multiple and drop the whole database where in case of multiple deletions we delete multiple documents in a Drop database we delete the whole database in just one command which we can do using two … Read more

Difference Between NoSQL and MySQL Databases

Here we will discuss the difference between MySQL and NoSQL where MySQL is a structured Query Language whereas no SQL does not have any predefined structure there is no schema that well defines it where Data is stored in the form of Tables and different rows and columns in the case on MySQL which is … Read more

How do you rename a MongoDB database?

In this tutorial, we will learn How to rename a MongoDB database. However, there is no such direct method available just like MySQL to rename the existing database but there is always a second way to do so and we complete using some specific Steps that we will learn below. Rename The Database In MongoDB … Read more

How Can I List All Collections In The MongoDB Shell?

Here We will discuss How can I list all collections in the MongoDB shell where there are two ways to get the important list of all the collections in the MongoDB Shell and the are get collections and show collections. Let’s understand all of them one by one. Collections are document or group of documents … Read more

Array | Query For Documents Where Array Size Is Greater Than 1

In This tutorial, we will see Query For Documents Where Array Size Is Greater Than 1 which we can do in two ways first with the use of not equal to Operator and other by MongoDB quarry for array grater there 0, 1, and 2. Let’s see both the method one by one and understand … Read more

How do I Drop A MongoDB Database From The Command Line?

In this tutorial, we will learn How to Drop A MongoDB Database From The Command Line to do so we can directly use the drop command to delete the whole database. Drop A MongoDB Database Drop a database means deleting a database permanently from a well defined database. And to drop permanently by a single … Read more

How To Query MongoDB With “like”?

In this Tutorial, we will learn How to query MongoDB with “like” which is used for finding the match for a string or a substring that might be present in a full string which could be there. To Query MongoDB With “like” We use like statements to find a match in between a substring or … Read more

Content of mongod.service file for mongod service for Red Hat Enterprise Linux or Cent OS

Please find the content of mongod.service file which needs to be created for starting mongod service.   [Unit] Description=MongoDB Database Server Documentation=https://docs.mongodb.org/manual After=network-online.target Wants=network-online.target [Service] User=mongod Group=mongod Environment=”OPTIONS=-f /etc/mongod.conf” EnvironmentFile=-/etc/sysconfig/mongod ExecStart=/usr/bin/mongod $OPTIONS ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb PermissionsStartOnly=true PIDFile=/var/run/mongodb/mongod.pid Type=forking # file size LimitFSIZE=infinity # cpu time LimitCPU=infinity # virtual memory … Read more

%d bloggers like this: