Closed UNOPARATOR closed 4 years ago
Hey, I haven't used this plugin with MongoDB Atlas. What issues are you experiencing ?
MongoDb Atlas gives me this connection string which I can use with MongoDb Compass without any problems:
mongodb+srv://loader:<pasword>@my_hidden_host_name.azure.mongodb.net/testDB?authSource=admin&retryWrites=true&w=majority
Here is my mongodb-config node info: I tried with and without specifying options
And here is my collection node info: This is the error message shown in debug window:
MongoServerSelectionError: getaddrinfo ENOTFOUND my_hidden_host_name.azure.mongodb.net my_hidden_host_name.azure.mongodb.net:27017 at Timeout.waitQueueMember.timer.setTimeout [as _onTimeout] (/data/node_modules/mongodb/lib/core/sdam/topology.js:430:30) at ontimeout (timers.js:436:11) at tryOnTimeout (timers.js:300:5) at listOnTimeout (timers.js:263:5) at Timer.processTimers (timers.js:223:10)
I think mongodb+srv://
this is the key.
We need to add a support of it as it says here.
Could you make a small change in your local copy of the package?
Replace mongodb://
with just mongo
right here and update your connection string accordingly.
That doesn't work either (even if I replace mongodb://
with mongo://
), but changing the mongodb://
with mongodb+srv://
does work.
You might take the following as a suggestion or not, it is up to you:
I think you'll need to handle both cases in your code, or toggle +srv
with a checkbox or something.
Alternatively you might give an option to set the connection either via a connection string textbox or via seperate input controls (just like now). Just my two cents.
P.S: You can always create a free (M0 tier) MongoDb Atlas instance to test it further. ;)
@UNOPARATOR hey, can you try this fix to make sure it solved your problem? https://github.com/node-red-tools/node-red-contrib-mongodb/tree/bugfix/%2318-atlas
I converted the settings.ts file to settings.js using an online converter then restarted my Node-RED instance. It works, thank you 💯
Published a new 1.3.0 version .
Just a heads up, it is still not showing up on Node-RED's site or as an update in Node-RED's admin ui.
It is now. Seems there is a delay.
Another just a heads up. ;) Unfortunately after all this time, it still shows the v1.2.0 as the latest version at https://flows.nodered.org/node/@node-red-tools/node-red-contrib-mongodb , which makes it impossible to update using the "Manage palette" menu. Since I've changed the relevant manually in my installation, I don't have an issue at the moment. By the way, if I follow the link "view on npm" I can see the v1.3.0 there; the problem resides at Node-RED's side.
I forgot to push 1.3.0 release 🤦♂️
I guess you still haven't pushed the button yet. Because after another month, it still shows the v1.2.0 as the latest version at https://flows.nodered.org/node/@node-red-tools/node-red-contrib-mongodb , which makes it impossible to update using the "Manage palette" menu. :(
Since April 2020, they can't update the flows from the npm. You need to login the flows.nodered.org and press "Request refresh", or just resubmit it.... https://discourse.nodered.org/t/how-to-add-update-nodes-to-the-flow-library/25294
Looks like anyone connected with their Github account can request a refresh, I did it a couple minutes ago and seems bumped to 1.3.0!
Thank you @echoix . I would have never guessed loging in to Node-RED with my github account to be able to "request refresh".
Please provide a working example configuration for using your node with a MongoDb Atlas connection. I tried everything that I could think of but nothing was successful.