MongoDB (from "humongous") is a cross-platform document-oriented database system. Classified as a NoSQL database, MongoDB eschews the traditional table-based relational database structure in favor of JSON-like documents with dynamic schemas
In this article we will know other command line options in MongoDb,we will also see how to install mongodb as a service and how to verify the server.Previous article has provided about the introduction of mongodb & Set up and installation
The objective of the article is to know about command line options in Mongo db and how to install as a service and to verify the server..
Now lets start the mongo server as shown in previous article
Mongo has many command line options we can use lets look at few
Type the following command
It has the ability to log more verbosely or less into a specific log file
- It has the ability to run on a different TCP port.
- we can have more connections.
- we can specify different directory where data files should reside.
Let us see how to specify different directory and to provide high verbosity level which logs everything..
Specific Data Directory
We will have to specify a different data directory so lets create that directory
Now lets create a Text document inside dotnetfunda folder
The above is the configuration file being used for the mongo server. Data files will be residing in the dotnetfunda\db directory and store in log in dotnetfunda/mongo-server.log and to log very very verbosely i am specifying 5 v's here where 1 being least verbose and 5 being most verbose..
Now we are ready to start the mongo server using the configuration file
mongod -f c:\dotnetfunda\mongod.conf
-f for the configuration file
c: is the path where the configuration file exists
The server is started and it is indicating that all its output is going to log file which we have provided
we can also inspect what is in that log file by the command
It was showing all the verbose logging that the server produced
In this article we have learned different command line options in mongodb and the example of specifying different directory.In next article we will see how to install mongo as a service..