My application was working fine and connect with mongodb atlas successful too.
I didn’t do any updates to my codes or changes to db, but somehow when I am starting my application locally again somehow I’m getting this error
I have tried to input the database url directly into app.module.ts
instead of using process.env.DATABASE_URI
@Module({
imports: [
ConfigModule.forRoot(),
MongooseModule.forRoot(
'mongodb+srv://user:[email protected]/collection?retryWrites=true&w=majority',
),
....codes
],
....codes
})
I even tried using campass to connect which connects fine too, of course also checked network access in mongodb atlas which I whitelist to use all ip locations of 0.0.0.0 at this moment to test. But again, no luck.
I also searched to turn on mongoose debug on by adding this to the top of the file main.ts
import mongoose from 'mongoose';
mongoose.set('debug', true);
No luck on logging anything new.
I’m pretty much out of clue now what else I can check since the uri is correct and can be connected using compass, and the error only shows this line without more details.
Thank you so much in advance for any suggestions on what else I can try to debug this situation.