npm / mquery
mquery
What changed in mquery 5 to 6, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-25.
11 breaking1 security5 new APIs and options1 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initmquery 612 changes
Breaking changes 6
count() is removed; use countDocuments() instead.
findOneAndRemove() is removed; use findOneAndDelete() instead.
Calling findOneAndX() with one argument sets the query filter rather than the update, aligning optional arguments with modern expectations.
The minimum required Node.js version is 20.19.0.
Calling updateMany() with one argument sets the query filter rather than the update, aligning optional arguments with modern expectations.
Calling updateOne() with one argument sets the query filter rather than the update, aligning optional arguments with modern expectations.
Security 1
Operators including in and gte avoid prototype pollution.
New APIs and options 4
Adds countDocuments as the replacement for count().
Adds estimatedDocumentCount.
Adds findOneAndDelete as the replacement for findOneAndRemove().
Adds findOneAndReplace.
Fixes and other changes 1
Filters and updates are no longer merged into inherited properties such as toString.
mquery 56 changes
Breaking changes 5
Callback support was dropped; callers must no longer rely on callbacks.
Support for custom promise libraries was removed.
The first parameter is always treated as the query filter; collection ducktyping was removed.
The long-deprecated remove function was removed.
The long-deprecated update function was removed.
New APIs and options 1
Support for MongoDB Node driver 5 was added.