Mongoose Bun Connection Erros
So when i use my database uri from mongodb.com it cant connect, but as soon i use one form railway it works. Is this something to do with bun itself or mogoose?. I have checked the uri and i can connect local and in mongodb compass.
37 Replies
Project ID:
N/A
N/A
have you whitelisted 0.0.0.0/0 in atlas?
Yes
im so confused beacuse everything works local.
whats the host and port atlas gave you?
Copied the url and replaced with my password
censors everything brody asked for š
mongodb+srv://username:<password>@cluster0.vnhgi9b.mongodb.net/?retryWrites=true&w=majority
am i to assume mongo's default port?
This is super weird because I use Atlas on 100% of my railway projects and I've never had this happen to me
why doesnt the url have the port lol
<:moyai_shrug:1106001173279940758>
i need the port lol
idk, i just clicked the "connect"
and then copied the url
also it has worked for over two weeks and out of the blue gives me the errors
can you give me a host you use?
ya, let me log into atlas rq
here's two different ones
Looks like my url
i cant dig those either
oh its an SRV lookup
mabye i try to setup a new database?
Same thing with the new one on atlas. Bruh
how do you connect to it in mongoose?
i have a function in a file called database.ts
and then call it in my index.ts
try slapping
in there before you run mongoose.connect
just an experiment
okay like this?
no, beforer
arr
alr
let me try yhat
The same thing
dang
I guess you're cursed
lol yea, and mongodb on railway is expensive
faxx
youre just trading resource usage for egress usage
Just store your data in json files in a the Fragly-way
ohhh cool
i will keep trying to make it work
š
@Fragly @Brody I cant figure out why its not working. I have created a whole new database and still throwing the same error. I can give access to the github-repo, and if if some of you want to check the code if you should be any mistakes i have maked.
sorry I don't know bun, but I know fragly doesn't use bun, can you try with nodejs?
Hey sorry for late response. But its fixed now. Mongodb gave me an uri that worked.
oh sick
guess we'll never know why it wasn't working before