| 713 | } |
| 714 | |
| 715 | Optional<Reference<IndexInfo>> UnboundCollectionContext::getCompoundIndex(std::vector<std::string> const& prefix, |
| 716 | std::string nextIndexKey) { |
| 717 | if (bannedFieldNames.find(nextIndexKey) != bannedFieldNames.end()) |
| 718 | return Optional<Reference<IndexInfo>>(); |
| 719 | auto indexV = simpleIndexMap.find(prefix[0]); |
| 720 | ASSERT(indexV != simpleIndexMap.end()); |
| 721 | for (const Reference<IndexInfo>& index : indexV->second) { |
| 722 | if (index->size() > prefix.size() && index->hasPrefix(prefix)) { |
| 723 | if (index->indexKeys[prefix.size()].first == nextIndexKey) { |
| 724 | return index; |
| 725 | } |
| 726 | } |
| 727 | } |
| 728 | return Optional<Reference<IndexInfo>>(); |
| 729 | } |
| 730 | |
| 731 | Key UnboundCollectionContext::getVersionKey() { |
| 732 | return metadataDirectory->key().withSuffix( |