Please help me in removing these errors:

These errors pop-up in the terminal when connecting mongoDB to the backend

throw new error_1.MongoParseError(${optionWord} ${Array.from(unsupportedOptions).join(', ')} ${isOrAre} not supported);
^
MongoParseError: option usenewparser is not supported
at parseOptions (C:\Users\sangw\OneDrive\Documents\GitHub\course-selling-website\node_modules\mongodb\lib\connection_string.js:272:15)
at new MongoClient (C:\Users\sangw\OneDrive\Documents\GitHub\course-selling-website\node_modules\mongodb\lib\mongo_client.js:48:63)
at NativeConnection.createClient (C:\Users\sangw\OneDrive\Documents\GitHub\course-selling-website\node_modules\mongoose\lib\drivers\node-mongodb-native\connection.js:288:14)
at NativeConnection.openUri (C:\Users\sangw\OneDrive\Documents\GitHub\course-selling-website\node_modules\mongoose\lib\connection.js:738:34)
at Mongoose.connect (C:\Users\sangw\OneDrive\Documents\GitHub\course-selling-website\node_modules\mongoose\lib\index.js:404:15)
at file:///C:/Users/sangw/OneDrive/Documents/GitHub/course-selling-website/server/index.js:109:10
at ModuleJob.run (node:internal/modules/esm/module_job:194:25) {
[Symbol(errorLabels)]: Set(0) {}
}

Hello @Abhishek_Sangwan ,

Welcome to The MongoDB Community Forums! :wave:

Can you share more information for me to better understand the error you are encountering. I suspect you may have an error in your connection string or are using an older version of Mongoose that does not support the options you are trying to set.

Please provide:

  • A snippet of code showing how you are creating the connection including your MongoDB connection string with any password or hostname details redacted

  • Versions of Mongoose and MongoDB Node.js driver being used

Regards,
Tarun