Couchbase C++ SDK 1.0.1 (rev. 58d46d7)
Loading...
Searching...
No Matches
binary_collection Class Reference

Allows to perform certain operations on non-JSON documents. More...

#include <couchbase/binary_collection.hxx>

Public Member Functions

auto bucket_name () const -> const std::string &
 Returns name of the bucket where the collection is defined.
 
auto scope_name () const -> const std::string &
 Returns name of the scope where the collection is defined.
 
auto name () const -> const std::string &
 Returns name of the collection.
 
void append (std::string document_id, std::vector< std::byte > data, const append_options &options, append_handler &&handler) const
 Appends binary content to the document.
 
auto append (std::string document_id, std::vector< std::byte > data, const append_options &options) const -> std::future< std::pair< error, mutation_result > >
 Appends binary content to the document.
 
void prepend (std::string document_id, std::vector< std::byte > data, const prepend_options &options, prepend_handler &&handler) const
 Prepends binary content to the document.
 
auto prepend (std::string document_id, std::vector< std::byte > data, const prepend_options &options) const -> std::future< std::pair< error, mutation_result > >
 Prepends binary content to the document.
 
void increment (std::string document_id, const increment_options &options, increment_handler &&handler) const
 Increments the counter document by one or the number defined in the options.
 
auto increment (std::string document_id, const increment_options &options) const -> std::future< std::pair< error, counter_result > >
 Increments the counter document by one or the number defined in the options.
 
void decrement (std::string document_id, const decrement_options &options, decrement_handler &&handler) const
 Decrements the counter document by one or the number defined in the options.
 
auto decrement (std::string document_id, const decrement_options &options) const -> std::future< std::pair< error, counter_result > >
 Decrements the counter document by one or the number defined in the options.
 

Friends

class collection
 

Detailed Description

Allows to perform certain operations on non-JSON documents.

Since
1.0.0
Committed
Generally available API and should be preferred in production

Member Function Documentation

◆ append() [1/2]

auto append ( std::string document_id,
std::vector< std::byte > data,
const append_options & options ) const -> std::future< std::pair< error, mutation_result > >

Appends binary content to the document.

Parameters
document_idthe document id which is used to uniquely identify it.
datathe document content to append.
optionscustom options to customize the append behavior.
Returns
future object that carries result of the operation
Exceptions
errc::key_value::document_not_foundthe given document id is not found in the collection.
errc::common::cas_mismatchif the document has been concurrently modified on the server.
errc::common::ambiguous_timeout
errc::common::unambiguous_timeout
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ append() [2/2]

void append ( std::string document_id,
std::vector< std::byte > data,
const append_options & options,
append_handler && handler ) const

Appends binary content to the document.

Parameters
document_idthe document id which is used to uniquely identify it.
datathe document content to append.
optionscustom options to customize the append behavior.
handlercallable that implements append_handler
Exceptions
errc::key_value::document_not_foundthe given document id is not found in the collection.
errc::common::cas_mismatchif the document has been concurrently modified on the server.
errc::common::ambiguous_timeout
errc::common::unambiguous_timeout
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ bucket_name()

auto bucket_name ( ) const -> const std::string &

Returns name of the bucket where the collection is defined.

Returns
name of the bucket
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ decrement() [1/2]

auto decrement ( std::string document_id,
const decrement_options & options ) const -> std::future< std::pair< error, counter_result > >

Decrements the counter document by one or the number defined in the options.

Parameters
document_idthe document id which is used to uniquely identify it.
optionscustom options to customize the decrement behavior.
Returns
future object that carries result of the operation
Exceptions
errc::key_value::document_not_foundthe given document id is not found in the collection.
errc::common::ambiguous_timeout
errc::common::unambiguous_timeout
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ decrement() [2/2]

void decrement ( std::string document_id,
const decrement_options & options,
decrement_handler && handler ) const

Decrements the counter document by one or the number defined in the options.

Template Parameters
Handlertype of the handler that implements decrement_handler
Parameters
document_idthe document id which is used to uniquely identify it.
optionscustom options to customize the decrement behavior.
handlercallable that implements decrement_handler
Exceptions
errc::key_value::document_not_foundthe given document id is not found in the collection.
errc::common::ambiguous_timeout
errc::common::unambiguous_timeout
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ increment() [1/2]

auto increment ( std::string document_id,
const increment_options & options ) const -> std::future< std::pair< error, counter_result > >

Increments the counter document by one or the number defined in the options.

Parameters
document_idthe document id which is used to uniquely identify it.
optionscustom options to customize the increment behavior.
Returns
future object that carries result of the operation
Exceptions
errc::key_value::document_not_foundthe given document id is not found in the collection.
errc::common::ambiguous_timeout
errc::common::unambiguous_timeout
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ increment() [2/2]

void increment ( std::string document_id,
const increment_options & options,
increment_handler && handler ) const

Increments the counter document by one or the number defined in the options.

Template Parameters
Handlertype of the handler that implements increment_handler
Parameters
document_idthe document id which is used to uniquely identify it.
optionscustom options to customize the increment behavior.
handlercallable that implements increment_handler
Exceptions
errc::key_value::document_not_foundthe given document id is not found in the collection.
errc::common::ambiguous_timeout
errc::common::unambiguous_timeout
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ name()

auto name ( ) const -> const std::string &

Returns name of the collection.

Returns
name of the collection
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ prepend() [1/2]

auto prepend ( std::string document_id,
std::vector< std::byte > data,
const prepend_options & options ) const -> std::future< std::pair< error, mutation_result > >

Prepends binary content to the document.

Parameters
document_idthe document id which is used to uniquely identify it.
datathe document content to prepend.
optionscustom options to customize the prepend behavior.
Returns
future object that carries result of the operation
Exceptions
errc::key_value::document_not_foundthe given document id is not found in the collection.
errc::common::cas_mismatchif the document has been concurrently modified on the server.
errc::common::ambiguous_timeout
errc::common::unambiguous_timeout
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ prepend() [2/2]

void prepend ( std::string document_id,
std::vector< std::byte > data,
const prepend_options & options,
prepend_handler && handler ) const

Prepends binary content to the document.

Template Parameters
Handlertype of the handler that implements prepend_handler
Parameters
document_idthe document id which is used to uniquely identify it.
datathe document content to prepend.
optionscustom options to customize the prepend behavior.
handlercallable that implements prepend_handler
Exceptions
errc::key_value::document_not_foundthe given document id is not found in the collection.
errc::common::cas_mismatchif the document has been concurrently modified on the server.
errc::common::ambiguous_timeout
errc::common::unambiguous_timeout
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ scope_name()

auto scope_name ( ) const -> const std::string &

Returns name of the scope where the collection is defined.

Returns
name of the scope
Since
1.0.0
Committed
Generally available API and should be preferred in production

Friends And Related Symbol Documentation

◆ collection

friend class collection
friend

The documentation for this class was generated from the following file: