MongoDB - Unable to load data set in Compass

I've connected to my MongDB instance by copying the MONGO_URL and connecting using MongoDB Compass. I created a new table and imported all my collections. However, if I try to load my site I get an error. Upon closer inspection, and also utilising Data tab on Railway, I can see the collections are empty. This is also confirmed by checking my applications api endpoint which exposes collections. I feel like somwehere, as I seem to be loading the table that initialises Mongo, What is the correct string I need to use to connect to my DB remotely? The documention refers to an ENV named DATABASE_URL, but I can't see that in my Variables tab in the MongoDB service https://docs.railway.app/databases/mongodb
Railway Docs
MongoDB | Railway Docs
Documentation for Railway
No description
Solution:
have you tried restarting the database?
Jump to solution
23 Replies
Percy
Percy12mo ago
Project ID: 38aae1e6-ddf3-4d10-a02b-a590e97275f4
donutmuncha
donutmuncha12mo ago
38aae1e6-ddf3-4d10-a02b-a590e97275f4
Solution
Brody
Brody12mo ago
have you tried restarting the database?
donutmuncha
donutmuncha12mo ago
no
Brody
Brody12mo ago
try it
donutmuncha
donutmuncha12mo ago
don't make me feel like Homer Simpson already lol
Brody
Brody12mo ago
but yes MONGO_URL is the correct url to connect to your database externally, that page mentioning DATABASE_URL is just a copy error
donutmuncha
donutmuncha12mo ago
I've restarted the service, it seemed to be instant, however no joy Compass still shows populated collections
Brody
Brody12mo ago
you said empty and now you're saying populated?
donutmuncha
donutmuncha12mo ago
ok, I restarted Compass. it's empty now at least I have some consistency
Brody
Brody12mo ago
any errors in mongo's logs?
donutmuncha
donutmuncha12mo ago
no errors
Brody
Brody12mo ago
right now it's kinda looking like you've just deleted the data?
donutmuncha
donutmuncha12mo ago
Last night, I added data, and could see it each time I connected via Compass. When I restarted Mongo just now and connected via Compass, it all disappeared. I couldn't see any data in the CMS, so this is why I raised this ticket. I'll add some data now via Compass and see if it appears in the CMS I'm not relying solely upon the Data tab in Railway, but it was a good way to confirm doubts
Brody
Brody12mo ago
do you have a backup? was the data important?
donutmuncha
donutmuncha12mo ago
I am porting from MongoDB Atlas into Railway, I exported all the collections to JSON, so it's safe
Brody
Brody12mo ago
okay cool
donutmuncha
donutmuncha12mo ago
restarting seemed to have done the trick
Brody
Brody12mo ago
you restarted the mongo service a second time? do you perhaps still have a 500mb volume?
donutmuncha
donutmuncha12mo ago
5GB volume according to mongo data I assume any time I restart, the data will persist on the volume
Brody
Brody12mo ago
correct
donutmuncha
donutmuncha12mo ago
I can't believe it was as simple as restarting. Thank you I literally turned myself into an IT Crowd meme
Want results from more Discord servers?
Add your server