If MongoDB is installed on macOS via Homebrew, the default data directory depends on the type of processor in the system.
| Intel Processor | Apple M1 Processor | |
|---|---|---|
| Data Directory | /usr/local/var/mongodb |
/opt/homebrew/var/mongodb |
| Configuration file | /usr/local/etc/mongod.conf |
/opt/homebrew/etc/mongod.conf |
| Log directory | /usr/local/var/log/mongodb |
/opt/homebrew/var/log/mongodb |
Run brew --prefix to see where Homebrew installed these files.
See the MongoDB “Install on macOS” documentation for additional details.