[DOCS-14896] Investigate changes in SERVER-32739: allow limit in $filter expression Created: 26/Oct/21 Updated: 13/Nov/23 Resolved: 09/Feb/22 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | manual, Server |
| Affects Version/s: | None |
| Fix Version/s: | 5.2.0, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Backlog - Core Eng Program Management Team | Assignee: | Jocelyn Mendez |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Days since reply: | 2 years ago | ||||||||
| Epic Link: | DOCSP-17171 | ||||||||
| Description |
| Comments |
| Comment by Githook User [ 09/Feb/22 ] |
|
Author: {'name': 'jocelyn-mendez1', 'email': '91144778+jocelyn-mendez1@users.noreply.github.com', 'username': 'jocelyn-mendez1'}Message:
Co-authored-by: Jocelyn Mendez <jocelyn.mendez@Jocelyns-MacBook-Pro.local> |
| Comment by PM Bot [ 26/Oct/21 ] |
|
Downstream changes updated for upstream User-Facing Syntax { $filter: { input: <array>, as: <string>, cond: <expression> limit: <number expression> }} The new syntax introduces an optional field, limit, that accepts any number expression. The limit must be a positive integer greater than zero. A limit of zero or less is rejected, as is a limit that is not an integer (e.g. NumberDouble(3.14) or the string "3"). However, integer values of non-integer types (e.g. 3.000) are supported to match the behavior of $limit. Other existing validation rules still apply: input and cond are always required, and as can be optionally specified. To be consistent with $limit, for a limit of k, the $filter operation returns the first k elements in the order in which they appeared in the input array. If the array has fewer than k matching elements, the operation returns < k matches in order. |