From 190fc58164d3076e1c3a72b7dcca8748dbe40d1f Mon Sep 17 00:00:00 2001 From: Kyle Suarez Date: Fri, 25 May 2018 15:24:17 -0400 Subject: SERVER-28524 remove group command Users should use the aggregation $group stage instead. --- jstests/sharding/migrateBig_balancer.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'jstests/sharding/migrateBig_balancer.js') diff --git a/jstests/sharding/migrateBig_balancer.js b/jstests/sharding/migrateBig_balancer.js index 2d28244cba7..0b0b231afb7 100644 --- a/jstests/sharding/migrateBig_balancer.js +++ b/jstests/sharding/migrateBig_balancer.js @@ -46,16 +46,13 @@ assert.lt( 5, mongos.getDB("config").chunks.find({ns: "test.stuff"}).count(), "not enough chunks"); - assert.soon(function() { - var res = mongos.getDB("config").chunks.group({ - cond: {ns: "test.stuff"}, - key: {shard: 1}, - reduce: function(doc, out) { - out.nChunks++; - }, - initial: {nChunks: 0} - }); - + assert.soon(() => { + let res = + mongos.getDB("config") + .chunks + .aggregate( + [{$match: {ns: "test.stuff"}}, {$group: {_id: "$shard", nChunks: {$sum: 1}}}]) + .toArray(); printjson(res); return res.length > 1 && Math.abs(res[0].nChunks - res[1].nChunks) <= 3; -- cgit v1.2.1