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:
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:
I hope this will help you.
Originally posted by @steineey in https://github.com/steineey/node-red-contrib-mongodb4/issues/2#issuecomment-1004341926