From c60c435ffd0bece5000d66cd5ada876717c89827 Mon Sep 17 00:00:00 2001 From: Nick Zolnierz Date: Fri, 2 Nov 2018 09:34:19 -0400 Subject: SERVER-31012: expose optional way of retrieving FieldRef's for fields that were modified by an update --- src/mongo/db/field_ref.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/mongo/db/field_ref.h') 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 #include -#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 -- cgit v1.2.1