diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2016-05-28 17:55:12 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2016-05-28 17:55:12 -0400 |
commit | 6dcdd23dd37ef12c87e71cf59ef01cd82432efe0 (patch) | |
tree | c8cfb5acb62c80f375bc37e7d4350382deea6a37 /jstests/aggregation/bugs/server9841.js | |
parent | d4ac5673ea3f6cef4ce9dbcec90e31813997a528 (diff) | |
download | mongo-6dcdd23dd37ef12c87e71cf59ef01cd82432efe0.tar.gz |
SERVER-23971 Clang-Format code
Diffstat (limited to 'jstests/aggregation/bugs/server9841.js')
-rw-r--r-- | jstests/aggregation/bugs/server9841.js | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/jstests/aggregation/bugs/server9841.js b/jstests/aggregation/bugs/server9841.js index 5bf9b32db93..28e6037caf1 100644 --- a/jstests/aggregation/bugs/server9841.js +++ b/jstests/aggregation/bugs/server9841.js @@ -16,27 +16,26 @@ function test(expression, expected) { assert.eq(result, [{res: expected}]); } -test({$map: {input: "$simple", as: "var", in: '$$var'}}, [1, 2, 3, 4]); -test({$map: {input: "$simple", as: "var", in: {$add: [10, '$$var']}}}, [11, 12, 13, 14]); +test({$map: {input: "$simple", as: "var", in : '$$var'}}, [1, 2, 3, 4]); +test({$map: {input: "$simple", as: "var", in : {$add: [10, '$$var']}}}, [11, 12, 13, 14]); -test({$map: {input: "$nested", as: "var", in: '$$var.a'}}, [1, 2]); -test({$map: {input: "$nested", as: "CURRENT", in: '$a'}}, [1, 2]); +test({$map: {input: "$nested", as: "var", in : '$$var.a'}}, [1, 2]); +test({$map: {input: "$nested", as: "CURRENT", in : '$a'}}, [1, 2]); -test({$map: {input: "$mixed", as: "var", in: '$$var.a'}}, +test({$map: {input: "$mixed", as: "var", in : '$$var.a'}}, [1, null, 2, null]); // missing becomes null -test({$map: {input: "$null", as: "var", in: '$$var'}}, null); +test({$map: {input: "$null", as: "var", in : '$$var'}}, null); // can't set ROOT -assertErrorCode(t, {$project: {a: {$map: {input: "$simple", as: "ROOT", in: '$$ROOT'}}}}, 16867); +assertErrorCode(t, {$project: {a: {$map: {input: "$simple", as: "ROOT", in : '$$ROOT'}}}}, 16867); // error on non-array -assertErrorCode(t, {$project: {a: {$map: {input: "$notArray", as: "var", in: '$$var'}}}}, 16883); +assertErrorCode(t, {$project: {a: {$map: {input: "$notArray", as: "var", in : '$$var'}}}}, 16883); // parse errors (missing or extra fields) -assertErrorCode(t, - {$project: {a: {$map: {x: 1, input: "$simple", as: "var", in: '$$var'}}}}, - 16879); -assertErrorCode(t, {$project: {a: {$map: {as: "var", in: '$$var'}}}}, 16880); -assertErrorCode(t, {$project: {a: {$map: {input: "$simple", in: '$$var'}}}}, 16881); +assertErrorCode( + t, {$project: {a: {$map: {x: 1, input: "$simple", as: "var", in : '$$var'}}}}, 16879); +assertErrorCode(t, {$project: {a: {$map: {as: "var", in : '$$var'}}}}, 16880); +assertErrorCode(t, {$project: {a: {$map: {input: "$simple", in : '$$var'}}}}, 16881); assertErrorCode(t, {$project: {a: {$map: {input: "$simple", as: "var"}}}}, 16882); |