@Override
    public <T> Mono<Void> insertAllOfSameType(List<T> values) {
        if (values.isEmpty()) {
            return Mono.empty();
        }
        MongoCollection collection = context.getCollection(values.getFirst()
                .getClass());
        Publisher<InsertManyResult> source =
                collection.insertMany(values, DEFAULT_INSERT_MANY_OPTIONS);
        return Mono.from(source)
                .onErrorMap(MongoExceptionUtil::translate)
                .then();
    }
apply the shard key to the filter so that mongos know to which MongoDB the command needs to
be sent for better performance
turms-server-common/src/main/java/im/turms/server/common/storage/mongo/operation/TurmsMongoOperations.java