diff options
author | Yuhong Zhang <danielzhangyh@gmail.com> | 2021-09-29 22:26:32 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-09-29 22:56:26 +0000 |
commit | 7591af2652cd1d00f9255033dc5ec3c3d82deca3 (patch) | |
tree | 3e11f2a45e09155beca9ad66bbce522c49623b36 /src/mongo/db/update/storage_validation.cpp | |
parent | a6810aa4a19bc5c0330494778e73e6c7cbcc21f8 (diff) | |
download | mongo-7591af2652cd1d00f9255033dc5ec3c3d82deca3.tar.gz |
SERVER-60156 Add a way to bypass storageValid() for time-series updates
Diffstat (limited to 'src/mongo/db/update/storage_validation.cpp')
-rw-r--r-- | src/mongo/db/update/storage_validation.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/db/update/storage_validation.cpp b/src/mongo/db/update/storage_validation.cpp index 3e04bf45f35..d94c645a588 100644 --- a/src/mongo/db/update/storage_validation.cpp +++ b/src/mongo/db/update/storage_validation.cpp @@ -44,7 +44,7 @@ namespace { const StringData idFieldName = "_id"_sd; -void storageValidChildren(mutablebson::ConstElement elem, +void scanDocumentChildren(mutablebson::ConstElement elem, const bool deep, std::uint32_t recursionLevel, const bool allowTopLevelDollarPrefixes, @@ -56,7 +56,7 @@ void storageValidChildren(mutablebson::ConstElement elem, auto curr = elem.leftChild(); while (curr.ok()) { - storageValid(curr, + scanDocument(curr, deep, recursionLevel + 1, allowTopLevelDollarPrefixes, @@ -153,7 +153,7 @@ Status storageValidIdField(const mongo::BSONElement& element) { return Status::OK(); } -void storageValid(const mutablebson::Document& doc, +void scanDocument(const mutablebson::Document& doc, const bool allowTopLevelDollarPrefixes, const bool shouldValidate, bool* containsDotsAndDollarsField) { @@ -166,7 +166,7 @@ void storageValid(const mutablebson::Document& doc, // Validate this child element. const auto deep = true; const uint32_t recursionLevel = 1; - storageValid(currElem, + scanDocument(currElem, deep, recursionLevel, allowTopLevelDollarPrefixes, @@ -177,7 +177,7 @@ void storageValid(const mutablebson::Document& doc, } } -void storageValid(mutablebson::ConstElement elem, +void scanDocument(mutablebson::ConstElement elem, const bool deep, std::uint32_t recursionLevel, const bool allowTopLevelDollarPrefixes, @@ -223,7 +223,7 @@ void storageValid(mutablebson::ConstElement elem, if (deep) { // Check children if there are any. - storageValidChildren(elem, + scanDocumentChildren(elem, deep, recursionLevel, allowTopLevelDollarPrefixes, |