2017-10-06 22:58:04 +01:00
|
|
|
# mongod
|
|
|
|
|
2017-10-07 08:35:45 +01: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 22:58:04 +01:00
|
|
|
|
2024-02-01 20:04:38 +00:00
|
|
|
- Specify the storage directory (default: `/data/db` on Linux and macOS, `C:\data\db` on Windows):
|
2023-08-01 08:21:03 +01:00
|
|
|
|
|
|
|
`mongod --dbpath {{path/to/directory}}`
|
|
|
|
|
2024-01-25 05:29:16 +00:00
|
|
|
- Specify a configuration file:
|
2017-10-06 22:58:04 +01:00
|
|
|
|
2022-12-06 06:47:56 +00:00
|
|
|
`mongod --config {{path/to/file}}`
|
2017-10-06 22:58:04 +01:00
|
|
|
|
2023-08-01 08:21:03 +01:00
|
|
|
- Specify the port to listen on (default: 27017):
|
2017-10-06 22:58:04 +01:00
|
|
|
|
2017-10-07 08:34:24 +01:00
|
|
|
`mongod --port {{port}}`
|
2017-10-06 22:58:04 +01:00
|
|
|
|
2023-08-01 08:21:03 +01:00
|
|
|
- Specify the database profiling level. 0 is off, 1 is only slow operations, 2 is all (default: 0):
|
2017-10-06 22:58:04 +01:00
|
|
|
|
2017-10-07 08:34:24 +01:00
|
|
|
`mongod --profile {{0|1|2}}`
|