summaryrefslogtreecommitdiff
path: root/jstests/aggregation/bugs/cond.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/aggregation/bugs/cond.js')
-rw-r--r--jstests/aggregation/bugs/cond.js25
1 files changed, 12 insertions, 13 deletions
diff --git a/jstests/aggregation/bugs/cond.js b/jstests/aggregation/bugs/cond.js
index 2b4fa8ff16e..c48c6b724f0 100644
--- a/jstests/aggregation/bugs/cond.js
+++ b/jstests/aggregation/bugs/cond.js
@@ -68,16 +68,15 @@ t.save({noonSense: 'pm', mealCombined: 'yes'});
t.save({noonSense: 'pm', mealCombined: 'no'});
assert.eq(['breakfast', 'brunch', 'linner', 'dinner'],
t.aggregate({
- $project: {
- a: {
- $cond: [
- {$eq: ['$noonSense', 'am']},
- {$cond: [{$eq: ['$mealCombined', 'yes']}, 'brunch', 'breakfast']},
- {$cond: [{$eq: ['$mealCombined', 'yes']}, 'linner', 'dinner']}
- ]
- }
- }
- })
- .map(function(x) {
- return x.a;
- }));
+ $project: {
+ a: {
+ $cond: [
+ {$eq: ['$noonSense', 'am']},
+ {$cond: [{$eq: ['$mealCombined', 'yes']}, 'brunch', 'breakfast']},
+ {$cond: [{$eq: ['$mealCombined', 'yes']}, 'linner', 'dinner']}
+ ]
+ }
+ }
+ }).map(function(x) {
+ return x.a;
+ }));