summaryrefslogtreecommitdiff
path: root/jstests/core/currentop_predicate.js
blob: ddda0570f8762a59dc0e12d4c7bb084c28eee84d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// @tags: [does_not_support_stepdowns]

// Tests the use of a match predicate with the currentOp command.
(function() {
// Test a predicate that matches the currentOp operation we are running.
var res = db.adminCommand("currentOp", {command: {$exists: true}});
assert.commandWorked(res);
assert.gt(res.inprog.length, 0, tojson(res));

// Test a predicate that matches no operations.
res = db.adminCommand("currentOp", {dummyCurOpField: {exists: true}});
assert.commandWorked(res);
assert.eq(res.inprog.length, 0, tojson(res));
})();