diff options
Diffstat (limited to 'src/mongo/db/update/current_date_node.h')
-rw-r--r-- | src/mongo/db/update/current_date_node.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mongo/db/update/current_date_node.h b/src/mongo/db/update/current_date_node.h index e35402da37b..bac2eb5c857 100644 --- a/src/mongo/db/update/current_date_node.h +++ b/src/mongo/db/update/current_date_node.h @@ -28,7 +28,7 @@ #pragma once -#include "mongo/db/update/path_creating_node.h" +#include "mongo/db/update/modifier_node.h" #include "mongo/stdx/memory.h" namespace mongo { @@ -36,7 +36,7 @@ namespace mongo { /** * Represents the application of a $currentDate to the value at the end of a path. */ -class CurrentDateNode : public PathCreatingNode { +class CurrentDateNode : public ModifierNode { public: Status init(BSONElement modExpr, const CollatorInterface* collator) final; @@ -47,11 +47,14 @@ public: void setCollator(const CollatorInterface* collator) final {} protected: - UpdateExistingElementResult updateExistingElement(mutablebson::Element* element, - std::shared_ptr<FieldRef> elementPath, - LogBuilder* logBuilder) const final; + ModifyResult updateExistingElement(mutablebson::Element* element, + std::shared_ptr<FieldRef> elementPath) const final; void setValueForNewElement(mutablebson::Element* element) const final; + bool allowCreation() const final { + return true; + } + private: // If true, the current date should be expressed as a Date. If false, a Timestamp. bool _typeIsDate; |