diff options
author | Nick Zolnierz <nicholas.zolnierz@mongodb.com> | 2018-11-02 09:34:19 -0400 |
---|---|---|
committer | Nick Zolnierz <nicholas.zolnierz@mongodb.com> | 2018-11-30 12:18:35 -0500 |
commit | c60c435ffd0bece5000d66cd5ada876717c89827 (patch) | |
tree | 8c081eff780ed6d56ff39731a626b7d65da9b03a /src/mongo/db/field_ref.h | |
parent | f3acfdec219b7a9122b4954a269c89e3604416d2 (diff) | |
download | mongo-c60c435ffd0bece5000d66cd5ada876717c89827.tar.gz |
SERVER-31012: expose optional way of retrieving FieldRef's for fields that were modified by an update
Diffstat (limited to 'src/mongo/db/field_ref.h')
-rw-r--r-- | src/mongo/db/field_ref.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mongo/db/field_ref.h b/src/mongo/db/field_ref.h index 51591b63d96..4ae903d35d2 100644 --- a/src/mongo/db/field_ref.h +++ b/src/mongo/db/field_ref.h @@ -36,7 +36,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" namespace mongo { @@ -275,6 +274,14 @@ inline bool operator>=(const FieldRef& lhs, const FieldRef& rhs) { return lhs.compare(rhs) >= 0; } +inline FieldRef operator+(const FieldRef& lhs, const FieldRef& rhs) { + FieldRef result = lhs; + for (size_t i = 0; i < rhs.numParts(); ++i) { + result.appendPart(rhs.getPart(i)); + } + return result; +} + std::ostream& operator<<(std::ostream& stream, const FieldRef& value); } // namespace mongo |