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

Options for collection::get(). More...

#include <couchbase/get_options.hxx>

Inheritance diagram for get_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 with_expiry (bool return_expiry) -> get_options &
 If set to true, the get will fetch the expiry for the document as well and return it as part of the get_result.
 
auto project (std::vector< std::string > field_paths) -> get_options &
 Allows to specify a custom list paths to fetch from the document instead of the whole.
 
- Public Member Functions inherited from common_options< get_options >
auto timeout (const std::chrono::milliseconds timeout) -> get_options &
 Specifies a custom per-operation timeout.
 
auto retry_strategy (const std::shared_ptr< retry_strategy > strategy) -> get_options &
 Specifies a custom couchbase::retry_strategy for this operation.
 

Additional Inherited Members

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

Detailed Description

Options for collection::get().

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

◆ project()

auto project ( std::vector< std::string > field_paths) -> get_options&
inline

Allows to specify a custom list paths to fetch from the document instead of the whole.

Note
that a maximum of 16 individual paths can be projected at a time due to a server limitation. If you need more than that, think about fetching less-generic paths or the full document straight away.
Parameters
field_pathsa list of paths that should be loaded if present.
Returns
this options builder for chaining purposes.
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ with_expiry()

auto with_expiry ( bool return_expiry) -> get_options&
inline

If set to true, the get will fetch the expiry for the document as well and return it as part of the get_result.

Parameters
return_expirytrue if it should be fetched.
Returns
this options builder 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: