-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
7.0 driver cleanup #12839
7.0 driver cleanup #12839
Conversation
… relying on driver to import Binary, ObjectId, Decimal128 Re: #12638
@@ -904,7 +893,7 @@ | |||
continue; | |||
} | |||
if (typeof to[key] === 'undefined') { | |||
to[key] = exports.clone(fromObj[key], { | |||
to[key] = clone(fromObj[key], { |
Check warning
Code scanning / CodeQL
Prototype-polluting function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this alert can be dismissed, ~5 lines above in the loop specialProperties
are already skipped
if i understand correctly, this means a custom driver cannot provide types like ObjectId (etc) anymore and mongoose is now always using directly from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall looks good to me, though some small notes
@@ -904,7 +893,7 @@ | |||
continue; | |||
} | |||
if (typeof to[key] === 'undefined') { | |||
to[key] = exports.clone(fromObj[key], { | |||
to[key] = clone(fromObj[key], { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this alert can be dismissed, ~5 lines above in the loop specialProperties
are already skipped
Summary
Make drivers easier to implement, and minimize how hard-coded the MongoDB driver is in our code. Also remove the
require('../driver').get()
calls that tend to confuse bundlers and cause hard-to-debug issues when implementing custom drivers. Drivers are now fully scoped to a single Mongoose instance, minus thedriver.js
file which we still need to remove.Examples