setting up discord bot with mongodb Atlas
Hello All, Like many here I am new to all of this. Im setting a discord bot, I have it running on my windows laptop. I deployed from github when setting it up and created the env variables in railway.
I am getting this error from railway log:
My current token for is: "mongodb+srv://atlasinfo.mongodb.net/?retryWrites=true&w=majority"
the atlasinfo is not what is actually in the token.
I saw another post here about having to add all the ip's for railway to Atlas whitelist, which I did.
Edit: I had also added 0.0.0.0 and no luck there.
12 Replies
Project ID:
db268532-e2a0-4bda-97c2-c64fc139870b
db268532-e2a0-4bda-97c2-c64fc139870b
I am able to connect to mongodb atlas no problem from my railway app.
is your complete connection string like this?
it doesnt look it like it has the <DATABASE> hmmm, mine just has /?
where are you getting your connection string from? 🤨
Go to
Connect
Then click on Drivers
and you should see your connection string in step 3I had gotten it from atlas, thank you I was just clicking through everything trying to find it again!
I copied it from connect>drivers and entered my username and password but still fails to connect
have you whitelisted all ips?
0.0.0.0/0
the steps I went through are:
- create a user with username/password access
- make sure that "cloud environment" is selected
- it should provide a string
be sure to assign said user to your db.
eg
magic-db-user
is assigned to magic-db
I have and it looks like there was a connection at the same times I tried
thank you for the screenshot, I dont have those options. I get there from Security>Database Access.
any suggestions out there? I ve done the google, the AI, and no luck. I dont have any special characters in the username or password, there's no semicolon at the end, I sent it to the console and it prints as it should with eeverything correct