Details
Description
There are a number of places where we traverse an index by seeking to kMinBSONKey:
for (auto entry = cursor->seek(kMinBSONKey, true); entry; i++, entry = cursor->next()) |
This is correct only for non-compound indexes and may confuse future readers who may want to use it for traversing a generic index. Whenever possible, we should seek to BSONObj() instead of kMinBSONKey; this will seek to the leftmost document in the index, regardless of the index type.