summaryrefslogtreecommitdiff
path: root/jstests/core/group8.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/group8.js')
-rw-r--r--jstests/core/group8.js22
1 files changed, 18 insertions, 4 deletions
diff --git a/jstests/core/group8.js b/jstests/core/group8.js
index 14fd890f1e7..85c8248b992 100644
--- a/jstests/core/group8.js
+++ b/jstests/core/group8.js
@@ -9,16 +9,30 @@ assert.writeOK(coll.insert({a: 2, b: "x"}));
assert.writeOK(coll.insert({a: 3, b: "y"}));
// Test case when "count" and "keys" are both zero.
-result = coll.runCommand({group: {ns: coll.getName(), key: {a: 1}, cond: {b: "z"},
- $reduce: function(x, y) {}, initial: {}}});
+result = coll.runCommand({
+ group: {
+ ns: coll.getName(),
+ key: {a: 1},
+ cond: {b: "z"},
+ $reduce: function(x, y) {},
+ initial: {}
+ }
+});
assert.commandWorked(result);
assert.eq(result.count, 0);
assert.eq(result.keys, 0);
assert.eq(result.retval.length, 0);
// Test case when "count" and "keys" are both non-zero.
-result = coll.runCommand({group: {ns: coll.getName(), key: {a: 1}, cond: {b: "x"},
- $reduce: function(x, y) {}, initial: {}}});
+result = coll.runCommand({
+ group: {
+ ns: coll.getName(),
+ key: {a: 1},
+ cond: {b: "x"},
+ $reduce: function(x, y) {},
+ initial: {}
+ }
+});
assert.commandWorked(result);
assert.eq(result.count, 3);
assert.eq(result.keys, 2);