R
Railway•3mo ago
lasse

MongoDB connection issues

So when ever i try to connect to my database, i get this error. It worked before with my local database. But wanna have it on railway. I just straigt copied the url from the railway dashboard.
No description
Solution:
you need to specify the database name in the options object
Jump to solution
9 Replies
Percy
Percy•3mo ago
Project ID: N/A
Brody
Brody•3mo ago
I assume you may have changed the database name?
lasse
lasse•3mo ago
I have set it to "test" wich already exist in it
MONGO_URL="mongodb://<user>:<pass>@<host>:<port>/test"
MONGO_URL="mongodb://<user>:<pass>@<host>:<port>/test"
Brody
Brody•3mo ago
have you changed anything service variables wise?
lasse
lasse•3mo ago
I works now, by removing the "/test"
Brody
Brody•3mo ago
is this mongoose?
lasse
lasse•3mo ago
Yes
Solution
Brody
Brody•3mo ago
you need to specify the database name in the options object
lasse
lasse•3mo ago
Alright thanks brody 👌