Add $maxN array expression compatibility tests (#200)#608
Conversation
Add 8 compatibility tests for the $maxN array expression operator covering n larger than array size, n=1, duplicate values, negative numbers, empty arrays, null handling, dynamic n as a field reference, and $maxN as a $group accumulator. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: hehehe-hahaha <mailkashishsaini@gmail.com>
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent from path globs (test-coverage); effort from diff stats (174+0 LOC, 1 files); LLM: Adds new compatibility test cases for the $maxN array expression operator edge cases, which is a non-blocking test coverage improvement with no functional or build changes. If a label is wrong, remove it manually and ping |
|
Wanted to follow up on this PR. Happy to incorporate any feedback or adjustments. Let me know if there's anything blocking the review and I'll do my best to help move it along! |
What does this PR do?
Adds a compatibility test file for the
$maxNarray expression operator covering 8 edgecase scenarios that were missing from the existing smoke test. The new file tests:
nlarger than array sizenequal to 1nas a dynamic field reference per document$maxNused as an accumulator inside$groupWhy was this PR needed?
The
$maxNoperator only had one basic smoke test covering a single happy-path scenario.A compatibility test suite needs to prove the operator works correctly across all realistic
situations, especially edge cases that could silently return wrong results in production.
What are the relevant issue numbers?
Closes #200
Does this PR meet the acceptance criteria?