Search in sources :

Example 1 with ViewOptions

use of com.couchbase.client.java.view.ViewOptions in project couchbase-jvm-clients by couchbase.

the class ReactiveBucket method viewQuery.

public Mono<ReactiveViewResult> viewQuery(final String designDoc, final String viewName, final ViewOptions options) {
    return Mono.defer(() -> {
        notNull(options, "ViewOptions", () -> new ReducedViewErrorContext(designDoc, viewName, name()));
        ViewOptions.Built opts = options.build();
        JsonSerializer serializer = opts.serializer() == null ? environment().jsonSerializer() : opts.serializer();
        return ViewAccessor.viewQueryReactive(asyncBucket.core(), asyncBucket.viewRequest(designDoc, viewName, opts), serializer);
    });
}
Also used : ViewOptions(com.couchbase.client.java.view.ViewOptions) ReducedViewErrorContext(com.couchbase.client.core.error.context.ReducedViewErrorContext) JsonSerializer(com.couchbase.client.java.codec.JsonSerializer)

Example 2 with ViewOptions

use of com.couchbase.client.java.view.ViewOptions in project couchbase-jvm-clients by couchbase.

the class AsyncBucket method viewQuery.

public CompletableFuture<ViewResult> viewQuery(final String designDoc, final String viewName, final ViewOptions options) {
    notNull(options, "ViewOptions", () -> new ReducedViewErrorContext(designDoc, viewName, name));
    ViewOptions.Built opts = options.build();
    JsonSerializer serializer = opts.serializer() == null ? environment.jsonSerializer() : opts.serializer();
    return ViewAccessor.viewQueryAsync(core, viewRequest(designDoc, viewName, opts), serializer);
}
Also used : ViewOptions(com.couchbase.client.java.view.ViewOptions) ReducedViewErrorContext(com.couchbase.client.core.error.context.ReducedViewErrorContext) JsonSerializer(com.couchbase.client.java.codec.JsonSerializer)

Aggregations

ReducedViewErrorContext (com.couchbase.client.core.error.context.ReducedViewErrorContext)2 JsonSerializer (com.couchbase.client.java.codec.JsonSerializer)2 ViewOptions (com.couchbase.client.java.view.ViewOptions)2