summaryrefslogtreecommitdiff
path: root/src/mongo/db/ops/update.h
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@10gen.com>2014-02-14 10:53:51 -0500
committerAndy Schwerin <schwerin@10gen.com>2014-02-14 18:03:18 -0500
commitf3bbd9daf3f36b4fee3e577dcea9aa0d1aef8b11 (patch)
tree4ee027cdb64f375387d7dec941c00532b11a0ff6 /src/mongo/db/ops/update.h
parentd7e88f5d08e3a872f7bfb223d1f695235f01909a (diff)
downloadmongo-f3bbd9daf3f36b4fee3e577dcea9aa0d1aef8b11.tar.gz
SERVER-12380 Refactor update() and receivedUpdate() for better reuse.
This patch introduces an UpdateExecutor type, that encapsulates the work of performing a database update, described by the existing UpdateRequest type. This includes any necessary parsing and also driving execution of the match query and the update transformations. The UpdateExecutor interface makes it convenient for users to prepare the operation to the greatest extent possible in an unlocked context, without having to know the details of what that preparation entails.
Diffstat (limited to 'src/mongo/db/ops/update.h')
-rw-r--r--src/mongo/db/ops/update.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mongo/db/ops/update.h b/src/mongo/db/ops/update.h
index 79970ab49cc..34d290cfe85 100644
--- a/src/mongo/db/ops/update.h
+++ b/src/mongo/db/ops/update.h
@@ -40,8 +40,21 @@ namespace mongo {
class CanonicalQuery;
class UpdateDriver;
+ /**
+ * Utility method to execute an update described by "request".
+ *
+ * Caller must hold the appropriate database locks.
+ */
UpdateResult update(const UpdateRequest& request, OpDebug* opDebug);
+ /**
+ * Execute the update described by "request", using the given already-parsed
+ * driver and canonical query.
+ *
+ * NOTE: This function is really a utility method for UpdateExecutor.
+ *
+ * TODO: Move this into a private method of UpdateExecutor.
+ */
UpdateResult update(const UpdateRequest& request,
OpDebug* opDebug,
UpdateDriver* driver,