summaryrefslogtreecommitdiff
path: root/jstests/aggregation/expressions/size.js
diff options
context:
space:
mode:
authorclang-format-7.0.1 <adam.martin@10gen.com>2019-07-26 18:42:24 -0400
committerADAM David Alan Martin <adam.martin@10gen.com>2019-07-26 18:42:24 -0400
commitc1a45ebbb0530e3d0201321d725527f1eb83ffce (patch)
treef523079dc5ded3052eefbdcaae424b7502df5b25 /jstests/aggregation/expressions/size.js
parentc9599d8610c3da0b7c3da65667aff821063cf5b9 (diff)
downloadmongo-c1a45ebbb0530e3d0201321d725527f1eb83ffce.tar.gz
Apply formatting per `clang-format-7.0.1`
Diffstat (limited to 'jstests/aggregation/expressions/size.js')
-rw-r--r--jstests/aggregation/expressions/size.js27
1 files changed, 13 insertions, 14 deletions
diff --git a/jstests/aggregation/expressions/size.js b/jstests/aggregation/expressions/size.js
index c3ccec34fb3..4e21c71bf4e 100644
--- a/jstests/aggregation/expressions/size.js
+++ b/jstests/aggregation/expressions/size.js
@@ -2,22 +2,21 @@
* Test the $size expression.
*/
(function() {
- "use strict";
- load("jstests/aggregation/extras/utils.js");
+"use strict";
+load("jstests/aggregation/extras/utils.js");
- const coll = db.expression_size;
- coll.drop();
+const coll = db.expression_size;
+coll.drop();
- assert.writeOK(coll.insert({_id: 0, arr: []}));
- assert.writeOK(coll.insert({_id: 1, arr: [1]}));
- assert.writeOK(coll.insert({_id: 2, arr: ["asdf", "asdfasdf"]}));
- assert.writeOK(coll.insert({_id: 3, arr: [1, "asdf", 1234, 4.3, {key: 23}]}));
- assert.writeOK(coll.insert({_id: 4, arr: [3, [31, 31, 13, 13]]}));
+assert.writeOK(coll.insert({_id: 0, arr: []}));
+assert.writeOK(coll.insert({_id: 1, arr: [1]}));
+assert.writeOK(coll.insert({_id: 2, arr: ["asdf", "asdfasdf"]}));
+assert.writeOK(coll.insert({_id: 3, arr: [1, "asdf", 1234, 4.3, {key: 23}]}));
+assert.writeOK(coll.insert({_id: 4, arr: [3, [31, 31, 13, 13]]}));
- const result =
- coll.aggregate([{$sort: {_id: 1}}, {$project: {_id: 0, length: {$size: "$arr"}}}]);
- assert.eq(result.toArray(), [{length: 0}, {length: 1}, {length: 2}, {length: 5}, {length: 2}]);
+const result = coll.aggregate([{$sort: {_id: 1}}, {$project: {_id: 0, length: {$size: "$arr"}}}]);
+assert.eq(result.toArray(), [{length: 0}, {length: 1}, {length: 2}, {length: 5}, {length: 2}]);
- assert.writeOK(coll.insert({arr: 231}));
- assertErrorCode(coll, {$project: {_id: 0, length: {$size: "$arr"}}}, 17124);
+assert.writeOK(coll.insert({arr: 231}));
+assertErrorCode(coll, {$project: {_id: 0, length: {$size: "$arr"}}}, 17124);
}());