HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

mongod — The MongoDB database server. More information: <https://www.mongodb.com/docs/manual/reference/progra

Submitted by: @import:tldr-pages··
0
Viewed 0 times
themongodservercommandmongodbdatabaseclimore

Problem

How to use the mongod command: The MongoDB database server. More information: <https://www.mongodb.com/docs/manual/reference/program/mongod/>.

Solution

mongod — The MongoDB database server. More information: <https://www.mongodb.com/docs/manual/reference/program/mongod/>.

Specify the storage directory (default: /data/db on Linux and macOS, C:\data\db on Windows):
mongod --dbpath {{path/to/directory}}


Specify a configuration file:
mongod --config {{path/to/file}}


Specify the port to listen on (default: 27017):
mongod --port {{port}}


Specify the database profiling level. 0 is off, 1 is only slow operations, 2 is all (default: 0):
mongod --profile {{0|1|2}}

Code Snippets

Specify the storage directory (default: `/data/db` on Linux and macOS, `C:\data\db` on Windows)

mongod --dbpath {{path/to/directory}}

Specify a configuration file

mongod --config {{path/to/file}}

Specify the port to listen on (default: 27017)

mongod --port {{port}}

Specify the database profiling level. 0 is off, 1 is only slow operations, 2 is all (default: 0)

mongod --profile {{0|1|2}}

Context

tldr-pages: common/mongod

Revisions (0)

No revisions yet.