use of com.couchbase.client.java.codec.JsonSerializer in project couchbase-jvm-clients by couchbase.
the class ReactiveScope method query.
/**
* Performs a N1QL query with custom {@link QueryOptions} in a Scope
*
* @param statement the N1QL query statement as a raw string.
* @param options the custom options for this query.
* @return the {@link ReactiveQueryResult} once the response arrives successfully.
*/
public Mono<ReactiveQueryResult> query(final String statement, final QueryOptions options) {
notNull(options, "QueryOptions", () -> new ReducedQueryErrorContext(statement));
final QueryOptions.Built opts = options.build();
JsonSerializer serializer = opts.serializer() == null ? environment().jsonSerializer() : opts.serializer();
return Mono.defer(() -> {
return async().queryAccessor().queryReactive(async().queryRequest(bucketName(), name(), statement, opts, core(), environment()), opts, serializer);
});
}
use of com.couchbase.client.java.codec.JsonSerializer 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);
});
}
use of com.couchbase.client.java.codec.JsonSerializer in project couchbase-jvm-clients by couchbase.
the class ReactiveCluster method query.
/**
* Performs a N1QL query with custom {@link QueryOptions}.
*
* @param statement the N1QL query statement as a raw string.
* @param options the custom options for this query.
* @return the {@link ReactiveQueryResult} once the response arrives successfully.
*/
public Mono<ReactiveQueryResult> query(final String statement, final QueryOptions options) {
notNull(options, "QueryOptions", () -> new ReducedQueryErrorContext(statement));
final QueryOptions.Built opts = options.build();
JsonSerializer serializer = opts.serializer() == null ? environment().jsonSerializer() : opts.serializer();
return Mono.defer(() -> {
return asyncCluster.queryAccessor().queryReactive(asyncCluster.queryRequest(statement, opts), opts, serializer);
});
}
use of com.couchbase.client.java.codec.JsonSerializer in project couchbase-jvm-clients by couchbase.
the class ReactiveCluster method analyticsQuery.
/**
* Performs an Analytics query with custom {@link AnalyticsOptions}.
*
* @param statement the Analytics query statement as a raw string.
* @param options the custom options for this analytics query.
* @return the {@link ReactiveAnalyticsResult} once the response arrives successfully.
*/
public Mono<ReactiveAnalyticsResult> analyticsQuery(final String statement, final AnalyticsOptions options) {
notNull(options, "AnalyticsOptions", () -> new ReducedAnalyticsErrorContext(statement));
AnalyticsOptions.Built opts = options.build();
JsonSerializer serializer = opts.serializer() == null ? environment().jsonSerializer() : opts.serializer();
return Mono.defer(() -> {
return AnalyticsAccessor.analyticsQueryReactive(asyncCluster.core(), asyncCluster.analyticsRequest(statement, opts), serializer);
});
}
use of com.couchbase.client.java.codec.JsonSerializer in project couchbase-jvm-clients by couchbase.
the class AsyncCollection method lookupIn.
/**
* Performs lookups to document fragments with custom options.
*
* @param id the outer document ID.
* @param specs the spec which specifies the type of lookups to perform.
* @param options custom options to modify the lookup options.
* @return the {@link LookupInResult} once the lookup has been performed or failed.
*/
public CompletableFuture<LookupInResult> lookupIn(final String id, final List<LookupInSpec> specs, final LookupInOptions options) {
notNull(options, "LookupInOptions", () -> ReducedKeyValueErrorContext.create(id, collectionIdentifier));
LookupInOptions.Built opts = options.build();
final JsonSerializer serializer = opts.serializer() == null ? environment.jsonSerializer() : opts.serializer();
return LookupInAccessor.lookupInAccessor(core, lookupInRequest(id, specs, opts), serializer);
}
Aggregations