use of com.torodb.mongodb.commands.pojos.index.type.UnknownIndexType in project torodb by torodb.
the class IndexOptions method unmarshllKeys.
public static List<Key> unmarshllKeys(BsonDocument keyDoc) {
List<Key> keys = new ArrayList<>(keyDoc.size());
for (Entry<?> entry : keyDoc) {
List<String> key = PATH_SPLITER.splitToList(entry.getKey());
IndexType value = null;
for (KnownType knownType : KnownType.values()) {
if (knownType.getIndexType().equalsToBsonValue(entry.getValue())) {
value = knownType.getIndexType();
break;
}
}
if (value == null) {
value = new UnknownIndexType(entry.getValue());
}
keys.add(new Key(key, value));
}
return keys;
}
Aggregations