mongodb - 如何使用 Homebrew 软件安装早期版本的 mongodb?

我是osx6.8,需要安装较早版本的Mongodb,如何使用HomeBrew安装较早版本?

下面没有工作:(

dream-2:app2 star$ brew install mongodb-2.6.10
Error: No available formula for mongodb-2.6.10 
Searching formulae...
Searching taps...
dream-2:app2 star$ 

编辑:
我收到一条消息来解释这篇文章与另一篇文章相比有何独特之处,嗯,另一个问题的答案非常冗长和复杂,它特定于 postgresql 并没有真正回答我的问题。

最佳答案

Note: In September 2019 mongodb was removed from homebrew core, so these instructions have been updated to use mongodb-community instead, installed from the external tap.

If your current installation is still the pre-September mongodb package then you will need to use that name when you unlink, stop, relink and start, on the lines marked with #*# below.

Another option is to simply upgrade away from the deprecated package now.

我已经安装了最新版本的 mongo,谢谢。

brew tap mongodb/brew

brew install mongodb-community

但有时我想切换到旧版本。首先,安装它:

brew search mongo

brew install mongodb-community@3.2

让我们停止当前的 mongodb,如果它正在运行:

brew services stop mongodb/brew/mongodb-community           #*#

# or if you had started it manually

killall mongod

现在我想要 PATH 上的 3.2 而不是最新的:

brew unlink mongodb-community                               #*#

brew link --force mongodb-community@3.2

(显然它需要 --force,因为它是仅桶装的。)

现在我的 PATH 上有 3.2,我可以启动测试数据库了:

mongod --version

brew services start mongodb/brew/mongodb-community

# or start your own mongod from the command-line

完成后,我可以反向切换回最新版本:

brew services stop mongodb/brew/mongodb-community

brew unlink mongodb-community@3.2

brew link mongodb-community                                 #*#

brew services start mongodb/brew/mongodb-community          #*#

然后重新启动。

https://stackoverflow.com/questions/30379127/

相关文章:

javascript - 如何在 Node.js 中使用带有 Promise 的 MongoDB?

python - flask 用户认证

javascript - Mongodb如何获取单个文档的大小?

linux - 删除mongodb的日志文件安全吗?

mongodb - 如何将 mongodump 用于 1 个集合

mongodb - MySql 是否有一个示例 MongoDB 数据库?

mongodb - 如何在 MongoDB 中设置主键?

node.js - 在 Mongoose 中填充后查询

c# - 在 MongoDB 中将枚举存储为字符串

mongodb - 使用 mongoimport 将 json 从文件导入 mongodb