You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: changelogs/unreleased.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
# Unreleased
2
2
3
+
- Fixed `findPage` cursor anchors for nested dot-path sort fields, accepted `project` as a query projection alias across read helpers, and documented process-level Model registration plus ObjectId `maxDepth` conversion boundaries.
3
4
- Fixed `incrementOne` driver-option forwarding, closed runtime-owned Redis cache adapters on `runtime.close()`, made SSH tunnels fail fast for multi-host/SRV MongoDB URIs and post-ready disconnects, enforced slow-query batch `maxBufferSize` during in-flight flushes, wired prewarmed `findPage` bookmarks into page-jump reads, and reduced redundant rebuilds in the memory-server validation matrix.
4
5
- Fixed model mutable defaults cloning, preserved model aggregation-pipeline updates when timestamps/versioning are enabled, restored aggregate/distinct read-through cache plus targeted invalidation, and prevented sync resume tokens from advancing when any eligible target fails.
5
6
- Clarified hooks return-value compatibility and sync transform/delete-event boundaries in bilingual documentation, with regression coverage for the documented behavior.
Copy file name to clipboardExpand all lines: changelogs/v2.0.7.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,7 @@ v2.0.7 closes the release-readiness gap after the v2.0.6 review and hardens the
28
28
-`dropDatabase()` now treats `NODE_ENV=production`, `prod`, and `live` as production-like environments that require `allowProduction: true`.
29
29
- Aggregate pipelines ending in `$out` or `$merge` now bypass aggregate result caching and invalidate the target collection's read caches after successful execution.
30
30
- Fire-and-forget distributed cache invalidation and transaction timeout abort paths now catch/log failures instead of leaving unhandled rejections.
31
+
-`findPage` cursor anchors now read nested dot-path sort fields correctly, query read helpers accept `project` as a projection alias, and documentation clarifies ObjectId `maxDepth` conversion limits plus process-level Model registration.
|`options.projection`| Object | ❌ | Field projection (same as find) |
73
+
|`options.projection`/ `options.project`| Object | ❌ | Field projection (same as find). `project` is an alias for `projection`; `projection` wins when both are provided.|
74
74
|`options.sort`| Object | ❌ | Sort by |
75
75
|`options.cache`| number | ❌ | cache time (milliseconds) |
76
76
|`options.maxTimeMS`| number | ❌ | Query timeout (milliseconds) |
| Parameters | Type | Required | Default value | Description |
68
68
|------|------|------|--------|------|
69
-
|`projection`| Object/Array | No | - | Field projection configuration |
69
+
|`projection`/ `project`| Object/Array | No | - | Field projection configuration. `project` is an alias for `projection`; `projection` wins when both are provided.|
70
70
|`cache`| Number | No |`0`| Cache TTL (milliseconds) |
71
71
|`maxTimeMS`| Number | No | Global configuration | Query timeout (milliseconds) |
|`projection`| Object/Array | No | - | MongoDB native ✅ | Field projection configuration, specify the returned fields |
137
+
|`projection`/ `project`| Object/Array | No | - | MongoDB native ✅ | Field projection configuration, specify the returned fields. `project` is an alias for `projection`; `projection` wins when both are provided.|
138
138
|`sort`| Object | No | - | MongoDB native ✅ | Collation, such as `{ createdAt: -1, name: 1 }`|
139
139
|`limit`| Number | No | Global Configuration | MongoDB Native ✅ | Limit the number of documents returned |
140
140
|`skip`| Number | No | - | MongoDB native ✅ | Skip the specified number of documents (not recommended for large data volumes) |
|`projection`| Object/Array | No | - | MongoDB native ✅ | Field projection configuration that controls which fields are returned |
48
+
|`projection`/ `project`| Object/Array | No | - | MongoDB native ✅ | Field projection configuration that controls which fields are returned. `project` is an alias for `projection`; `projection` wins when both are provided.|
49
49
|`sort`| Object | No | - | MongoDB native ✅ | Sort rules, such as `{ createdAt: -1, name: 1 }`|
50
50
|`hint`| Object/String | No | - | MongoDB native ✅ | Specifies the index to use for the query |
51
51
|`collation`| Object | No | - | MongoDB native ✅ | Specifies collation rules for string comparison and sorting |
Copy file name to clipboardExpand all lines: docs/en/findPage.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ async findPage(options = {})
37
37
|`after`| String | No | - | Cursor paging: Get the data after the specified cursor |
38
38
|`before`| String | No | - | Cursor paging: Get the data before the specified cursor |
39
39
|`page`| Number | No | - | Page jump mode: Specify the page number to be obtained (starting from 1) |
40
-
|`projection`| Object/Array | No | - | Field projection: Specifies the fields returned. Supports inclusive type `{ field: 1 }` and exclusive type `{ field: 0 }`, and also supports array form `['field1', 'field2']`. **NOTE**: The sort field is automatically preserved to ensure the cursor is generated correctly, no manual inclusion is required. |
40
+
|`projection`/ `project`| Object/Array | No | - | Field projection: Specifies the fields returned. `project` is an alias for `projection`; `projection` wins when both are provided. Supports inclusive type `{ field: 1 }` and exclusive type `{ field: 0 }`, and also supports array form `['field1', 'field2']`. **NOTE**: The sort field is automatically preserved to ensure the cursor is generated correctly, no manual inclusion is required. |
41
41
|`pipeline`| Array | No |`[]`| Additional MongoDB aggregation pipeline stage (only effective for current page data, executed before projection) |
42
42
|`hint`| Object/String | No | - | Specify the index used by the query |
43
43
|`collation`| Object | No | - | Specify collation |
- The cursor contains the value of the sorting field, and the sorting rules must be consistent
213
213
- When `cursorSecret` is not configured, the cursor is purely Base64url encoded, and the client can decode the content; after configuration, an HMAC-SHA256 signature is appended, and the tampered cursor will be rejected by the server.
214
214
- Cursor comparison restores JSON-round-tripped values before building the MongoDB filter: by default, 24-character hexadecimal strings are treated as ObjectId values, and ISO timestamp-like strings are treated as Date values. Use `cursorTypes` or `cursorValueNormalizer` when a string sort field intentionally contains ObjectId-like or ISO-like values.
215
+
- Cursor anchors read sort values by dot path, so nested sort fields such as `{ 'metrics.rank': 1 }` are supported.
215
216
- Do not splice or modify the cursor on the client side
216
217
- If you need long-term cross-session persistence of the cursor, please also cooperate with the server's own expiration control.
0 commit comments