Search in sources :

Example 1 with MutateLimitPath

use of com.couchbase.client.java.query.dsl.path.MutateLimitPath in project jnosql-diana-driver by eclipse.

the class QueryConverter method delete.

static QueryConverterResult delete(DocumentDeleteQuery query, String bucket) {
    JsonObject params = JsonObject.create();
    List<String> ids = new ArrayList<>();
    Expression condition = getCondition(query.getCondition().orElseThrow(() -> new IllegalArgumentException("Condigtion is required")), params, ids, query.getDocumentCollection());
    MutateLimitPath statement = null;
    if (nonNull(condition)) {
        statement = Delete.deleteFrom(bucket).where(condition);
    }
    return new QueryConverterResult(params, statement, ids);
}
Also used : MutateLimitPath(com.couchbase.client.java.query.dsl.path.MutateLimitPath) Expression(com.couchbase.client.java.query.dsl.Expression) ArrayList(java.util.ArrayList) JsonObject(com.couchbase.client.java.document.json.JsonObject)

Aggregations

JsonObject (com.couchbase.client.java.document.json.JsonObject)1 Expression (com.couchbase.client.java.query.dsl.Expression)1 MutateLimitPath (com.couchbase.client.java.query.dsl.path.MutateLimitPath)1 ArrayList (java.util.ArrayList)1