@Override
    public Mono<Void> updateJsonSchema(
            Class<?> clazz,
            BsonDocument jsonSchema,
            ValidationAction action,
            ValidationLevel level) {
        String collectionName = context.getEntity(clazz)
                .collectionName();
        Publisher<BsonDocument> publisher = context.getDatabase()
                .runCommand(
                        new BsonDocument("collMod", new BsonString(collectionName))
                                .append("validator", jsonSchema)
                                .append("validationAction", new BsonString(action.getValue()))
                                .append("validationLevel", new BsonString(level.getValue())),
                        BsonDocument.class);
        return Mono.from(publisher)
                .flatMap(document -> {
                    int ok = document.get("ok")
                            .asNumber()
                            .intValue();
                    return 1 == ok
                            ? Mono.empty()
                            : Mono.error(new RuntimeException(
                                    "Failed to update the JSON schema of the collection \""
                                            + collectionName
                                            + "\""));
                });
    }
@implNote Send requests to ensure indexes and shard collections synchronously to avoid mongo
          servers throwing "LockBusy" error (error code 46)
turms-server-common/src/main/java/im/turms/server/common/storage/mongo/operation/TurmsMongoOperations.java