/** * Run an arbitrary MongoDB command. * @param commandName the name of the command * @param command the command * @param resultHandler will be called with the result. * @return */ public io.vertx.rxjava.ext.mongo.MongoClient runCommand(String commandName, JsonObject command, Handler<AsyncResult<JsonObject>> resultHandler) { delegate.runCommand(commandName, command, resultHandler); return this; }
@Override public MongoService runCommand(String commandName, JsonObject command, Handler<AsyncResult<JsonObject>> resultHandler) { client.runCommand(commandName, command, resultHandler); return this; }
/** * Run an arbitrary MongoDB command. * @param commandName the name of the command * @param command the command * @param resultHandler will be called with the result. * @return */ public io.vertx.rxjava.ext.mongo.MongoClient runCommand(String commandName, JsonObject command, Handler<AsyncResult<JsonObject>> resultHandler) { delegate.runCommand(commandName, command, resultHandler); return this; }
public static io.vertx.ext.mongo.MongoClient runCommand(io.vertx.ext.mongo.MongoClient j_receiver, java.lang.String commandName, java.util.Map<String, Object> command, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<String, Object>>> resultHandler) { io.vertx.core.impl.ConversionHelper.fromObject(j_receiver.runCommand(commandName, command != null ? io.vertx.core.impl.ConversionHelper.toJsonObject(command) : null, resultHandler != null ? new io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.json.JsonObject>>() { public void handle(io.vertx.core.AsyncResult<io.vertx.core.json.JsonObject> ar) { resultHandler.handle(ar.map(event -> io.vertx.core.impl.ConversionHelper.fromJsonObject(event))); } } : null)); return j_receiver; } public static io.vertx.ext.mongo.MongoClient distinct(io.vertx.ext.mongo.MongoClient j_receiver, java.lang.String collection, java.lang.String fieldName, java.lang.String resultClassname, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<Object>>> resultHandler) {
private void generateKey(String key, Message<?> message) { JsonObject execComnand = createSequenceCommand(key); mongoClient.runCommand("findAndModify", execComnand, ur -> { if (ur.failed()) { LOGGER.error("", ur.cause()); message.fail(-1, ur.cause().toString()); } else { LOGGER.info(ur.result()); JsonObject resJo = ur.result(); JsonObject value = resJo.getJsonObject("value"); long seq = value.getLong(key); message.reply(seq); } }); }