steineey / node-red-contrib-mongodb4

MongoDB driver node for Node-RED
MIT License
26 stars 10 forks source link

Hi @johncaipa , I tried to reproduce your problem on a MongoDB Atlas Cloud Cluster and I think this is a timeout issue. #11

Closed SathishAllen closed 2 years ago

SathishAllen commented 2 years ago
    Hi @johncaipa , I tried to reproduce your problem on a MongoDB Atlas Cloud Cluster and I think this is a timeout issue.

First I got the same error like you before "connection closed", then I set the connectTimeoutMS property to 30000 and the error was gone. The default connect timeout of the driver is 10 sec and my connection took around 12 sec.

I did some more improvements to the client configuration node. You can now also pass a URI string like before in node-red-contrib-mongodb3. But be aware that your credentials in this connection will be stored in clear text inside the flow.json which could be a security issue.

Here is a example configuration for v1.2.1 of this node:

Bildschirmfoto 2022-01-03 um 21 26 42

I hope this will help you.

Originally posted by @steineey in https://github.com/steineey/node-red-contrib-mongodb4/issues/2#issuecomment-1004341926