I am using Mongoose with my Node.js app and this is my configuration:
mongoose.connect(process.env.MONGO_URI, {
useNewUrlParser: true,
useUnifiedTopol
if you used typescript add config to the MongoOptions
const MongoOptions: MongoClientOptions = {
useNewUrlParser: true,
useUnifiedTopology: true,
};
const client = await MongoClient.connect(url, MongoOptions);
if you not used typescript
const MongoOptions= {
useNewUrlParser: true,
useUnifiedTopology: true,
};