MongoError: failed to connect to server in Node-RED

MongoError: failed to connect to server in Node-RED

我在 http://linktomymongo:27017/ 上有一个 MongoDB 运行。 当我通过浏览器访问这个 link 时,我得到了 "It looks like you are trying to access MongoDB over HTTP on the native driver port." 留言。

但是,当尝试通过 Node-RED 访问它时,我遇到了一些错误

主机:linktomymongo端口:27017 错误:

"MongoError: failed to connect to server [linktomymongo:27017] on first connect"

主机:http://linktomymongo端口:27017 错误:

"Error: double colon in host identifier"

哪里做错了?欢迎任何帮助。

如果需要更多信息,请询问:)

Node-RED mongo 节点(我尝试了 link 有无 http://

从 mongo 节点的主机部分删除 http://

这不是 http 连接,它是本机 mongo 协议连接。

感谢@derloopkat 的建议,我“ping”了 linktomymongo 并显示了 IP 地址。当我输入该 IP 地址时,它立即连接。

所以我猜节点需要一个 IP 地址而不是 URL