-
Notifications
You must be signed in to change notification settings - Fork 70
v6 #141
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
base: master
Are you sure you want to change the base?
v6 #141
Conversation
…ete, countDocuments, estimatedDocumentCount
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.
Pull Request Overview
This PR prepares the mquery library for a v6 release with two main changes: removing the debug dependency for security reasons and upgrading to MongoDB Node driver v6.
- Remove
debug
production dependency due to security concerns - Upgrade MongoDB Node driver from v5 to v6 in dev dependencies and upgrade Mocha from v9 to v11
- Update test code to handle MongoDB driver v6's new return format for
findOneAndUpdate()
operations
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
package.json | Removes debug dependency, upgrades MongoDB driver to v6 and Mocha to v11 |
lib/mquery.js | Removes debug import and all debug logging statements throughout the codebase |
test/index.js | Updates tests to handle MongoDB driver v6's changed return format for findOneAndUpdate operations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…mquery into vkarpov15/remove-old-methods
BREAKING CHANGE: remove count and findOneAndRemove, add findOneAndDelete, countDocuments, estimatedDocumentCount
…AndX set conditions not update, add findOneAndReplace Fix #104 Re: Automattic/mongoose#15363
From the looks of our dependent graph, no active open source projects of size, outside mongoose, are using this module. That does not mean there aren't other non-public, internal applications using this (that's how I used this module). Back when I developed this and was actively using it outside mongoose, it was a very convenient way to see what was happening within my apps. There are other tools for debugging but in very locked down production environments, sometimes As for security being a reason to remove |
That's a fair concern re: internal applications. I'm open to using Node's debuglog instead if that helps. It looks like debuglog behaves almost exactly the same as debug, is that correct? Re: "I see the risk as the same as any other module on npm, including mongoose itself.", I don't entirely agree. Because debug is so widely used (6th most depended on package on npm), it is more likely to be targeted. I see debug integration as more of a nice-to-have for this package, and I imagine users are more likely to write debugging logic in their own code, but I could be wrong. |
Co-authored-by: Aaron Heckmann <[email protected]>
I don't feel strongly. I'm +1 on whatever direction you feel is best. |
Co-authored-by: Aaron Heckmann <[email protected]>
matrix: | ||
node: [14, 16, 18] | ||
mongo: [4.2, 5.0] | ||
node: ['lts/*', 'lts/-1', 'latest'] |
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.
Summary
Branch for v6 release, changes:
debug
as prod dependency due to the recent security issue. I don't think it is worth the risk to Mongoose to have debug as a direct dependency of mquery, especially since Mongoose itself doesn't use debug.includeResultMetadata
because MongoDB driver v6 returns just the document fromfindOneAndUpdate()
by default.updateOne(v)
is equivalent toupdateOne(null, v)
is surprising and not very idiomatic these days. Devs tend to think more in terms of TypeScript's optional arguments rules, and chaining APIs are less popular.Examples