8 months ago
I am trying to connect to the database using the URL provided by Railway. I have a .env file where I have the environment variable where I establish that URL (which railway gives me) but it doesn't connect me and I don't really understand why
0 Replies
8 months ago
You're using the internal url
8 months ago
That one is used for communication between service INSIDE the railway private network
8 months ago
does the URL follows the same pattern stated in the prisma docs?
https://www.prisma.io/docs/orm/reference/connection-urls#mongodb
Sorry, I'm not used to this problem, I normally used MySQL or PostgreSQL and this error is new for me
8 months ago
No problems, just check if your db url follows this pattern:"mongodb+srv://root:@[cluster0.ab1cd.mongodb.net/myDatabase?retryWrites=true&w=majority](cluster0.ab1cd.mongodb.net/myDatabase?retryWrites=true&w=majority)"
8 months ago
Does your URL string starts withmongodb+srv://
?
Did you put the database at the end?/your-db-here
||mongodb://mongo:pjUxJYpgWlNcrSAqefuZgyjYAUWRtMZT@autorack.proxy.rlwy.net:39175||
I am trying to adapt this url according to the prisma documentation but I don't know very well how.
8 months ago
er uhm
8 months ago
delete it
8 months ago
u just showed me your creds
8 months ago
<:kekw:788259314607325204>
8 months ago
ok.
8 months ago
mongodb://mongo:pjUxJYpgWlNcrSAqefuZgyjYAUWRtMZT@autorack.proxy.rlwy.net:39175/railway?retryWrites=true&w=majority
8 months ago
in the prisma docs they also include this ?retryWrites=true&w=majority
at the end, probably some connection config that it needs
Coincidentally, I tried it like this without the last one, but it still doesn't work. <:sad_hamster:1280780987504267328>
8 months ago
mongodb://mongo:pjUxJYpgWlNcrSAqefuZgyjYAUWRtMZT@autorack.proxy.rlwy.net:39175/railway?retryWrites=true&w=majority
8 months ago
try without the +srv
8 months ago
<:cryingman:786867299553378324>
i will see if they allow me to change databases, this problem is only happening to me in mongo db, in the other databases I have not had this problem