Added array tests for $elemMatch#151
Conversation
Signed-off-by: Victor [C] Tsang <vitsangp@amazon.com>
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent from path globs (test-coverage); effort from diff stats (1403+17 LOC, 6 files); LLM: Adds new array test cases for $elemMatch operator, expanding compatibility test coverage as part of a tracked issue. If a label is wrong, remove it manually and ping |
| msg="Double argument should fail", | ||
| ), | ||
| ] | ||
|
|
There was a problem hiding this comment.
- test for $elemMatch with empty string key {"": {"$elemMatch": {...}}} — edge case.
- test for $elemMatch with dotted field containing $ prefix (invalid field path).
- test for $elemMatch at top level without field {"$elemMatch": {...}} — spec requires it inside a : {} expression; bare usage should error.
| ], | ||
| expected=[{"_id": 1, "a": [1, "a", True, None]}], | ||
| msg="Should match in mixed-type array", | ||
| ), |
There was a problem hiding this comment.
should we add mixed array type with array of array value
| ), | ||
| ] | ||
|
|
||
| ALL_OPERATOR_TESTS = COMPARISON_TESTS + EMBEDDED_DOC_TESTS + NESTED_ELEMMATCH_TESTS |
There was a problem hiding this comment.
can you add test for $elemMatch with $bitsAllSet/$bitsAnySet/$bitsAllClear/$bitsAnyClear
| FLOAT_NEGATIVE_INFINITY, | ||
| ) | ||
|
|
||
| NULL_AND_MISSING_TESTS: list[QueryTestCase] = [ |
There was a problem hiding this comment.
Missing Decimal128("NaN") inside $elemMatch
| {"_id": 2, "a": [1]}, | ||
| ], | ||
| expected=[{"_id": 1, "a": [FLOAT_NEGATIVE_INFINITY]}], | ||
| msg="$eq -Infinity matches -Infinity", |
There was a problem hiding this comment.
MIssing test for Decimal128("Infinity")
| msg="$all with mixed regex and $elemMatch should error", | ||
| ), | ||
| ] | ||
|
|
There was a problem hiding this comment.
can you add test for $all with nested $elemMatch containing nested $elemMatch
| ], | ||
| expected=[{"_id": 1, "a": [{"x": 3, "y": 2}]}], | ||
| msg="Implicit $and via multiple conditions", | ||
| ), |
There was a problem hiding this comment.
can you add test for $and with $elemMatch
This PR contains
Ref: