Asthriona/Yukiko

MongoDB url

thewolf87 opened this issue · 9 comments

Please help me I don't know how to get mongodb url like mongodb://yukiko:127.0.0.1 I have free MongoDB atlas

Sure, did you already setup your cluster?
then just click "connect" copy the "link", replace mongodb://yukiko:127.0.0.1 by the URI you got on Mongo Atlas.

as example:

"dbLink": "mongodb+srv://USERNAME:PASSWORD@yukiko.mongodb.net/discordbot?retryWrites=true&w=majority"

I hope it help! :)

Thanks but I have mongodb+srv://USERNAME: PASSWORD@hard69-zbz51.mongodb.net/test?retryWrites=true&w=majority but how do I convert it into mongodb://yukiko:127.0.0.1

No you dont have to covert anything, just replace the example one. so for you it should look like:

"dbLink": "mongodb+srv://USERNAME:PASSWORD@hard69-zbz51.mongodb.net/test?retryWrites=true&w=majority"

I tried but it says ERROR Unable to connect to the Mongodb database. Error:MongooseServerSelectionError: connection <monitor> to 3.6.213.55:27017 closed

can you post the full logs and the mongoose connection code part please?

Oh, nvm.... I forgot this was an option... @thewolf87 Did you add your IP to the whitelist (IP of your home AND server?) if not try it, in Network Access on Mongo Atlas.

I just checked that there is an ip in network access but I didn't added it so what do I have to do with that ip?

@thewolf87, Just add your IP to the whitelist.
You probably have a dynamic IP. so if you host the bot behind your box you will have to update that IP every day OR allow connection from anyway. but adding your IP should fix your error.

After one week without reply, i'm closing this issue. Feel free to re-open or create a new one if needed.