connect to my mongodb from outside of my project?
shimshon1
HOBBYOP

2 years ago

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

30 Replies

dev
MODERATOR

2 years ago

N/A


dev
MODERATOR

2 years 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?


shimshon1
HOBBYOP

2 years ago

When trying to use the same link i'm using in my app i'm getting "connection to 35.214.179.121:20212 closed" on both mongosh and compass


dev
MODERATOR

2 years ago

Strange, I just connected to my MongoDB database on Railway perfectly on Compass 🤔
are you sure you're copying the correct link?


dev
MODERATOR

2 years ago

(MONGO_URL and not MONGO_PRIVATE_URL)


shimshon1
HOBBYOP

2 years ago

Yes I am :/


shimshon1
HOBBYOP

2 years ago

Same error when trying to access it from my actual app with mongoose (not the deployed one the one on my pc)


shimshon1
HOBBYOP

2 years ago

but as i said putting it as an enviroment variable to the deployed app works perfectly fine


dev
MODERATOR

2 years ago

That is uncanny


brody
EMPLOYEE

2 years ago

would it be possible that you are behind a firewall such as at a workplace or school?


brody
EMPLOYEE

2 years ago

oftentimes firewalls at schools or workplaces block non standard ports such as the random high value ports railway uses for the databases


shimshon1
HOBBYOP

2 years ago

No i'm not, I am using a VM if it makes any difference


shimshon1
HOBBYOP

2 years ago

Well it doesn't work outside of my vm or on my friend's pc so that's not the problem


brody
EMPLOYEE

2 years ago

are you using the correct environment variable


shimshon1
HOBBYOP

2 years ago

I am using the MONG_URL that also works on my express app (when hosted on railway)


brody
EMPLOYEE

2 years ago

can you tell me the domain for the tcp proxy?


shimshon1
HOBBYOP

2 years ago

so the stuff after the @ ?


brody
EMPLOYEE

2 years ago

I would appreciate if you could stop the ping replies


shimshon1
HOBBYOP

2 years ago

sure


brody
EMPLOYEE

2 years ago

yes


shimshon1
HOBBYOP

2 years ago

@viaduct.proxy.rlwy.net:20212


hysmx
FREE

2 years ago

happening to me as well since a few days ago



brody
EMPLOYEE

2 years ago

hys are you sure you cant waive your fingers and make it work?


hysmx
FREE

2 years ago

well i already deleted the whole database and deployed a new one and i still can't connect outside of railway lol


hysmx
FREE

2 years ago

been using the "data" tab since then


jack
PRO

2 years ago

😧


brody
EMPLOYEE

2 years ago

use dbgate in the same project?


shimshon1
HOBBYOP

2 years ago

it's suddenly working for me


shimshon1
HOBBYOP

2 years ago

so give it a go ig lol


Loading...