Skip to content

vercel 中添加了 MONGODB_URI 环境变量后未生效? #247

Answered by imaegoo
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

请检查环境变量的值,应该 形如以下格式,前后不要有多余的空格和换行:

mongodb+srv://用户名:密码@xxxxxx.40nis.mongodb.net/myFirstDatabase?retryWrites=true&w=majority

另外,密码中不建议包含符号,如果必须使用包含符号的密码,请对密码进行 URL 转义。(参考

如果仍无法解决,请提供你配置的 MONGODB_URI,可以将密码打码。

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ghost
Comment options

@imaegoo
Comment options

Answer selected by imaegoo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant