diff options
author | auto-revert-processor <dev-prod-dag@mongodb.com> | 2021-09-23 00:14:41 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-09-23 00:53:17 +0000 |
commit | fc885a164c0595624d9b50b9d950880414777781 (patch) | |
tree | 924899afa4d01bbb893ac37f2585551a857ee5da /jstests/aggregation | |
parent | 4ae62e32c166d8483992ff49d53c00d238ba1aea (diff) | |
download | mongo-fc885a164c0595624d9b50b9d950880414777781.tar.gz |
Revert "SERVER-51592 Added support for anyElementTrue in SBE"
This reverts commit 130476fc56a711b489525112c855766bd2a1bb23.
Diffstat (limited to 'jstests/aggregation')
-rw-r--r-- | jstests/aggregation/expressions/any_element_true.js | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/jstests/aggregation/expressions/any_element_true.js b/jstests/aggregation/expressions/any_element_true.js index 324bdd7d87c..4682ee6d858 100644 --- a/jstests/aggregation/expressions/any_element_true.js +++ b/jstests/aggregation/expressions/any_element_true.js @@ -5,18 +5,8 @@ load("jstests/libs/sbe_assert_error_override.js"); // Override error-code-checking APIs. const coll = db.any_element_true; coll.drop(); -assert.commandWorked(coll.insert({ - _id: 0, - allTrue: [true, true], - someTrue: [true, false], - noneTrue: [0, false], - nonArray: 1, - nullInput: [null], - undefinedInput: [undefined], - undefinedTrue: [undefined, true], - nullTrue: [null, true], - empty: [] -})); +assert.commandWorked( + coll.insert({_id: 0, allTrue: [true, true], someTrue: [true, false], noneTrue: [0, false]})); function testOp(expression, expected) { const results = coll.aggregate([{$project: {_id: 0, result: expression}}]).toArray(); @@ -26,12 +16,6 @@ function testOp(expression, expected) { assert.eq(loneResult.result, expected, loneResult); } -function assertThrows(expression) { - const error = - assert.throws(() => coll.aggregate([{$project: {_id: 0, result: expression}}]).toArray()); - assert.commandFailedWithCode(error, 5159200); -} - testOp({$anyElementTrue: {$literal: [true, true]}}, true); testOp({$anyElementTrue: {$literal: [1, true]}}, true); testOp({$anyElementTrue: {$literal: [true, 0]}}, true); @@ -40,14 +24,4 @@ testOp({$anyElementTrue: {$literal: [false, 0, false]}}, false); testOp({$anyElementTrue: "$allTrue"}, true); testOp({$anyElementTrue: "$someTrue"}, true); testOp({$anyElementTrue: "$noneTrue"}, false); -testOp({$anyElementTrue: ["$noneTrue"]}, false); -testOp({$anyElementTrue: [["$non_existent_field"]]}, false); -testOp({$anyElementTrue: [["$non_existent_field", true]]}, true); -testOp({$anyElementTrue: "$nullInput"}, false); -testOp({$anyElementTrue: "$undefinedInput"}, false); -testOp({$anyElementTrue: "$undefinedTrue"}, true); -testOp({$anyElementTrue: "$nullTrue"}, true); -testOp({$anyElementTrue: "$empty"}, false); -assertThrows({$anyElementTrue: "$nonArray"}); -assertThrows({$anyElementTrue: ["$non_existent_field"]}); }()); |