# What changed in mquery

> 18 changes in mquery 5 to 6 from its official release notes, upgrade guides and advisories: 11 breaking, 1 security, 5 new APIs and options. Each one cited. Sources checked 2026-10-25. HTML: https://unstale.sh/npm/mquery/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## mquery 6

### Breaking changes

- count() is removed; use countDocuments() instead. (6.0.0) — [release notes](https://github.com/aheckmann/mquery/blob/a6c448d5b7a18197b5e21b311d5202d7c195f4d9/History.md#600--2025-11-18)
- findOneAndRemove() is removed; use findOneAndDelete() instead. (6.0.0) — [release notes](https://github.com/aheckmann/mquery/blob/a6c448d5b7a18197b5e21b311d5202d7c195f4d9/History.md#600--2025-11-18)
- Calling findOneAndX() with one argument sets the query filter rather than the update, aligning optional arguments with modern expectations. (6.0.0) — [release notes](https://github.com/aheckmann/mquery/blob/a6c448d5b7a18197b5e21b311d5202d7c195f4d9/History.md#600--2025-11-18)
- The minimum required Node.js version is 20.19.0. (6.0.0) — [release notes](https://github.com/aheckmann/mquery/blob/a6c448d5b7a18197b5e21b311d5202d7c195f4d9/History.md#600--2025-11-18)
- Calling updateMany() with one argument sets the query filter rather than the update, aligning optional arguments with modern expectations. (6.0.0) — [release notes](https://github.com/aheckmann/mquery/blob/a6c448d5b7a18197b5e21b311d5202d7c195f4d9/History.md#600--2025-11-18)
- Calling updateOne() with one argument sets the query filter rather than the update, aligning optional arguments with modern expectations. (6.0.0) — [release notes](https://github.com/aheckmann/mquery/blob/a6c448d5b7a18197b5e21b311d5202d7c195f4d9/History.md#600--2025-11-18)

### Security

- Operators including in and gte avoid prototype pollution. (4.0.4, 5.0.1, 6.0.1) — [release notes](https://github.com/aheckmann/mquery/blob/a6c448d5b7a18197b5e21b311d5202d7c195f4d9/History.md#601--2026-10-23), [release notes](https://github.com/aheckmann/mquery/blob/a6c448d5b7a18197b5e21b311d5202d7c195f4d9/History.md#501--2026-10-23), [release notes](https://github.com/aheckmann/mquery/blob/a6c448d5b7a18197b5e21b311d5202d7c195f4d9/History.md#404--2026-10-23)

### New APIs and options

- Adds countDocuments as the replacement for count(). (6.0.0) — [release notes](https://github.com/aheckmann/mquery/blob/a6c448d5b7a18197b5e21b311d5202d7c195f4d9/History.md#600--2025-11-18)
- Adds estimatedDocumentCount. (6.0.0) — [release notes](https://github.com/aheckmann/mquery/blob/a6c448d5b7a18197b5e21b311d5202d7c195f4d9/History.md#600--2025-11-18)
- Adds findOneAndDelete as the replacement for findOneAndRemove(). (6.0.0) — [release notes](https://github.com/aheckmann/mquery/blob/a6c448d5b7a18197b5e21b311d5202d7c195f4d9/History.md#600--2025-11-18)
- Adds findOneAndReplace. (6.0.0) — [release notes](https://github.com/aheckmann/mquery/blob/a6c448d5b7a18197b5e21b311d5202d7c195f4d9/History.md#600--2025-11-18)

### Fixes and other changes

- Filters and updates are no longer merged into inherited properties such as toString. (4.0.4, 5.0.1, 6.0.1) — [release notes](https://github.com/aheckmann/mquery/blob/a6c448d5b7a18197b5e21b311d5202d7c195f4d9/History.md#601--2026-10-23), [release notes](https://github.com/aheckmann/mquery/blob/a6c448d5b7a18197b5e21b311d5202d7c195f4d9/History.md#501--2026-10-23), [release notes](https://github.com/aheckmann/mquery/blob/a6c448d5b7a18197b5e21b311d5202d7c195f4d9/History.md#404--2026-10-23)

## mquery 5

### Breaking changes

- Callback support was dropped; callers must no longer rely on callbacks. (5.0.0) — [release notes](https://github.com/aheckmann/mquery/blob/HEAD/History.md)
- Support for custom promise libraries was removed. (5.0.0) — [release notes](https://github.com/aheckmann/mquery/blob/HEAD/History.md)
- The first parameter is always treated as the query filter; collection ducktyping was removed. (5.0.0) — [release notes](https://github.com/aheckmann/mquery/blob/HEAD/History.md)
- The long-deprecated remove function was removed. (5.0.0) — [release notes](https://github.com/aheckmann/mquery/blob/HEAD/History.md)
- The long-deprecated update function was removed. (5.0.0) — [release notes](https://github.com/aheckmann/mquery/blob/HEAD/History.md)

### New APIs and options

- Support for MongoDB Node driver 5 was added. (5.0.0) — [release notes](https://github.com/aheckmann/mquery/blob/HEAD/History.md)
