1

I have a MongoDB running on http://linktomymongo:27017/. When I access this link via a browser I get the "It looks like you are trying to access MongoDB over HTTP on the native driver port." message.

However, when trying to access it through Node-RED I get some errors

Host: linktomymongo Port: 27017 Error:

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

Host: http://linktomymongo Port: 27017 Error:

"Error: double colon in host identifier"

What am doing wrong? Any help is welcome.

If more information is required please ask :)

Node-RED mongo node (I have tried the link with and without http://: Node-RED mongo config

editing database

Jan
  • 560
  • 6
  • 19
  • edit the question to add a screen shot of exactly what you have in the node-red config dialogue for the mongo node. – hardillb Jun 02 '17 at 09:57
  • @hardillb see the updated questing. Was this wat you needed? – Jan Jun 02 '17 at 10:04
  • Can you ping to that url from a command window? According to this https://stackoverflow.com/questions/36206686/error-double-colon-in-host-identifer the problem might be a wrong url. – derloopkat Jun 02 '17 at 10:15
  • @derloopkat I am able to ping `linktomymongo`, I'd seen that question already but I don't think it is the same problem – Jan Jun 02 '17 at 10:45

2 Answers2

0

Remove the http://from the host section in the mongo node.

This is not a http connection it is a native mongo protocol connection.

hardillb
  • 54,545
  • 11
  • 67
  • 105
  • I have tried that, but I get the following error: `MongoError: failed to connect to server [linktomymongo:27017] on first connect` (see question) – Jan Jun 02 '17 at 10:07
0

Thanks to @derloopkat 's suggestion, I 'ping'ed linktomymongo and it showed the IP address. When I entered that IP address it connected immediately.

So I guess the node expects a IP address and not an URL

Jan
  • 560
  • 6
  • 19