diff options
author | Yoonsoo Kim <yoonsoo.kim@mongodb.com> | 2021-11-30 02:03:16 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-11-30 04:26:37 +0000 |
commit | e4fdc9440350c3840bbcba5fa5cdbd86609fcb59 (patch) | |
tree | 63c66fd764650585f886340e6c51a7cc3bdc6d67 /jstests/noPassthroughWithMongod/group_pushdown.js | |
parent | bc6a66d1d4f2bf2dfe8603de792c567ee0db830c (diff) | |
download | mongo-e4fdc9440350c3840bbcba5fa5cdbd86609fcb59.tar.gz |
SERVER-61787 Block pushdown of subplanned $match stage
Diffstat (limited to 'jstests/noPassthroughWithMongod/group_pushdown.js')
-rw-r--r-- | jstests/noPassthroughWithMongod/group_pushdown.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/jstests/noPassthroughWithMongod/group_pushdown.js b/jstests/noPassthroughWithMongod/group_pushdown.js index a7e1665324d..56198c35bcd 100644 --- a/jstests/noPassthroughWithMongod/group_pushdown.js +++ b/jstests/noPassthroughWithMongod/group_pushdown.js @@ -316,6 +316,13 @@ const groupPossiblyPushedDown = { assertNoGroupPushdown(coll, [matchWithOr, groupPossiblyPushedDown], [{_id: "a", quantity: 7}, {_id: "b", quantity: 10}]); +// A trival $and with only one $or will be optimized away and thus $or will be the top expression. +const matchWithTrivialAndOr = { + $match: {$and: [{$or: [{"item": "a"}, {"price": 10}]}]} +}; +assertNoGroupPushdown(coll, + [matchWithTrivialAndOr, groupPossiblyPushedDown], + [{_id: "a", quantity: 7}, {_id: "b", quantity: 10}]); // $bucketAuto/$bucket/$sortByCount are sugared $group stages which are not compatible with SBE. // TODO SERVER-60300: When we support pushdown of these stages, change these assertions to check |