最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

未经数据库授权执行命令

IT培训 admin 11浏览 0评论

未经数据库授权执行命令

我最近从mLab迁移到了MongoDb Atlas。现在,当我尝试更新Node.js应用程序中的连接字符串时,无法将新的用户表单发布到数据库中。我收到以下错误:

"not authorised on database to execute command { insert: "users"..."

有人有什么建议吗?

For example, say:
Username = john (all admin read write permissions have been given)
Password = hello
Database cluster = dogs

首先,当我连接下面的字符串时,没有显示数据库:

mongodb+srv://john:[email protected]/test?retryWrites=true&w=majority

然后我编辑了字符串,将'test'更改为'dogs':

mongodb+srv://john:[email protected]/dogs?retryWrites=true&w=majority

我现在在我的应用程序上看到该数据库,但是,如果现在尝试从我的网页提交一个新的用户表单,它将显示上面提到的错误。

回答如下:

我通过在基于容器的云平台即服务(PaaS)中更新URL来解决此问题

未经数据库授权执行命令

我最近从mLab迁移到了MongoDb Atlas。现在,当我尝试更新Node.js应用程序中的连接字符串时,无法将新的用户表单发布到数据库中。我收到以下错误:

"not authorised on database to execute command { insert: "users"..."

有人有什么建议吗?

For example, say:
Username = john (all admin read write permissions have been given)
Password = hello
Database cluster = dogs

首先,当我连接下面的字符串时,没有显示数据库:

mongodb+srv://john:[email protected]/test?retryWrites=true&w=majority

然后我编辑了字符串,将'test'更改为'dogs':

mongodb+srv://john:[email protected]/dogs?retryWrites=true&w=majority

我现在在我的应用程序上看到该数据库,但是,如果现在尝试从我的网页提交一个新的用户表单,它将显示上面提到的错误。

回答如下:

我通过在基于容器的云平台即服务(PaaS)中更新URL来解决此问题

与本文相关的文章

发布评论

评论列表 (0)

  1. 暂无评论