Package com.couchbase.client.java
Class ReactiveBinaryCollection
- java.lang.Object
-
- com.couchbase.client.java.ReactiveBinaryCollection
-
public class ReactiveBinaryCollection extends Object
Allows to perform certain operations on non-JSON documents.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mono<MutationResult>append(String id, byte[] content)Appends binary content to the document.Mono<MutationResult>append(String id, byte[] content, AppendOptions options)Appends binary content to the document with custom options.Mono<CounterResult>decrement(String id)Decrements the counter document by one.Mono<CounterResult>decrement(String id, DecrementOptions options)Decrements the counter document by one or the number defined in the options.Mono<CounterResult>increment(String id)Increments the counter document by one.Mono<CounterResult>increment(String id, IncrementOptions options)Increments the counter document by one or the number defined in the options.Mono<MutationResult>prepend(String id, byte[] content)Prepends binary content to the document.Mono<MutationResult>prepend(String id, byte[] content, PrependOptions options)Prepends binary content to the document with custom options.
-
-
-
Method Detail
-
append
public Mono<MutationResult> append(String id, byte[] content)
Appends binary content to the document.- Parameters:
id- the document id which is used to uniquely identify it.content- the binary content to append to the document.- Returns:
- a
MutationResultonce completed. - Throws:
DocumentNotFoundException- the given document id is not found in the collection.CasMismatchException- if the document has been concurrently modified on the server.TimeoutException- if the operation times out before getting a result.CouchbaseException- for all other error reasons (acts as a base type and catch-all).
-
append
public Mono<MutationResult> append(String id, byte[] content, AppendOptions options)
Appends binary content to the document with custom options.- Parameters:
id- the document id which is used to uniquely identify it.content- the binary content to append to the document.options- custom options to customize the append behavior.- Returns:
- a
MutationResultonce completed. - Throws:
DocumentNotFoundException- the given document id is not found in the collection.CasMismatchException- if the document has been concurrently modified on the server.TimeoutException- if the operation times out before getting a result.CouchbaseException- for all other error reasons (acts as a base type and catch-all).
-
prepend
public Mono<MutationResult> prepend(String id, byte[] content)
Prepends binary content to the document.- Parameters:
id- the document id which is used to uniquely identify it.content- the binary content to append to the document.- Returns:
- a
MutationResultonce completed. - Throws:
DocumentNotFoundException- the given document id is not found in the collection.CasMismatchException- if the document has been concurrently modified on the server.TimeoutException- if the operation times out before getting a result.CouchbaseException- for all other error reasons (acts as a base type and catch-all).
-
prepend
public Mono<MutationResult> prepend(String id, byte[] content, PrependOptions options)
Prepends binary content to the document with custom options.- Parameters:
id- the document id which is used to uniquely identify it.content- the binary content to append to the document.options- custom options to customize the prepend behavior.- Returns:
- a
MutationResultonce completed. - Throws:
DocumentNotFoundException- the given document id is not found in the collection.CasMismatchException- if the document has been concurrently modified on the server.TimeoutException- if the operation times out before getting a result.CouchbaseException- for all other error reasons (acts as a base type and catch-all).
-
increment
public Mono<CounterResult> increment(String id)
Increments the counter document by one.- Parameters:
id- the document id which is used to uniquely identify it.- Returns:
- a
CounterResultonce completed. - Throws:
DocumentNotFoundException- the given document id is not found in the collection.TimeoutException- if the operation times out before getting a result.CouchbaseException- for all other error reasons (acts as a base type and catch-all).
-
increment
public Mono<CounterResult> increment(String id, IncrementOptions options)
Increments the counter document by one or the number defined in the options.- Parameters:
id- the document id which is used to uniquely identify it.options- custom options to customize the increment behavior.- Returns:
- a
CounterResultonce completed. - Throws:
DocumentNotFoundException- the given document id is not found in the collection.TimeoutException- if the operation times out before getting a result.CouchbaseException- for all other error reasons (acts as a base type and catch-all).
-
decrement
public Mono<CounterResult> decrement(String id)
Decrements the counter document by one.- Parameters:
id- the document id which is used to uniquely identify it.- Returns:
- a
CounterResultonce completed. - Throws:
DocumentNotFoundException- the given document id is not found in the collection.TimeoutException- if the operation times out before getting a result.CouchbaseException- for all other error reasons (acts as a base type and catch-all).
-
decrement
public Mono<CounterResult> decrement(String id, DecrementOptions options)
Decrements the counter document by one or the number defined in the options.- Parameters:
id- the document id which is used to uniquely identify it.options- custom options to customize the decrement behavior.- Returns:
- a
CounterResultonce completed. - Throws:
DocumentNotFoundException- the given document id is not found in the collection.TimeoutException- if the operation times out before getting a result.CouchbaseException- for all other error reasons (acts as a base type and catch-all).
-
-