summaryrefslogtreecommitdiff
path: root/src/mongo/db/ops/update_request.h
diff options
context:
space:
mode:
authorBernard Gorman <bernard.gorman@gmail.com>2019-05-09 20:03:43 +0100
committerBernard Gorman <bernard.gorman@gmail.com>2019-05-17 16:22:28 +0100
commitc7f86d2fce5ad0145b57007f83584cf96d02d9d4 (patch)
treeae865183a5c1094c2aafbe65df9985ba8534181a /src/mongo/db/ops/update_request.h
parent99585f23be46f97d2e8a962d00fef6ca6758390c (diff)
downloadmongo-c7f86d2fce5ad0145b57007f83584cf96d02d9d4.tar.gz
SERVER-40406 Add support for $$NOW and $$CLUSTER_TIME in the update command
Diffstat (limited to 'src/mongo/db/ops/update_request.h')
-rw-r--r--src/mongo/db/ops/update_request.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mongo/db/ops/update_request.h b/src/mongo/db/ops/update_request.h
index 587fdb1b718..2e84c575f11 100644
--- a/src/mongo/db/ops/update_request.h
+++ b/src/mongo/db/ops/update_request.h
@@ -34,6 +34,7 @@
#include "mongo/db/logical_session_id.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/ops/write_ops_parsers.h"
+#include "mongo/db/pipeline/runtime_constants_gen.h"
#include "mongo/db/query/explain.h"
#include "mongo/util/str.h"
@@ -110,6 +111,14 @@ public:
return _updateMod;
}
+ inline void setRuntimeConstants(const RuntimeConstants& runtimeConstants) {
+ _runtimeConstants = runtimeConstants;
+ }
+
+ inline const boost::optional<RuntimeConstants>& getRuntimeConstants() const {
+ return _runtimeConstants;
+ }
+
inline void setArrayFilters(const std::vector<BSONObj>& arrayFilters) {
_arrayFilters = arrayFilters;
}
@@ -210,6 +219,10 @@ public:
builder << " updateModification: " << _updateMod.toString();
builder << " stmtId: " << _stmtId;
+ if (_runtimeConstants) {
+ builder << "runtimeConstants: " << _runtimeConstants->toBSON().toString();
+ }
+
builder << " arrayFilters: [";
bool first = true;
for (auto arrayFilter : _arrayFilters) {
@@ -248,6 +261,9 @@ private:
// Contains the modifiers to apply to matched objects, or a replacement document.
write_ops::UpdateModification _updateMod;
+ // Contains any constant values which may be required by the query or update operation.
+ boost::optional<RuntimeConstants> _runtimeConstants;
+
// Filters to specify which array elements should be updated.
std::vector<BSONObj> _arrayFilters;