You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched existing issues to ensure the bug has not already been reported
Mongoose version
7.0.3
Node.js version
18.15.0
MongoDB server version
5.0
Typescript version (if applicable)
No response
Description
when creating mongo connection we pass a connection string and options object
in this case the options object gets mutated
My code is taking options from node-config which properties make it immutable. This results in crash when mongoose is trying to mutate the passed object.
mpodolsk$ node bug.mjs
/node_modules/mongoose/lib/helpers/processConnectionOptions.js:49
opts.config = { autoIndex: false };
^
TypeError: Cannot add property config, object is not extensible
Prerequisites
Mongoose version
7.0.3
Node.js version
18.15.0
MongoDB server version
5.0
Typescript version (if applicable)
No response
Description
when creating mongo connection we pass a connection string and options object
in this case the options object gets mutated
My code is taking options from node-config which properties make it immutable. This results in crash when mongoose is trying to mutate the passed object.
Steps to Reproduce
Expected Behavior
it copies the properties needed and uses them without modding the passed object
The text was updated successfully, but these errors were encountered: