Skip to content

Added behaviour test for $pull,$pop,$max,$[<identifier>]#562

Open
afn7081 wants to merge 6 commits into
documentdb:mainfrom
afn7081:users/afanankhan/maxpoppulltests
Open

Added behaviour test for $pull,$pop,$max,$[<identifier>]#562
afn7081 wants to merge 6 commits into
documentdb:mainfrom
afn7081:users/afanankhan/maxpoppulltests

Conversation

@afn7081

@afn7081 afn7081 commented Jun 4, 2026

Copy link
Copy Markdown

Add behavior tests for $max, $pop, $pull, $[]

Comprehensive compat-functional tests covering:
- $max: type comparison, cross-type ordering, NaN, dates, missing fields
- $pop: first/last, empty array, nested paths, invalid values
- $pull: exact match, conditional ($gte, $in), document match, nested
- $[<identifier>]: basic filters, scalar arrays, multi, findAndModify

2 divergences tracked with engine_xfail markers:
- $pop on non-array: error code 2 instead of 14 (TypeMismatch)
- $[<identifier>] invalid identifier: accepts instead of rejecting

All tests stable across 5 serial iterations.

@afn7081 afn7081 requested a review from a team as a code owner June 4, 2026 08:18
@documentdb-triage-tool documentdb-triage-tool Bot added compatibility test Compatibility test related enhancement New feature or request labels Jun 4, 2026
@documentdb-triage-tool

Copy link
Copy Markdown

🤖 Auto-triaged by documentdb-triage-tool.

Applied: compatibility test, enhancement
Project fields suggested: Component test-coverage · Priority P2 · Effort L · Status Needs Review
Confidence: 0.88 (mixed)

Reasoning

component from path globs (test-coverage); effort from diff stats (1318+0 LOC, 4 files); LLM: Adds comprehensive compatibility/behavior test coverage for multiple update operators ($max, $pop, $pull, $[identifier]) with documented divergences, touching multiple test files across one component.

If a label is wrong, remove it manually and ping @patty-chow so the rules can be tuned. The bot will not re-label items that already have component labels.

PatersonProjects and others added 6 commits June 4, 2026 13:20
Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
Signed-off-by: afanankhan <afanankhan@microsoft.com>
Comprehensive compat-functional tests covering type coercion, boundary
values, nested paths, command paths (update, findAndModify), multi-doc
updates, upsert, composition, and error cases.

3 known divergences tracked with engine_xfail markers:
- $[] on empty array: nModified=1 instead of 0 (ADO #5329571)
- $[] on non-array field: error code 28 instead of 2 (ADO #5329572)
- $ positional nested array: matches wrong element (ADO #5329573)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: afanankhan <afanankhan@microsoft.com>
Comprehensive compat-functional tests covering:
- $max: type comparison, cross-type ordering, NaN, dates, missing fields
- $pop: first/last, empty array, nested paths, invalid values
- $pull: exact match, conditional ($gte, $in), document match, nested
- $[<identifier>]: basic filters, scalar arrays, multi, findAndModify

2 divergences tracked with engine_xfail markers:
- $pop on non-array: error code 2 instead of 14 (TypeMismatch)
- $[<identifier>] invalid identifier: accepts instead of rejecting

All tests stable across 5 serial iterations.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: afanankhan <afanankhan@microsoft.com>
This reverts commit 851e883.

Signed-off-by: afanankhan <afanankhan@microsoft.com>
Signed-off-by: afanankhan <afanankhan@microsoft.com>
Signed-off-by: afanankhan <afanankhan@microsoft.com>
@afn7081 afn7081 force-pushed the users/afanankhan/maxpoppulltests branch from d946778 to 77c6f8e Compare June 4, 2026 13:20

@eerxuan eerxuan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please claim the tracking issue before raise PR, we are seeing overlapping effort across PRs. Also can you start with issues with "Second pass"? Amazon team is working through First pass features. We planned 48 features in this sprint, will claim the issues shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compatibility test Compatibility test related enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants