For Apple M1 Processor:
If you install mongodb
through Homebrew
, follow the steps below:
Open up your Terminal
Type brew list
to check the formulae of the installed mongodb
==> Formulae
[email protected] mongodb-dxxx...
==> Casks
xxxxx
- In the terminal, type
brew list [email protected]
to get the directory of the mongodb
installed in your machine.
/opt/homebrew/Cellar/[email protected]/4.4.13/bin/install_compass
/opt/homebrew/Cellar/[email protected]/4.4.13/bin/mongo
/opt/homebrew/Cellar/[email protected]/4.4.13/bin/mongod
/opt/homebrew/Cellar/[email protected]/4.4.13/bin/mongos
/opt/homebrew/Cellar/[email protected]/4.4.13/[email protected]
/opt/homebrew/Cellar/[email protected]/4.4.13/MPL-2
/opt/homebrew/Cellar/[email protected]/4.4.13/THIRD-PARTY-NOTICES
Copy the bin path of your mongodb: /opt/homebrew/Cellar/[email protected]/4.4.13/bin
Open up your .zshrc
file with any text-editor
Add this line to the file:
export PATH="/opt/homebrew/Cellar/[email protected]/4.4.13/bin:${PATH}"
- Try
mongo --version
in your terminal, if you see similar output like shown below, you are good to go.
MongoDB shell version v4.4.13
Build Info: {
"version": "4.4.13",
"gitVersion": "df25-----------b9246",
"modules": [],
"allocator": "system",
"environment": {
"distarch": "x86_64",
"target_arch": "x86_64"
}
}