MongoDB Documentation, Release 3.0.4 Issue Commands admin Database Commands Command Responses Manage mongod Processes Start mongod Processes Chapter 5. Administration 224 By default, MongoDB stores data in the /data/db directory. On Windows, MongoDB stores data in C:\data\db . On all platforms, MongoDB listens for connections from clients on port 27017 . This document page discusses the mongod process; however, some portions of this document may be applicable to mongos instances. The following examples assume the directory containing the mongod process is in your system paths. The mongod process is the primary database process that runs on an individual server. mongos provides a coherent MongoDB interface equivalent to a mongod from the perspective of a client. The mongo binary provides the administrative shell. MongoDB runs as a standard program. You can start MongoDB from a command line by issuing the mongod com- mand and specifying options. For a list of options, see the mongod reference. MongoDB can also run as a Windows service. For details, see Configure a Windows Service for MongoDB (page 30). To install MongoDB, see Install MongoDB (page 5). Failed commands return the ok field with a value of 0 . { 'ok': 1 } All commands return, at minimum, a document with an ok field indicating whether the command has succeeded: db._adminCommand( {buildInfo: 1} ) However, there’s also a command helper that automatically runs the command in the context of the admin database: use admin db.runCommand( {buildInfo: 1} ) You must run some commands on the admin database . Normally, these operations resemble the followings: You can use the maxTimeMS option to specify a time limit for the execution of a command, see Terminate a Command (page 227) for more information on operation termination. Many common commands have their own shell helpers or wrappers in the mongo shell and drivers, such as the db.isMaster() method in the mongo JavaScript shell. Many drivers provide an equivalent for the db.runCommand() method. Internally, running commands with db.runCommand() is equivalent to a special query against the $cmd collection. db.runCommand( { isMaster: 1 } ) The mongo shell provides a helper method for running commands called db.runCommand() . The following operation in mongo runs the above command: