Commit 78a27ab
fix(db-mongodb): update mongoose-paginate-v2 to fix collation pagination (#16049)
## Summary
- Upgrades mongoose-paginate-v2 from 1.8.5 to 1.9.4 with my
[fix](aravindnc/mongoose-paginate-v2#241)
- Removes workaround code using `useCustomCountFn`
### Fixes included in 1.9.4:
- **Collation + session in transactions** - chaining `.collation()` on
`countDocuments` was breaking session context
- **limit in options.options** - was being passed to `countDocuments`,
causing incorrect `totalDocs` count
## Test plan
- [x] `pnpm test:int database` - all 160 tests pass
- [x] Collation tests specifically verified:
- `ensure mongodb respects collation when using collection in the
config`
- `ensure mongodb collation works with draft pagination without sort`
Additional context #15990
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 4e48706 commit 78a27ab
3 files changed
Lines changed: 1878 additions & 1657 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | 126 | | |
140 | 127 | | |
141 | 128 | | |
| |||
158 | 145 | | |
159 | 146 | | |
160 | 147 | | |
161 | | - | |
162 | 148 | | |
163 | 149 | | |
164 | 150 | | |
| |||
0 commit comments