2017-10-06 14:58:04 -07:00
|
|
|
# mongod
|
|
|
|
|
2017-10-07 00:35:45 -07:00
|
|
|
> The MongoDB database server.
|
2019-06-04 10:25:15 +01:00
|
|
|
> More information: <https://docs.mongodb.com/manual/reference/program/mongod>.
|
2017-10-06 14:58:04 -07:00
|
|
|
|
2024-02-01 17:04:38 -03:00
|
|
|
- Specify the storage directory (default: `/data/db` on Linux and macOS, `C:\data\db` on Windows):
|
2023-08-01 09:21:03 +02:00
|
|
|
|
|
|
|
`mongod --dbpath {{path/to/directory}}`
|
|
|
|
|
2024-01-25 02:29:16 -03:00
|
|
|
- Specify a configuration file:
|
2017-10-06 14:58:04 -07:00
|
|
|
|
2022-12-06 07:47:56 +01:00
|
|
|
`mongod --config {{path/to/file}}`
|
2017-10-06 14:58:04 -07:00
|
|
|
|
2023-08-01 09:21:03 +02:00
|
|
|
- Specify the port to listen on (default: 27017):
|
2017-10-06 14:58:04 -07:00
|
|
|
|
2017-10-07 00:34:24 -07:00
|
|
|
`mongod --port {{port}}`
|
2017-10-06 14:58:04 -07:00
|
|
|
|
2023-08-01 09:21:03 +02:00
|
|
|
- Specify the database profiling level. 0 is off, 1 is only slow operations, 2 is all (default: 0):
|
2017-10-06 14:58:04 -07:00
|
|
|
|
2017-10-07 00:34:24 -07:00
|
|
|
`mongod --profile {{0|1|2}}`
|