@Nullable
    private static IndexModel parseIndex(
            @Nullable String parentFieldName,
            Field field,
            @Nullable Indexed indexed) {
        if (indexed == null) {
            return null;
        }
        IndexType indexType = indexed.value();
        BsonValue index = indexType.equals(IndexType.RANGE)
                ? BsonPool.BSON_INT32_1
                : BsonPool.BSON_STRING_HASHED;
        IndexOptions options = new IndexOptions();
        options.unique(indexed.unique());
        long expireAfterSeconds = indexed.expireAfterSeconds();
        if (expireAfterSeconds > 0) {
            options.expireAfter(expireAfterSeconds, TimeUnit.SECONDS);
        }
        String partialFilter = indexed.partialFilter();
        if (StringUtils.hasText(partialFilter)) {
            options.partialFilterExpression(BsonDocument.parse(partialFilter));
        }
        String fieldName = parseFieldName(field);
        String name = parentFieldName == null
                ? fieldName
                : parentFieldName
                        + "."
                        + fieldName;
        return new IndexModel(new BsonDocument(name, index), options);
    }
@return The index of the current field without its nested fields
turms-server-common/src/main/java/im/turms/server/common/storage/mongo/entity/MongoEntityFactory.java