summaryrefslogtreecommitdiff
path: root/jstests/core
diff options
context:
space:
mode:
authorJason Rassi <rassi@10gen.com>2015-11-02 14:04:16 -0500
committerJason Rassi <rassi@10gen.com>2015-11-05 13:56:56 -0500
commite2cbe3c873fa2f989e5c2b811b1757ac0f2095e3 (patch)
tree973d62ef29e235ce2e6208d1bd64477a75c53b58 /jstests/core
parent3b76b83742bcd2124abe38718ad5c68bd72b2fc8 (diff)
downloadmongo-e2cbe3c873fa2f989e5c2b811b1757ac0f2095e3.tar.gz
SERVER-19510 ExtensionsCallbackReal ctor take ptr to NamespaceString
Diffstat (limited to 'jstests/core')
-rw-r--r--jstests/core/currentop_predicate.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/jstests/core/currentop_predicate.js b/jstests/core/currentop_predicate.js
new file mode 100644
index 00000000000..ef0dd854464
--- /dev/null
+++ b/jstests/core/currentop_predicate.js
@@ -0,0 +1,12 @@
+// Tests the use of a match predicate with the currentOp command.
+(function() {
+ // Test a $where predicate that matches the currentOp operation we are running.
+ var res = db.adminCommand("currentOp", {$where: function() { return true; }});
+ assert.commandWorked(res);
+ assert.gt(res.inprog.length, 0, tojson(res));
+
+ // Test a $where predicate that matches no operations.
+ res = db.adminCommand("currentOp", {$where: function() { return false; }});
+ assert.commandWorked(res);
+ assert.eq(res.inprog.length, 0, tojson(res));
+})();