diff options
author | Charlie Swanson <charlie.swanson@mongodb.com> | 2018-05-21 15:17:53 -0400 |
---|---|---|
committer | Charlie Swanson <charlie.swanson@mongodb.com> | 2018-06-20 16:31:13 -0400 |
commit | 1a18c8f8aec34b43553fe4d7961350d1a7a6ada4 (patch) | |
tree | 7af83bd3fb0599bf2fdfb2b992e11987fa31882e /src/mongo/db/query/index_entry.cpp | |
parent | a2ee109e64923e0e569fa8adb0dbc67488a77983 (diff) | |
download | mongo-1a18c8f8aec34b43553fe4d7961350d1a7a6ada4.tar.gz |
SERVER-27646 Build index bounds for {$ne: null} predicates
Diffstat (limited to 'src/mongo/db/query/index_entry.cpp')
-rw-r--r-- | src/mongo/db/query/index_entry.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mongo/db/query/index_entry.cpp b/src/mongo/db/query/index_entry.cpp index 13153465387..49898846d45 100644 --- a/src/mongo/db/query/index_entry.cpp +++ b/src/mongo/db/query/index_entry.cpp @@ -63,4 +63,21 @@ std::string IndexEntry::toString() const { return sb.str(); } +bool IndexEntry::pathHasMultikeyComponent(StringData indexedField) const { + if (multikeyPaths.empty()) { + // The index has no path-level multikeyness metadata. + return multikey; + } + + size_t pos = 0; + for (auto&& key : keyPattern) { + if (key.fieldNameStringData() == indexedField) { + return !multikeyPaths[pos].empty(); + } + ++pos; + } + + MONGO_UNREACHABLE; +} + } // namespace mongo |