The name and location will vary slightly between operating systems. The table shown here describes the defaults for the four major operating systems covered in the previous section on installation:
OS | MongoDB configuration file |
DEB-based | /etc/mongod.conf |
RPM-based | /etc/mongod.conf |
Windows | C:\Program Files\MongoDB\Server\4.x\bin\mongod.cfg |
Mac OS X | /usr/local/etc/mongod.conf |
Before getting into the details, let's have a look at the syntax.