Add indexes type tests for wildcard#679
Conversation
Signed-off-by: Victor [C] Tsang <vitsangp@amazon.com>
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent from path globs (test-coverage, test-framework); effort from diff stats (1994+0 LOC, 7 files); LLM: Adds new wildcard index type test cases to the compatibility test suite, expanding test coverage for an existing feature. If a label is wrong, remove it manually and ping |
Signed-off-by: Victor Tsang <vitsangp@amazon.com>
fcf03e7 to
8cb12af
Compare
Signed-off-by: Victor Tsang <vitsangp@amazon.com>
|
|
||
|
|
||
| WILDCARD_BSON_PARAMS = [ | ||
| BsonTypeTestCase( |
There was a problem hiding this comment.
wildcardProjection BSON test only checks OBJECT is accepted and non-object types are rejected as TYPE_MISMATCH_ERROR.
| ) | ||
| assertFailureCode(result, test.expected, msg=test.msg) | ||
|
|
||
|
|
There was a problem hiding this comment.
Add a case for wildcardProjection mixing inclusion/exclusion inside the nested-object form (e.g. {"a": {"b": 1, "c": 0}})
| assertFailureCode(result, test.expected, msg=test.msg) | ||
|
|
||
|
|
||
| INVALID_PROJECTION_TESTS: list[IndexTestCase] = [ |
There was a problem hiding this comment.
Add a case for a dotted-path/parent-child collision in wildcardProjection (e.g. {"a": 1, "a.b": 0}).
| expected=[{"_id": 2, "x": {"y": 1}}], | ||
| msg="Nested match on polymorphic field", | ||
| ), | ||
| IndexQueryTestCase( |
There was a problem hiding this comment.
Add a case that replaces a scalar array element with an object via $set (e.g. a: [1,2,3] → $set: {"a.1": {b: 5}}) and then queries the new subpath (a.b).
| {"createIndexes": collection.name, "indexes": list(test.indexes)}, | ||
| ) | ||
| assertSuccessPartial(result, {"numIndexesAfter": 2, "ok": 1.0}, msg=test.msg) | ||
|
|
There was a problem hiding this comment.
Consider adding a scoped-wildcard-plus-prefix-field-with-projection case (e.g. {"a": 1, "sub.$**": 1} + wildcardProjection).
This PR contains:
Ref: