summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/get_executor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/query/get_executor.h')
-rw-r--r--src/mongo/db/query/get_executor.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/mongo/db/query/get_executor.h b/src/mongo/db/query/get_executor.h
index 3e8cb781bd0..cb49007260f 100644
--- a/src/mongo/db/query/get_executor.h
+++ b/src/mongo/db/query/get_executor.h
@@ -31,10 +31,13 @@
#include "mongo/db/query/query_planner_params.h"
#include "mongo/db/query/query_settings.h"
#include "mongo/db/query/query_solution.h"
+#include "mongo/db/ops/update_driver.h"
+#include "mongo/db/ops/update_request.h"
namespace mongo {
class Collection;
+ class Database;
/**
* Filter indexes retrieved from index catalog by
@@ -121,6 +124,10 @@ namespace mongo {
const BSONObj& hintObj,
PlanExecutor** execOut);
+ //
+ // Delete
+ //
+
/**
* Get a PlanExecutor for a delete operation. 'rawCanonicalQuery' describes the predicate for
* the documents to be deleted. A write lock is required to execute the returned plan.
@@ -156,4 +163,46 @@ namespace mongo {
bool shouldCallLogOp,
PlanExecutor** execOut);
+ //
+ // Update
+ //
+
+ /**
+ * Get a PlanExecutor for an update operation. 'rawCanonicalQuery' describes the predicate for
+ * the documents to be deleted. A write lock is required to execute the returned plan.
+ *
+ * Takes ownership of 'rawCanonicalQuery'. Does not take ownership of other args.
+ *
+ * If the query is valid and an executor could be created, returns Status::OK() and populates
+ * *out with the PlanExecutor.
+ *
+ * If the query cannot be executed, returns a Status indicating why.
+ */
+ Status getExecutorUpdate(OperationContext* txn,
+ Database* db,
+ CanonicalQuery* rawCanonicalQuery,
+ const UpdateRequest* request,
+ UpdateDriver* driver,
+ OpDebug* opDebug,
+ PlanExecutor** execOut);
+
+ /**
+ * Overload of getExecutorUpdate() above, for when a canonicalQuery is not available. Used to
+ * support idhack-powered updates.
+ *
+ * If the query is valid and an executor could be created, returns Status::OK() and populates
+ * *out with the PlanExecutor.
+ *
+ * Does not take ownership of its arguments.
+ *
+ * If the query cannot be executed, returns a Status indicating why.
+ */
+ Status getExecutorUpdate(OperationContext* txn,
+ Database* db,
+ const std::string& ns,
+ const UpdateRequest* request,
+ UpdateDriver* driver,
+ OpDebug* opDebug,
+ PlanExecutor** execOut);
+
} // namespace mongo