mongodb - STRAPi 连接到 Mongo 数据库时出错。选项的键值对不完整
问题描述
我正在按照文档尝试连接到我的 mongodb atlas 集群,但它给了我一个Error connecting to the Mongo database. Incomplete key value pair for option
.
{
"defaultConnection": "default",
"connections": {
"default": {
"connector": "mongoose",
"settings": {
"uri": "mongodb://vafflehauz:Vafflehauz312**?@company-shard-00-00-qreis.mongodb.net:27017,company-shard-00-01-qreis.mongodb.net:27017,company-shard-00-02-qreis.mongodb.net:27017/test?ssl=true&replicaSet=company-shard-0&authSource=admin&retryWrites=true&w=majority"
},
"options": {
"ssl": true
}
}
}
}
这是我的config/development/database.json。
我正在使用strapi 3.0.0-beta 版本
解决方案
感谢 Joe Drumgoole 指出我的密码是问题所在,现在它可以工作了。
密码中的问号被解释为 URI 中的一个选项。尝试使用 %3F 代替它。——乔·德拉姆古尔
"uri": "mongodb://vafflehauz:Vafflehauz312**%3F@company-shard-00-00-qreis.mongodb.net:27017,company-shard-00-01-qreis.mongodb.net:27017,company-shard-00-02-qreis.mongodb.net:27017/test?ssl=true&replicaSet=company-shard-0&authSource=admin&retryWrites=true&w=majority"
推荐阅读
- c++ - Qt:如何在我的 qt 程序中从桌面打开文本文件?
- javascript - GraphQL 解析器奇怪地将某些字段返回为 null
- java - Hive:如何聚合地图列并返回地图
- vue.js - vue build 中 index.html 中的自定义(相对)脚本路径
- amazon-web-services - 使用随机目录结构重命名传入的 S3 文件
- linux - 使用 Elastic Beanstalk EB known_hosts 在 AWS 上使用 pysftp 和 paramiko 进行 SFTP
- clojure - 使用 plumatic 模式验证具有键和值的模式
- mysql - 更快的方法来编写 INNER JOIN 函数
- python - 如何使用嵌套大括号进行 pyparse
- html - 从数组中选择多个选项的简单形式