Choosing mongodb database to use

shimshon1
HOBBY

9 months ago

Hola, where in the railway mongodb url do i insert the name of the database i wanna use?
cant seem to get it working like the atlas one

0 Replies

9 months ago

Mongoose?


shimshon1
HOBBY

9 months ago

Sorry i thought it got deleted. yes, moongose


9 months ago

what error are you getting


shimshon1
HOBBY

9 months ago

errorResponse: {
ok: 0,
errmsg: 'Authentication failed.',
code: 18,
codeName: 'AuthenticationFailed'
},
ok: 0,
code: 18,
codeName: 'AuthenticationFailed',
connectionGeneration: 0,
[Symbol(errorLabels)]: Set(2) { 'HandshakeError', 'ResetPool' }


shimshon1
HOBBY

9 months ago

that's when using the public one on my own machine (works without the db name chained and just goes to test) i'm not sure that was the exact same error the internal one was omitting, ive settled on just using the test db, but kinda anoyying


9 months ago

you are likely using the mongoose client incorrectly, please see the docs -

you probably want to be specifying the database name as options.dbName not in the url


shimshon1
HOBBY

9 months ago

Ill give it a shot, it's just that it always worked for me using atlas with mongoose and is a mongo thing


9 months ago

as far as I know, specifying the database in the url is Atlas specific


shimshon1
HOBBY

9 months ago

yeah that works, probably did a really bad job searching google for that "problem"


shimshon1
HOBBY

9 months ago

thank you


9 months ago

no problem!


Choosing mongodb database to use - Railway Help Station