gpt4 book ai didi

mongodb - mongo3 升级后获取 DatabaseException 'not authorized for query on db.collection'(代码 = 13)

转载 作者:可可西里 更新时间:2023-11-01 09:11:20 25 4
gpt4 key购买 nike

我使用免费的 MongoLab,我的数据库在周末升级到 Mongo 3,现在我的客户端无法连接。我不断收到“未授权查询 db.collection”的消息。错误。

Mongolab 说我应该使用 Mongo 3 兼容的驱动程序 (http://docs.mongodb.org/manual/release-notes/3.0-compatibility/#driver-compatibility-changes)。我正在使用 scala ReactiveMongo 客户端,版本 0.11.7,它应该支持 Mongo 3。

最佳答案

解决方案是将“?authMode=scram-sha1&rm.tcpNoDelay=true”添加到我的连接 URI 的末尾。现在看来

mongodb://user:password@host.mongolab.com:port/db?authMode=scram-sha1&rm.tcpNoDelay=true

关于mongodb - mongo3 升级后获取 DatabaseException 'not authorized for query on db.collection'(代码 = 13),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32961275/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com