Package org.vertx.java.core.json

Examples of org.vertx.java.core.json.JsonObject.removeField()


  }

  private JsonObject getResultFromReply(Message<JsonObject> reply) {
    JsonObject body = reply.body();
    JsonObject world = body.getObject("result");
    Object id = world.removeField("_id");
    world.putValue("id", id);
    return world;
  }

  private void handleQueriesMongo(final HttpServerRequest req) {
View Full Code Here


            final JsonObject json = request.body();
            if (json != null) {
                String method = json.getString(key);
                if (method != null) {
                    json.removeField(key);
                    request.setMethod(method);
                    next.handle(null);
                    return;
                }
            }
View Full Code Here

                        next.handle(null);
                        return;
                    }

                    // clean mongodb specific fields
                    value.removeField("_id");
                    value.removeField("updatedAt");

                    next.handle(value);
                } else {
                    next.handle(null);
View Full Code Here

                        return;
                    }

                    // clean mongodb specific fields
                    value.removeField("_id");
                    value.removeField("updatedAt");

                    next.handle(value);
                } else {
                    next.handle(null);
                }
View Full Code Here

                        JsonArray itResult = reply.body().getArray("results");
                        for (Object o : itResult) {
                            JsonObject json = (JsonObject) o;

                            // clean mongodb specific fields
                            json.removeField("_id");
                            json.removeField("updatedAt");

                            result.add(json);
                        }
                        next.handle(result);
View Full Code Here

                        for (Object o : itResult) {
                            JsonObject json = (JsonObject) o;

                            // clean mongodb specific fields
                            json.removeField("_id");
                            json.removeField("updatedAt");

                            result.add(json);
                        }
                        next.handle(result);
                        return;
View Full Code Here

                        JsonArray itResult = reply.body().getArray("results");
                        for (Object o : itResult) {
                            JsonObject json = (JsonObject) o;

                            // clean mongodb specific fields
                            json.removeField("_id");
                            json.removeField("updatedAt");

                            result.add(json);
                        }
                        // reply asking for more
View Full Code Here

                        for (Object o : itResult) {
                            JsonObject json = (JsonObject) o;

                            // clean mongodb specific fields
                            json.removeField("_id");
                            json.removeField("updatedAt");

                            result.add(json);
                        }
                        // reply asking for more
                        reply.reply(this);
View Full Code Here

              return;
            }
            JsonArray ops = ar.result().body().getObject("hits").getArray("hits");
            for (Object op : ops) {
              JsonObject opData = (JsonObject) op;
              opData.putArray(Key.OP, new JsonArray((List<Object>) opData.removeField(_OP)));
            }
            result.setResult(ops);
          }
        });
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  private JsonObject castToSnapshotData(JsonObject body) {
    JsonObject source = body.getObject("_source");
    return !body.getBoolean("found") ? null :
        new JsonObject().putNumber(Key.VERSION, body.getLong("_version"))
        .putArray("snapshot", new JsonArray((List<Object>) source.removeField(_SNAPSHOT)))
        .putObject(DeltaStorage.ROOT, source);
  }

  private void handleVoidCallback(final AsyncResultHandler<Void> callback,
      AsyncResult<Message<JsonObject>> ar) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.