diff options
author | Zach Yam <zach.yam@mongodb.com> | 2019-07-09 16:12:10 -0400 |
---|---|---|
committer | Zach Yam <zach.yam@mongodb.com> | 2019-08-15 12:56:05 -0400 |
commit | 5bdcbdb7dd33f47d809dc238cd5dfee1d91b0e09 (patch) | |
tree | ba58f0b3113f879b85129e4ebe4050932f21645a /src/mongo/db/storage/sorted_data_interface.h | |
parent | 78038f8cc304cd88a8d5b029fb8f4174f62e0491 (diff) | |
download | mongo-5bdcbdb7dd33f47d809dc238cd5dfee1d91b0e09.tar.gz |
SERVER-41720 Overload SortedDataInterface::Cursor::seek and seekExact to accept KeyStrings
Diffstat (limited to 'src/mongo/db/storage/sorted_data_interface.h')
-rw-r--r-- | src/mongo/db/storage/sorted_data_interface.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mongo/db/storage/sorted_data_interface.h b/src/mongo/db/storage/sorted_data_interface.h index 1f0408d688a..ceed0466b3c 100644 --- a/src/mongo/db/storage/sorted_data_interface.h +++ b/src/mongo/db/storage/sorted_data_interface.h @@ -320,18 +320,17 @@ public: virtual boost::optional<IndexKeyEntry> seek(const IndexSeekPoint& seekPoint, RequestedInfo parts = kKeyAndLoc) = 0; + virtual boost::optional<KeyStringEntry> seek(const KeyString::Value& keyString, + bool inclusive) = 0; /** * Seeks to a key with a hint to the implementation that you only want exact matches. If * an exact match can't be found, boost::none will be returned and the resulting * position of the cursor is unspecified. */ virtual boost::optional<IndexKeyEntry> seekExact(const BSONObj& key, - RequestedInfo parts = kKeyAndLoc) { - auto kv = seek(key, true, kKeyAndLoc); - if (kv && kv->key.woCompare(key, BSONObj(), /*considerFieldNames*/ false) == 0) - return kv; - return {}; - } + RequestedInfo parts = kKeyAndLoc) = 0; + + virtual boost::optional<KeyStringEntry> seekExact(const KeyString::Value& keyString) = 0; // // Saving and restoring state |