connect to my mongodb from outside of my project?

hoyy, how do i connect to my mongodb from outside of my project? (like mongosh and compass) I'm probably missing something in the options but just the link won't do
22 Replies
Percy
Percyβ€’2mo ago
Project ID: N/A
Fragly
Fraglyβ€’2mo ago
You can find a public MongoDB connection string in your MongoDB service, you can use that to connect to MongoDB from outside your project Although I'm unsure why you're saying "just the link won't do", what do you mean by that?
Vulgaris Magistralis
Vulgaris Magistralisβ€’2mo ago
When trying to use the same link i'm using in my app i'm getting "connection <monitor> to 35.214.179.121:20212 closed" on both mongosh and compass
Fragly
Fraglyβ€’2mo ago
Strange, I just connected to my MongoDB database on Railway perfectly on Compass πŸ€” are you sure you're copying the correct link? (MONGO_URL and not MONGO_PRIVATE_URL)
Vulgaris Magistralis
Vulgaris Magistralisβ€’2mo ago
Yes I am :/ Same error when trying to access it from my actual app with mongoose (not the deployed one the one on my pc) but as i said putting it as an enviroment variable to the deployed app works perfectly fine
Fragly
Fraglyβ€’2mo ago
That is uncanny
Brody
Brodyβ€’2mo ago
would it be possible that you are behind a firewall such as at a workplace or school? oftentimes firewalls at schools or workplaces block non standard ports such as the random high value ports railway uses for the databases
Vulgaris Magistralis
Vulgaris Magistralisβ€’2mo ago
No i'm not, I am using a VM if it makes any difference Well it doesn't work outside of my vm or on my friend's pc so that's not the problem
Brody
Brodyβ€’2mo ago
are you using the correct environment variable
Vulgaris Magistralis
Vulgaris Magistralisβ€’2mo ago
I am using the MONG_URL that also works on my express app (when hosted on railway)
Brody
Brodyβ€’2mo ago
can you tell me the domain for the tcp proxy?
Vulgaris Magistralis
Vulgaris Magistralisβ€’2mo ago
so the stuff after the @ ?
Brody
Brodyβ€’2mo ago
I would appreciate if you could stop the ping replies
Vulgaris Magistralis
Vulgaris Magistralisβ€’2mo ago
sure
Brody
Brodyβ€’2mo ago
yes
Vulgaris Magistralis
Vulgaris Magistralisβ€’2mo ago
@viaduct.proxy.rlwy.net:20212
Hys
Hysβ€’2mo ago
happening to me as well since a few days ago https://discord.com/channels/713503345364697088/1247223969015402497
Brody
Brodyβ€’2mo ago
hys are you sure you cant waive your fingers and make it work?
Hys
Hysβ€’2mo ago
well i already deleted the whole database and deployed a new one and i still can't connect outside of railway lol been using the "data" tab since then
Jack
Jackβ€’2mo ago
😧
Brody
Brodyβ€’2mo ago
use dbgate in the same project?
Vulgaris Magistralis
Vulgaris Magistralisβ€’2mo ago
it's suddenly working for me so give it a go ig lol