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
Percy13mo ago
Project ID: 38aae1e6-ddf3-4d10-a02b-a590e97275f4
donutmuncha
donutmunchaOP13mo ago
38aae1e6-ddf3-4d10-a02b-a590e97275f4
Solution
Brody
Brody13mo ago
have you tried restarting the database?
donutmuncha
donutmunchaOP13mo ago
no
Brody
Brody13mo ago
try it
donutmuncha
donutmunchaOP13mo ago
don't make me feel like Homer Simpson already lol
Brody
Brody13mo 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
donutmunchaOP13mo ago
I've restarted the service, it seemed to be instant, however no joy Compass still shows populated collections
Brody
Brody13mo ago
you said empty and now you're saying populated?
donutmuncha
donutmunchaOP13mo ago
ok, I restarted Compass. it's empty now at least I have some consistency
Brody
Brody13mo ago
any errors in mongo's logs?
donutmuncha
donutmunchaOP13mo ago
no errors
Brody
Brody13mo ago
right now it's kinda looking like you've just deleted the data?
donutmuncha
donutmunchaOP13mo 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
Brody13mo ago
do you have a backup? was the data important?
donutmuncha
donutmunchaOP13mo ago
I am porting from MongoDB Atlas into Railway, I exported all the collections to JSON, so it's safe
Brody
Brody13mo ago
okay cool
donutmuncha
donutmunchaOP13mo ago
restarting seemed to have done the trick
Brody
Brody13mo ago
you restarted the mongo service a second time? do you perhaps still have a 500mb volume?
donutmuncha
donutmunchaOP13mo ago
5GB volume according to mongo data I assume any time I restart, the data will persist on the volume
Brody
Brody13mo ago
correct
donutmuncha
donutmunchaOP13mo 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