mongodb 的团队正在维护一个自定义的 Homebrew tap。您可以卸载旧的 mongodb 并从新的水龙头重新安装新的。

If you still have the old mongodb installed from homebrew-core

brew services stop mongodb
brew uninstall homebrew/core/mongodb

Use the migrated distribution from custom tap

brew tap mongodb/brew
brew install mongodb-community
brew services start mongodb-community

可能报错的位置

brew install mongodb-community 这里有可能会报错,提示:
Error: Permission denied @ apply2files - /usr/local/lib/docker/cli-plugins

Solution
sudo chown -R $(whoami) $(brew --prefix)/*

image-1661093542797