@Override
    public <T> Mono<UpdateResult> upsert(Class<T> clazz, Filter filter, Update update) {
        MongoCollection<T> collection = context.getCollection(clazz);
        Publisher<UpdateResult> source =
                collection.updateOne(filter, update, DEFAULT_UPSERT_OPTIONS);
        return Mono.from(source)
                .onErrorMap(MongoExceptionUtil::translate);
    }
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