-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mongoose v6 modifies connection options object #14370
Comments
What I did was update mongoose to latest version 8.2.0. And it only shows the options listed in the options object.
|
If you want to keep it at mongoose version 6.12.6, then removing readPreference only shows the fields listed in options.
|
I understand you wanted to not set other fields only on mongoose v6. |
Prerequisites
Mongoose version
6.12.6
Node.js version
20.10.0
MongoDB server version
6.0.4
Typescript version (if applicable)
No response
Description
mongoose.connect()
sets the propertiesconfig
,autoCreate
, andautoIndex
, which i understand to be mongoose-specific connection options. My application creates connections using bothmongoose
andmongodb
and uses a common options object for both. When the options object is passed tomongodb.MongoClient.connect()
, it has the properties that were added by mongoose, which causes an error from MongoClient.Steps to Reproduce
Expected Behavior
Since the options object is a set of static properties for configuring the behavior of Mongoose, i would expect that it not be modified at all.
The text was updated successfully, but these errors were encountered: