Package com.couchbase.client.java
Class ReactiveBinaryCollection
java.lang.Object
com.couchbase.client.java.ReactiveBinaryCollection
Allows to perform certain operations on non-JSON documents.
-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono
<MutationResult> Appends binary content to the document.reactor.core.publisher.Mono
<MutationResult> append
(String id, byte[] content, AppendOptions options) Appends binary content to the document with custom options.reactor.core.publisher.Mono
<CounterResult> Decrements the counter document by one.reactor.core.publisher.Mono
<CounterResult> decrement
(String id, DecrementOptions options) Decrements the counter document by one or the number defined in the options.reactor.core.publisher.Mono
<CounterResult> Increments the counter document by one.reactor.core.publisher.Mono
<CounterResult> increment
(String id, IncrementOptions options) Increments the counter document by one or the number defined in the options.reactor.core.publisher.Mono
<MutationResult> Prepends binary content to the document.reactor.core.publisher.Mono
<MutationResult> prepend
(String id, byte[] content, PrependOptions options) Prepends binary content to the document with custom options.
-
Method Details
-
append
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
MutationResult
once 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 reactor.core.publisher.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
MutationResult
once 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
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
MutationResult
once 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 reactor.core.publisher.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
MutationResult
once 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
Increments the counter document by one.- Parameters:
id
- the document id which is used to uniquely identify it.- Returns:
- a
CounterResult
once 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
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
CounterResult
once 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
Decrements the counter document by one.- Parameters:
id
- the document id which is used to uniquely identify it.- Returns:
- a
CounterResult
once 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
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
CounterResult
once 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).
-