在 mac 中安装 mongo shell

Install mongo shell in mac

我只想在我的 mac

中安装 mongo-shell

i 运行 brew update 然后 i 运行 brew install mongodb-org-shell .. 但它没有安装。下面是错误信息


bash-3.2$ brew install mongodb-org-shell 
Error: No available formula with the name "mongodb-org-shell" 
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
bash-3.2$ 

根据我在 MongoDB HomeBrew 上的发现,要仅安装 Mongo Shell,您应该使用:

brew tap mongodb/brew

之后,安装 shell:

brew install mongodb-community-shell

您可能想要 install mongosh (MongoDB Shell) instead. The legacy mongo shell has been deprecated since MongoDB v5.0 and replaced by mongosh. Please refer to