【发布时间】:2021-10-28 16:29:15
【问题描述】:
我在连接到 mongoDB 的 Atlas 集群时遇到问题。
如果我尝试获取一些数据,它会返回错误
“在副本集配置中找不到名为‘majority’的写入关注模式”
我查看了错误,每个人都说删除连接字符串末尾的&w=majority。
这样做了,但现在我遇到了一个新错误
UnhandledPromiseRejectionWarning: MongoParseError: For retryWrites Expected stringified boolean value, got: true
我没有以任何方式修改字符串,它昨天还在工作。
我的字符串是
mongodb+srv://username:password@cluster0.yummd.mongodb.net/dbName?retryWrites=true&w=majority
字符串末尾没有空格或任何东西,不知道是什么。
有什么帮助吗?
【问题讨论】: