summaryrefslogtreecommitdiff
path: root/db/commands.h
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-02-12 13:04:20 -0500
committerEliot Horowitz <eliot@10gen.com>2010-02-12 13:04:20 -0500
commitee3b7145e3f723391cdcacae3c079414bd3056d0 (patch)
tree0c4c1285e494917dd326ca86cf21b7a510a767fc /db/commands.h
parentbf8d571e5efaba76a9a3a1d24e3efcb8846c5001 (diff)
downloadmongo-ee3b7145e3f723391cdcacae3c079414bd3056d0.tar.gz
refactoring command execution
Diffstat (limited to 'db/commands.h')
-rw-r--r--db/commands.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/db/commands.h b/db/commands.h
index 20fb98c98e2..8b38611e57b 100644
--- a/db/commands.h
+++ b/db/commands.h
@@ -25,7 +25,8 @@ namespace mongo {
class BSONObj;
class BSONObjBuilder;
class BufBuilder;
-
+ class Client;
+
// db "commands" (sent via db.$cmd.findOne(...))
// subclass to make a command.
class Command {
@@ -92,6 +93,18 @@ namespace mongo {
Command(const char *_name);
virtual ~Command() {}
+ /**
+ * this handles
+ - auth
+ - locking
+ - context
+ then calls run()
+ */
+ bool exec( Client& client , int queryOptions ,
+ const char *ns, BSONObj& cmdObj,
+ BSONObjBuilder& result,
+ bool fromRepl);
+
protected:
BSONObj getQuery( const BSONObj& cmdObj ){
if ( cmdObj["query"].type() == Object )