|
Couchbase C++ SDK 1.3.2 (rev. 49d3be2)
|
The collection provides access to all collection APIs.
More...
#include <couchbase/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. | |
| auto | binary () const -> binary_collection |
| Provides access to the binary APIs, not used for JSON documents. | |
| void | get (std::string document_id, const get_options &options, get_handler &&handler) const |
| Fetches the full document from this collection. | |
| auto | get (std::string document_id, const get_options &options={}) const -> std::future< std::pair< error, get_result > > |
| Fetches the full document from this collection. | |
| void | get_and_touch (std::string document_id, std::chrono::seconds duration, const get_and_touch_options &options, get_and_touch_handler &&handler) const |
| Fetches a full document and resets its expiration time to the value provided. | |
| auto | get_and_touch (std::string document_id, std::chrono::seconds duration, const get_and_touch_options &options={}) const -> std::future< std::pair< error, get_result > > |
| Fetches a full document and resets its expiration time to the value provided. | |
| void | get_and_touch (std::string document_id, std::chrono::system_clock::time_point time_point, const get_and_touch_options &options, get_and_touch_handler &&handler) const |
| Fetches a full document and resets its expiration time to the absolute value provided. | |
| auto | get_and_touch (std::string document_id, std::chrono::system_clock::time_point time_point, const get_and_touch_options &options={}) const -> std::future< std::pair< error, get_result > > |
| Fetches a full document and resets its expiration time to the absolute value provided. | |
| void | touch (std::string document_id, std::chrono::seconds duration, const touch_options &options, touch_handler &&handler) const |
| Updates the expiration a document given an id, without modifying or returning its value. | |
| auto | touch (std::string document_id, std::chrono::seconds duration, const touch_options &options={}) const -> std::future< std::pair< error, result > > |
| Updates the expiration a document given an id, without modifying or returning its value. | |
| void | touch (std::string document_id, std::chrono::system_clock::time_point time_point, const touch_options &options, touch_handler &&handler) const |
| Updates the expiration a document given an id, without modifying or returning its value. | |
| auto | touch (std::string document_id, std::chrono::system_clock::time_point time_point, const touch_options &options={}) const -> std::future< std::pair< error, result > > |
| Updates the expiration a document given an id, without modifying or returning its value. | |
| void | get_any_replica (std::string document_id, const get_any_replica_options &options, get_any_replica_handler &&handler) const |
| Reads all available replicas, and returns the first found. | |
| auto | get_any_replica (std::string document_id, const get_any_replica_options &options={}) const -> std::future< std::pair< error, get_replica_result > > |
| Reads all available replicas, and returns the first found. | |
| void | get_all_replicas (std::string document_id, const get_all_replicas_options &options, get_all_replicas_handler &&handler) const |
| Reads from all available replicas and the active node and returns the results as a vector. | |
| auto | get_all_replicas (std::string document_id, const get_all_replicas_options &options={}) const -> std::future< std::pair< error, get_all_replicas_result > > |
| Reads from all available replicas and the active node and returns the results as a vector. | |
| void | upsert (std::string document_id, codec::encoded_value document, const upsert_options &options, upsert_handler &&handler) const |
| Upserts an encoded body of the document which might or might not exist yet, with custom options. | |
| template<typename Transcoder = codec::default_json_transcoder, typename Document> | |
| void | upsert (std::string document_id, Document document, const upsert_options &options, upsert_handler &&handler) const |
| Upserts a full document which might or might not exist yet with custom options. | |
| auto | upsert (std::string document_id, codec::encoded_value document, const upsert_options &options) const -> std::future< std::pair< error, mutation_result > > |
| Upserts an encoded body of the document which might or might not exist yet, with custom options. | |
| template<typename Transcoder = codec::default_json_transcoder, typename Document> | |
| auto | upsert (std::string document_id, Document document, const upsert_options &options={}) const -> std::future< std::pair< error, mutation_result > > |
| Upserts a full document which might or might not exist yet with custom options. | |
| void | insert (std::string document_id, codec::encoded_value document, const insert_options &options, insert_handler &&handler) const |
| Inserts an encoded body of the document which does not exist yet with custom options. | |
| template<typename Transcoder = codec::default_json_transcoder, typename Document, std::enable_if_t<!std::is_same_v< codec::encoded_value, Document >, bool > = true> | |
| void | insert (std::string document_id, Document document, const insert_options &options, insert_handler &&handler) const |
| Inserts a full document which does not exist yet with custom options. | |
| auto | insert (std::string document_id, codec::encoded_value document, const insert_options &options) const -> std::future< std::pair< error, mutation_result > > |
| Inserts an encoded body of the document which does not exist yet with custom options. | |
| template<typename Transcoder = codec::default_json_transcoder, typename Document, std::enable_if_t<!std::is_same_v< codec::encoded_value, Document >, bool > = true> | |
| auto | insert (std::string document_id, Document document, const insert_options &options={}) const -> std::future< std::pair< error, mutation_result > > |
| Inserts a full document which does not exist yet with custom options. | |
| void | replace (std::string document_id, codec::encoded_value document, const replace_options &options, replace_handler &&handler) const |
| Replaces a body of the document which already exists with specified encoded body. | |
| template<typename Transcoder = codec::default_json_transcoder, typename Document, std::enable_if_t<!std::is_same_v< codec::encoded_value, Document >, bool > = true> | |
| void | replace (std::string document_id, Document document, const replace_options &options, replace_handler &&handler) const |
| Replaces a full document which already exists. | |
| auto | replace (std::string document_id, codec::encoded_value document, const replace_options &options) const -> std::future< std::pair< error, mutation_result > > |
| Replaces a body of the document which already exists with specified encoded body. | |
| template<typename Transcoder = codec::default_json_transcoder, typename Document, std::enable_if_t<!std::is_same_v< codec::encoded_value, Document >, bool > = true> | |
| auto | replace (std::string document_id, Document document, const replace_options &options={}) const -> std::future< std::pair< error, mutation_result > > |
| Replaces a full document which already exists. | |
| void | remove (std::string document_id, const remove_options &options, remove_handler &&handler) const |
| Removes a Document from a collection. | |
| auto | remove (std::string document_id, const remove_options &options={}) const -> std::future< std::pair< error, mutation_result > > |
| Removes a Document from a collection. | |
| void | mutate_in (std::string document_id, const mutate_in_specs &specs, const mutate_in_options &options, mutate_in_handler &&handler) const |
| Performs mutations to document fragments. | |
| auto | mutate_in (std::string document_id, const mutate_in_specs &specs, const mutate_in_options &options={}) const -> std::future< std::pair< error, mutate_in_result > > |
| Performs mutations to document fragments. | |
| void | lookup_in (std::string document_id, const lookup_in_specs &specs, const lookup_in_options &options, lookup_in_handler &&handler) const |
| Performs lookups to document fragments with default options. | |
| auto | lookup_in (std::string document_id, const lookup_in_specs &specs, const lookup_in_options &options={}) const -> std::future< std::pair< error, lookup_in_result > > |
| Performs lookups to document fragments with default options. | |
| void | lookup_in_all_replicas (std::string document_id, const lookup_in_specs &specs, const lookup_in_all_replicas_options &options, lookup_in_all_replicas_handler &&handler) const |
| Performs lookups to document fragments with default options from all replicas and the active node and returns the result as a vector. | |
| auto | lookup_in_all_replicas (std::string document_id, const lookup_in_specs &specs, const lookup_in_all_replicas_options &options={}) const -> std::future< std::pair< error, lookup_in_all_replicas_result > > |
| Performs lookups to document fragments with default options from all replicas and the active node and returns the result as a vector. | |
| void | lookup_in_any_replica (std::string document_id, const lookup_in_specs &specs, const lookup_in_any_replica_options &options, lookup_in_any_replica_handler &&handler) const |
| Performs lookups to document fragments with default options from all replicas and returns the first found. | |
| auto | lookup_in_any_replica (std::string document_id, const lookup_in_specs &specs, const lookup_in_any_replica_options &options={}) const -> std::future< std::pair< error, lookup_in_replica_result > > |
| Performs lookups to document fragments with default options from all replicas and returns the first found. | |
| void | get_and_lock (std::string document_id, std::chrono::seconds lock_duration, const get_and_lock_options &options, get_and_lock_handler &&handler) const |
| Gets a document for a given id and places a pessimistic lock on it for mutations. | |
| auto | get_and_lock (std::string document_id, std::chrono::seconds lock_duration, const get_and_lock_options &options={}) const -> std::future< std::pair< error, get_result > > |
| Gets a document for a given id and places a pessimistic lock on it for mutations. | |
| void | unlock (std::string document_id, couchbase::cas cas, const unlock_options &options, unlock_handler &&handler) const |
| Unlocks a document if it has been locked previously, with default options. | |
| auto | unlock (std::string document_id, couchbase::cas cas, const unlock_options &options={}) const -> std::future< error > |
| Unlocks a document if it has been locked previously, with default options. | |
| void | exists (std::string document_id, const exists_options &options, exists_handler &&handler) const |
| Checks if the document exists on the server. | |
| auto | exists (std::string document_id, const exists_options &options={}) const -> std::future< std::pair< error, exists_result > > |
| Checks if the document exists on the server. | |
| void | scan (const scan_type &scan_type, const scan_options &options, scan_handler &&handler) const |
| Performs a key-value scan operation on the collection. | |
| auto | scan (const scan_type &scan_type, const scan_options &options={}) const -> std::future< std::pair< error, scan_result > > |
| Performs a key-value scan operation on the collection. | |
| void | node_id_for (std::string document_id, const node_id_for_options &options, node_id_for_handler &&handler) const |
| Resolves a document key to the identity of the cluster node that currently owns it, using the client-side vBucket map (no network round-trip). | |
| auto | node_id_for (std::string document_id, const node_id_for_options &options={}) const -> std::future< std::pair< error, node_id > > |
| Resolves a document key to the identity of the cluster node that currently owns it, using the client-side vBucket map (no network round-trip). | |
| void | node_ids (const node_ids_options &options, node_ids_handler &&handler) const |
| Returns the set of cluster nodes that currently serve key-value traffic for this collection's bucket, drawn from the client-side topology snapshot (no network round-trip). | |
| auto | node_ids (const node_ids_options &options={}) const -> std::future< std::pair< error, std::vector< node_id > > > |
| Returns the set of cluster nodes that currently serve key-value traffic for this collection's bucket, drawn from the client-side topology snapshot (no network round-trip). | |
| auto | query_indexes () const -> collection_query_index_manager |
Static Public Attributes | |
| static constexpr auto | default_name { "_default" } |
| Constant for the name of the default collection in the bucket. | |
Friends | |
| class | bucket |
| class | scope |
The collection provides access to all collection APIs.
|
nodiscard |
Provides access to the binary APIs, not used for JSON documents.
|
nodiscard |
Returns name of the bucket where the collection is defined.
| void exists | ( | std::string | document_id, |
| const exists_options & | options, | ||
| exists_handler && | handler ) const |
Checks if the document exists on the server.
| document_id | the id of the document |
| options | the options to customize |
| handler | callable that implements exists_handler |
|
nodiscard |
Checks if the document exists on the server.
| document_id | the id of the document |
| options | the options to customize |
| void get | ( | std::string | document_id, |
| const get_options & | options, | ||
| get_handler && | handler ) const |
Fetches the full document from this collection.
| document_id | the document id which is used to uniquely identify it. |
| options | options to customize the get request. |
| handler | the handler that implements get_handler |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
|
nodiscard |
Fetches the full document from this collection.
| document_id | the document id which is used to uniquely identify it. |
| options | options to customize the get request. |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
| void get_all_replicas | ( | std::string | document_id, |
| const get_all_replicas_options & | options, | ||
| get_all_replicas_handler && | handler ) const |
Reads from all available replicas and the active node and returns the results as a vector.
| document_id | the document id which is used to uniquely identify it. |
| options | the custom options |
| handler | the handler that implements get_all_replicas_handler |
|
nodiscard |
Reads from all available replicas and the active node and returns the results as a vector.
Select preferred server group in connection options:
Restrict get_all_replicas to reach nodes that belong to selected server group only:
| document_id | the document id which is used to uniquely identify it. |
| options | the custom options |
| void get_and_lock | ( | std::string | document_id, |
| std::chrono::seconds | lock_duration, | ||
| const get_and_lock_options & | options, | ||
| get_and_lock_handler && | handler ) const |
Gets a document for a given id and places a pessimistic lock on it for mutations.
| document_id | the id of the document |
| lock_duration | the length of time the lock will be held on the document |
| options | the options to customize |
| handler | callable that implements get_and_lock_handler |
|
nodiscard |
Gets a document for a given id and places a pessimistic lock on it for mutations.
| document_id | the id of the document |
| lock_duration | the length of time the lock will be held on the document |
| options | the options to customize |
| void get_and_touch | ( | std::string | document_id, |
| std::chrono::seconds | duration, | ||
| const get_and_touch_options & | options, | ||
| get_and_touch_handler && | handler ) const |
Fetches a full document and resets its expiration time to the value provided.
| document_id | the document id which is used to uniquely identify it. |
| duration | the new expiration time for the document. |
| options | custom options to change the default behavior. |
| handler | the handler that implements get_and_touch_handler |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
|
nodiscard |
Fetches a full document and resets its expiration time to the value provided.
| document_id | the document id which is used to uniquely identify it. |
| duration | the new expiration time for the document. |
| options | custom options to change the default behavior. |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
| void get_and_touch | ( | std::string | document_id, |
| std::chrono::system_clock::time_point | time_point, | ||
| const get_and_touch_options & | options, | ||
| get_and_touch_handler && | handler ) const |
Fetches a full document and resets its expiration time to the absolute value provided.
| document_id | the document id which is used to uniquely identify it. |
| time_point | the new expiration time point for the document. |
| options | custom options to change the default behavior. |
| handler | the handler that implements get_and_touch_handler |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
|
nodiscard |
Fetches a full document and resets its expiration time to the absolute value provided.
| document_id | the document id which is used to uniquely identify it. |
| time_point | the new expiration time point for the document. |
| options | custom options to change the default behavior. |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
| void get_any_replica | ( | std::string | document_id, |
| const get_any_replica_options & | options, | ||
| get_any_replica_handler && | handler ) const |
Reads all available replicas, and returns the first found.
| document_id | the document id which is used to uniquely identify it. |
| options | the custom options |
| handler | the handler that implements get_any_replica_handler |
| errc::key_value::document_irretrievable | the situation where the SDK got all responses (most likely: key not found) but none of them were successful so it ended up not returning anything |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
|
nodiscard |
Reads all available replicas, and returns the first found.
| document_id | the document id which is used to uniquely identify it. |
| options | the custom options |
Select preferred server group in connection options:
Restrict get_any_replica to reach nodes that belong to selected server group only:
| errc::key_value::document_irretrievable | the situation where the SDK got all responses (most likely: key not found) but none of them were successful so it ended up not returning anything |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
|
nodiscard |
Inserts an encoded body of the document which does not exist yet with custom options.
| document_id | the document id which is used to uniquely identify it. |
| document | the encoded content of the document to upsert. |
| options | custom options to customize the upsert behavior. |
| void insert | ( | std::string | document_id, |
| codec::encoded_value | document, | ||
| const insert_options & | options, | ||
| insert_handler && | handler ) const |
Inserts an encoded body of the document which does not exist yet with custom options.
| document_id | the document id which is used to uniquely identify it. |
| document | the encoded content of the document to upsert. |
| options | custom options to customize the upsert behavior. |
| handler | callable that implements upsert_handler |
|
inline |
Inserts a full document which does not exist yet with custom options.
| Transcoder | type of the transcoder that will be used to encode the document |
| Document | type of the document |
| document_id | the document id which is used to uniquely identify it. |
| document | the document content to insert. |
| options | custom options to customize the insert behavior. |
| handler | callable that implements insert_handler |
| errc::key_value::document_exists | the given document id is already present in the collection. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
|
inlinenodiscard |
Inserts a full document which does not exist yet with custom options.
| Transcoder | type of the transcoder that will be used to encode the document |
| Document | type of the document |
| document_id | the document id which is used to uniquely identify it. |
| document | the document content to insert. |
| options | custom options to customize the insert behavior. |
| errc::key_value::document_exists | the given document id is already present in the collection. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
| void lookup_in | ( | std::string | document_id, |
| const lookup_in_specs & | specs, | ||
| const lookup_in_options & | options, | ||
| lookup_in_handler && | handler ) const |
Performs lookups to document fragments with default options.
| document_id | the outer document ID |
| specs | an object that specifies the types of lookups to perform |
| options | custom options to modify the lookup options |
| handler | callable that implements lookup_in_handler |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
|
nodiscard |
Performs lookups to document fragments with default options.
| document_id | the outer document ID |
| specs | an object that specifies the types of lookups to perform |
| options | custom options to modify the lookup options |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
| void lookup_in_all_replicas | ( | std::string | document_id, |
| const lookup_in_specs & | specs, | ||
| const lookup_in_all_replicas_options & | options, | ||
| lookup_in_all_replicas_handler && | handler ) const |
Performs lookups to document fragments with default options from all replicas and the active node and returns the result as a vector.
| document_id | the outer document ID |
| specs | an object that specifies the types of lookups to perform |
| options | custom options to modify the lookup options |
| handler | callable that implements lookup_in_all_replicas_handler |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
|
nodiscard |
Performs lookups to document fragments with default options from all replicas and the active node and returns the result as a vector.
| document_id | the outer document ID |
| specs | an object that specifies the types of lookups to perform |
| options | custom options to modify the lookup options |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
| void lookup_in_any_replica | ( | std::string | document_id, |
| const lookup_in_specs & | specs, | ||
| const lookup_in_any_replica_options & | options, | ||
| lookup_in_any_replica_handler && | handler ) const |
Performs lookups to document fragments with default options from all replicas and returns the first found.
| document_id | the outer document ID |
| specs | an object that specifies the types of lookups to perform |
| options | custom options to modify the lookup options |
| handler | callable that implements lookup_in_any_replica_handler |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
|
nodiscard |
Performs lookups to document fragments with default options from all replicas and returns the first found.
| document_id | the outer document ID |
| specs | an object that specifies the types of lookups to perform |
| options | custom options to modify the lookup options |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
| void mutate_in | ( | std::string | document_id, |
| const mutate_in_specs & | specs, | ||
| const mutate_in_options & | options, | ||
| mutate_in_handler && | handler ) const |
Performs mutations to document fragments.
| document_id | the document id which is used to uniquely identify it. |
| specs | the spec which specifies the type of mutations to perform. |
| options | custom options to customize the mutate_in behavior. |
| handler | callable that implements mutate_in_handler |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::key_value::document_exists | the given document id is already present in the collection and insert is was selected. |
| errc::common::cas_mismatch | if the document has been concurrently modified on the server. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
|
nodiscard |
Performs mutations to document fragments.
| document_id | the document id which is used to uniquely identify it. |
| specs | the spec which specifies the type of mutations to perform. |
| options | custom options to customize the mutate_in behavior. |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::key_value::document_exists | the given document id is already present in the collection and insert is was selected. |
| errc::common::cas_mismatch | if the document has been concurrently modified on the server. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
|
nodiscard |
Returns name of the collection.
| void node_id_for | ( | std::string | document_id, |
| const node_id_for_options & | options, | ||
| node_id_for_handler && | handler ) const |
Resolves a document key to the identity of the cluster node that currently owns it, using the client-side vBucket map (no network round-trip).
| document_id | the document id to resolve |
| options | options to customize the request |
| handler | the handler that receives the result |
|
nodiscard |
Resolves a document key to the identity of the cluster node that currently owns it, using the client-side vBucket map (no network round-trip).
| document_id | the document id to resolve |
| options | options to customize the request |
| void node_ids | ( | const node_ids_options & | options, |
| node_ids_handler && | handler ) const |
Returns the set of cluster nodes that currently serve key-value traffic for this collection's bucket, drawn from the client-side topology snapshot (no network round-trip).
Each entry corresponds to one cluster node and is the same node_id the SDK reports on KV results and errors that touched that node, so the returned set is directly comparable to the keys of any application-side state that is keyed by node_id (e.g. a per-node circuit breaker registry). A periodic sweep that diffs the registry's keys against this set is the canonical way to retire tracker state for a node that has been removed from the cluster topology.
Nodes that do not expose a key-value port for the configured transport (TLS or plain) are excluded from the returned set, since they do not serve KV operations and therefore have no meaningful identity from the SDK's point of view.
| options | options to customize the request |
| handler | the handler that receives the result |
|
nodiscard |
Returns the set of cluster nodes that currently serve key-value traffic for this collection's bucket, drawn from the client-side topology snapshot (no network round-trip).
| options | options to customize the request |
|
nodiscard |
| void remove | ( | std::string | document_id, |
| const remove_options & | options, | ||
| remove_handler && | handler ) const |
Removes a Document from a collection.
| document_id | the document id which is used to uniquely identify it. |
| options | custom options to customize the remove behavior. |
| handler | callable that implements remove_handler |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::common::cas_mismatch | if the document has been concurrently modified on the server. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
|
nodiscard |
Removes a Document from a collection.
| document_id | the document id which is used to uniquely identify it. |
| options | custom options to customize the remove behavior. |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::common::cas_mismatch | if the document has been concurrently modified on the server. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
|
nodiscard |
Replaces a body of the document which already exists with specified encoded body.
| document_id | the document id which is used to uniquely identify it. |
| document | the encoded content of the document to upsert. |
| options | custom options to customize the upsert behavior. |
| void replace | ( | std::string | document_id, |
| codec::encoded_value | document, | ||
| const replace_options & | options, | ||
| replace_handler && | handler ) const |
Replaces a body of the document which already exists with specified encoded body.
| document_id | the document id which is used to uniquely identify it. |
| document | the encoded content of the document to upsert. |
| options | custom options to customize the upsert behavior. |
| handler | callable that implements upsert_handler |
|
inline |
Replaces a full document which already exists.
| Transcoder | type of the transcoder that will be used to encode the document |
| Document | type of the document |
| document_id | the document id which is used to uniquely identify it. |
| document | the document content to replace. |
| options | custom options to customize the replace behavior. |
| handler | callable that implements replace_handler |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::common::cas_mismatch | if the document has been concurrently modified on the server. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
|
inlinenodiscard |
Replaces a full document which already exists.
| Transcoder | type of the transcoder that will be used to encode the document |
| Document | type of the document |
| document_id | the document id which is used to uniquely identify it. |
| document | the document content to replace. |
| options | custom options to customize the replace behavior. |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::common::cas_mismatch | if the document has been concurrently modified on the server. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
| void scan | ( | const scan_type & | scan_type, |
| const scan_options & | options, | ||
| scan_handler && | handler ) const |
Performs a key-value scan operation on the collection.
| scan_type | the type of the scan. Can be range_scan, prefix_scan or sampling_scan |
| options | the options to customize |
| handler | callable that implements scan_handler |
|
nodiscard |
Performs a key-value scan operation on the collection.
| scan_type | the type of the scan. Can be range_scan, prefix_scan or sampling_scan |
| options | the options to customize |
|
nodiscard |
Returns name of the scope where the collection is defined.
| void touch | ( | std::string | document_id, |
| std::chrono::seconds | duration, | ||
| const touch_options & | options, | ||
| touch_handler && | handler ) const |
Updates the expiration a document given an id, without modifying or returning its value.
| document_id | the document id which is used to uniquely identify it. |
| duration | the new expiration time for the document. |
| options | custom options to change the default behavior. |
| handler | the handler that implements touch_handler |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
|
nodiscard |
Updates the expiration a document given an id, without modifying or returning its value.
| document_id | the document id which is used to uniquely identify it. |
| duration | the new expiration time for the document. |
| options | custom options to change the default behavior. |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
| void touch | ( | std::string | document_id, |
| std::chrono::system_clock::time_point | time_point, | ||
| const touch_options & | options, | ||
| touch_handler && | handler ) const |
Updates the expiration a document given an id, without modifying or returning its value.
| document_id | the document id which is used to uniquely identify it. |
| time_point | the new expiration time point for the document. |
| options | custom options to change the default behavior. |
| handler | the handler that implements touch_handler |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
|
nodiscard |
Updates the expiration a document given an id, without modifying or returning its value.
| document_id | the document id which is used to uniquely identify it. |
| time_point | the new expiration time point for the document. |
| options | custom options to change the default behavior. |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
| void unlock | ( | std::string | document_id, |
| couchbase::cas | cas, | ||
| const unlock_options & | options, | ||
| unlock_handler && | handler ) const |
Unlocks a document if it has been locked previously, with default options.
| document_id | the id of the document |
| cas | the CAS value which is needed to unlock it |
| options | the options to customize |
| handler | callable that implements unlock_handler |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::common::cas_mismatch | if the document has been concurrently modified on the server. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
|
nodiscard |
Unlocks a document if it has been locked previously, with default options.
| document_id | the id of the document |
| cas | the CAS value which is needed to unlock it |
| options | the options to customize |
| errc::key_value::document_not_found | the given document id is not found in the collection. |
| errc::common::cas_mismatch | if the document has been concurrently modified on the server. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
|
nodiscard |
Upserts an encoded body of the document which might or might not exist yet, with custom options.
| document_id | the document id which is used to uniquely identify it. |
| document | the encoded content of the document to upsert. |
| options | custom options to customize the upsert behavior. |
| void upsert | ( | std::string | document_id, |
| codec::encoded_value | document, | ||
| const upsert_options & | options, | ||
| upsert_handler && | handler ) const |
Upserts an encoded body of the document which might or might not exist yet, with custom options.
| document_id | the document id which is used to uniquely identify it. |
| document | the encoded content of the document to upsert. |
| options | custom options to customize the upsert behavior. |
| handler | callable that implements upsert_handler |
|
inline |
Upserts a full document which might or might not exist yet with custom options.
| Transcoder | type of the transcoder that will be used to encode the document |
| Document | type of the document |
| document_id | the document id which is used to uniquely identify it. |
| document | the document content to upsert. |
| options | custom options to customize the upsert behavior. |
| handler | callable that implements upsert_handler |
|
inlinenodiscard |
Upserts a full document which might or might not exist yet with custom options.
| Transcoder | type of the transcoder that will be used to encode the document |
| Document | type of the document |
| document_id | the document id which is used to uniquely identify it. |
| document | the document content to upsert. |
| options | custom options to customize the upsert behavior. |
|
friend |
|
friend |
|
staticconstexpr |
Constant for the name of the default collection in the bucket.