use mongodb from command line code example
Example 1: open mongodb in cmd
1) Go to MongoDB bin folder:
C:\Program Files\MongoDB\Server\3.2\bin
2) Enter command mongod
By default, mongodb server will start at port 27017
Example 2: start mongodb in terminal
Start a terminal for your mongo server
Go to <mongodb-install-directory>/bin directory
Run the command./mongod
Start a terminal for your mongo shell
Go to <mongodb-install-directory>/bin directory
Run the command (make sure you put the name of the database)./mongo test