diff options
author | Kyle Suarez <kyle.suarez@mongodb.com> | 2018-05-25 15:24:17 -0400 |
---|---|---|
committer | Kyle Suarez <kyle.suarez@mongodb.com> | 2018-05-30 09:45:28 -0400 |
commit | 190fc58164d3076e1c3a72b7dcca8748dbe40d1f (patch) | |
tree | 5ad560c8a3f04618e455620dcf3ceae7d0811cd5 /jstests/sharding/migrateBig_balancer.js | |
parent | 774af67d1d2115d9a89a45643b42e931bec9aa82 (diff) | |
download | mongo-190fc58164d3076e1c3a72b7dcca8748dbe40d1f.tar.gz |
SERVER-28524 remove group command
Users should use the aggregation $group stage instead.
Diffstat (limited to 'jstests/sharding/migrateBig_balancer.js')
-rw-r--r-- | jstests/sharding/migrateBig_balancer.js | 17 |
1 files changed, 7 insertions, 10 deletions
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; |