Package com.couchbase.client.java
Class BinaryCollection
- java.lang.Object
-
- com.couchbase.client.java.BinaryCollection
-
public class BinaryCollection extends Object
Allows to perform certain operations on non-JSON documents.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MutationResultappend(String id, byte[] content)Appends binary content to the document.MutationResultappend(String id, byte[] content, AppendOptions options)Appends binary content to the document with custom options.CounterResultdecrement(String id)Decrements the counter document by one.CounterResultdecrement(String id, DecrementOptions options)Decrements the counter document by one or the number defined in the options.CounterResultincrement(String id)Increments the counter document by one.CounterResultincrement(String id, IncrementOptions options)Increments the counter document by one or the number defined in the options.MutationResultprepend(String id, byte[] content)Prepends binary content to the document.MutationResultprepend(String id, byte[] content, PrependOptions options)Prepends binary content to the document with custom options.
-
-
-
Method Detail
-
append
public 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 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 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 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 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 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 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 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).
-
-