1
// This test just make sure that aggregation is possible on a secondary node.
2
var replTest = new ReplSetTest( {name: 'aggTestSlave', nodes: 2} );
3
var nodes = replTest.startSet();
5
replTest.awaitReplication();
7
var mast = nodes[0].getDB('test');
8
var slav = nodes[1].getDB('test');
15
var res = slav.agg.aggregate({$group: {_id: null, count: {$sum: 1}}});
16
assert.commandWorked(res);
17
assert.eq(res.result, [{_id:null, count: 3}]);