Couchbase C++ SDK 1.0.2 (rev. 51f4775)
Loading...
Searching...
No Matches
increment_options Struct Reference

Options for binary_collection::increment(). More...

#include <couchbase/increment_options.hxx>

Inheritance diagram for increment_options:
Inheritance graph

Classes

struct  built
 Immutable value object representing consistent options. More...
 

Public Member Functions

auto build () const -> built
 Validates options and returns them as an immutable value.
 
auto expiry (std::chrono::seconds duration) -> increment_options &
 Sets the expiry for the document.
 
auto expiry (std::chrono::system_clock::time_point time_point) -> increment_options &
 Sets the expiry for the document.
 
auto delta (std::uint64_t delta) -> increment_options &
 The amount of which the document value should be incremented.
 
auto initial (std::uint64_t value) -> increment_options &
 The initial value that should be used if the document has not been created yet.
 
- Public Member Functions inherited from common_durability_options< increment_options >
auto durability (durability_level level) -> increment_options &
 Allows to customize the enhanced durability requirements for this operation.
 
auto durability (persist_to persist_to_nodes, replicate_to replicate_to_nodes) -> increment_options &
 Allows to customize the poll-based durability requirements for this operation.
 
- Public Member Functions inherited from common_options< increment_options >
auto timeout (const std::chrono::milliseconds timeout) -> increment_options &
 Specifies a custom per-operation timeout.
 
auto retry_strategy (const std::shared_ptr< retry_strategy > strategy) -> increment_options &
 Specifies a custom couchbase::retry_strategy for this operation.
 

Additional Inherited Members

- Protected Member Functions inherited from common_durability_options< increment_options >
auto build_common_durability_options () const -> built
 
- Protected Member Functions inherited from common_options< increment_options >
auto build_common_options () const -> built
 
auto self () -> increment_options &
 Allows to return the right options builder instance for child implementations.
 

Detailed Description

Options for binary_collection::increment().

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

Member Function Documentation

◆ build()

auto build ( ) const -> built
inlinenodiscard

Validates options and returns them as an immutable value.

Returns
consistent options as an immutable value
Exceptions
std::system_errorwith code errc::common::invalid_argument if the options are not valid
Since
1.0.0
Internal
Internal interface

◆ delta()

auto delta ( std::uint64_t delta) -> increment_options&
inline

The amount of which the document value should be incremented.

Parameters
deltathe amount to increment.
Returns
this options class for chaining purposes.
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ expiry() [1/2]

auto expiry ( std::chrono::seconds duration) -> increment_options&
inline

Sets the expiry for the document.

By default the document will never expire.

The duration must be less than 50 years. For expiry further in the future, use expiry(std::chrono::system_clock::time_point).

Parameters
durationthe duration after which the document will expire (zero duration means never expire).
Returns
this options class for chaining purposes.
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ expiry() [2/2]

auto expiry ( std::chrono::system_clock::time_point time_point) -> increment_options&
inline

Sets the expiry for the document.

By default the document will never expire.

Parameters
time_pointthe point in time when the document will expire (epoch second zero means never expire).
Returns
this options class for chaining purposes.
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ initial()

auto initial ( std::uint64_t value) -> increment_options&
inline

The initial value that should be used if the document has not been created yet.

Parameters
valuethe initial value to use.
Returns
this options class for chaining purposes.
Since
1.0.0
Committed
Generally available API and should be preferred in production

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