diff options
author | Adam Midvidy <amidvidy@gmail.com> | 2015-04-02 18:37:06 -0400 |
---|---|---|
committer | Adam Midvidy <amidvidy@gmail.com> | 2015-04-13 10:14:12 -0400 |
commit | 1991daaff1a108d98f6e9e7414a16131e244bdd4 (patch) | |
tree | 24051b5af1c645f37d4f3ecea5b5c3d64a75c9ac /src/mongo/shell/shell_utils.cpp | |
parent | 5cfd95b0eb36c72f1b1b131ff1de76fe05f16cc3 (diff) | |
download | mongo-1991daaff1a108d98f6e9e7414a16131e244bdd4.tar.gz |
SERVER-7775 add currentOp command
Diffstat (limited to 'src/mongo/shell/shell_utils.cpp')
-rw-r--r-- | src/mongo/shell/shell_utils.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mongo/shell/shell_utils.cpp b/src/mongo/shell/shell_utils.cpp index a4895af7bdf..f6dba857250 100644 --- a/src/mongo/shell/shell_utils.cpp +++ b/src/mongo/shell/shell_utils.cpp @@ -316,9 +316,12 @@ namespace mongo { } const set<string>& uris = i->second; - - BSONObj inprog = conn->findOne( "admin.$cmd.sys.inprog", Query() )[ "inprog" ] - .embeddedObject().getOwned(); + + BSONObj currentOpRes; + conn->runPseudoCommand("admin", + "currentOp", + "$cmd.sys.inprog", {}, currentOpRes); + auto inprog = currentOpRes["inprog"].embeddedObject(); BSONForEach( op, inprog ) { if ( uris.count( op[ "client" ].String() ) ) { if ( !withPrompt || prompter.confirm() ) { |