mongo.removeOne("users", new JsonObject().put("_id", ctx.request().getParam("id")), lookup -> {
/** * Remove a single matching document from a collection * @param collection the collection * @param query query used to match document * @param resultHandler will be called when complete * @return */ @Deprecated() public io.vertx.rxjava.ext.mongo.MongoClient removeOne(String collection, JsonObject query, Handler<AsyncResult<Void>> resultHandler) { delegate.removeOne(collection, query, resultHandler); return this; }
/** * Remove a single matching document from a collection * @param collection the collection * @param query query used to match document * @param resultHandler will be called when complete * @return */ @Deprecated() public io.vertx.rxjava.ext.mongo.MongoClient removeOne(String collection, JsonObject query, Handler<AsyncResult<Void>> resultHandler) { delegate.removeOne(collection, query, resultHandler); return this; }
@Deprecated @Override public MongoService removeOne(String collection, JsonObject query, Handler<AsyncResult<Void>> resultHandler) { client.removeOne(collection, query, resultHandler); return this; }
public static io.vertx.ext.mongo.MongoClient removeOne(io.vertx.ext.mongo.MongoClient j_receiver, java.lang.String collection, java.util.Map<String, Object> query, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler) { io.vertx.core.impl.ConversionHelper.fromObject(j_receiver.removeOne(collection, query != null ? io.vertx.core.impl.ConversionHelper.toJsonObject(query) : null, resultHandler != null ? new io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>() { public void handle(io.vertx.core.AsyncResult<java.lang.Void> ar) { resultHandler.handle(ar.map(event -> io.vertx.core.impl.ConversionHelper.fromObject(event))); } } : null)); return j_receiver; } public static io.vertx.ext.mongo.MongoClient removeDocument(io.vertx.ext.mongo.MongoClient j_receiver, java.lang.String collection, java.util.Map<String, Object> query, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<String, Object>>> resultHandler) {
private void deleteOne(RoutingContext routingContext) { String id = routingContext.request().getParam("id"); if (id == null) { routingContext.response().setStatusCode(400).end(); } else { mongo.removeOne(COLLECTION, new JsonObject().put("_id", id), ar -> routingContext.response().setStatusCode(204).end()); } }