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

Represents result of mutate_in operations. More...

#include <couchbase/mutate_in_result.hxx>

Inheritance diagram for mutate_in_result:
Inheritance graph

Classes

struct  entry
 

Public Member Functions

 mutate_in_result ()=default
 
 mutate_in_result (couchbase::cas cas, couchbase::mutation_token token, std::vector< entry > entries, bool is_deleted)
 Constructs result for mutate_in_result operation.
 
template<typename Document , typename Serializer = codec::tao_json_serializer, std::enable_if_t< codec::is_serializer_v< Serializer >, bool > = true>
auto content_as (std::size_t index) const -> Document
 Decodes field of the document into type.
 
template<typename Document , typename Serializer = codec::tao_json_serializer, std::enable_if_t< codec::is_serializer_v< Serializer >, bool > = true>
auto content_as (const std::string &path) const -> Document
 Decodes field of the document into type.
 
auto is_deleted () const -> bool
 Returns whether this document was deleted (a tombstone).
 
auto has_value (std::size_t index) const -> bool
 Returns whether the field has value.
 
auto has_value (const std::string &path) const -> bool
 Returns whether the field has value.
 
- Public Member Functions inherited from mutation_result
 mutation_result ()=default
 
 mutation_result (couchbase::cas cas, mutation_token token)
 Constructs result for get_any_replica operation, or an entry for get_all_replicas operation.
 
auto mutation_token () const -> const std::optional< mutation_token > &
 
- Public Member Functions inherited from result
 result ()=default
 
 result (couchbase::cas cas)
 
auto cas () const -> couchbase::cas
 

Detailed Description

Represents result of mutate_in operations.

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

Constructor & Destructor Documentation

◆ mutate_in_result() [1/2]

mutate_in_result ( )
default
Since
1.0.0
Internal
Internal interface

◆ mutate_in_result() [2/2]

mutate_in_result ( couchbase::cas cas,
couchbase::mutation_token token,
std::vector< entry > entries,
bool is_deleted )
inline

Constructs result for mutate_in_result operation.

Parameters
cas
tokenmutate_in token returned by the server
entrieslist of the fields returned by the server
is_deletedtrue if the document is a tombstone
Since
1.0.0
Committed
Generally available API and should be preferred in production

Member Function Documentation

◆ content_as() [1/2]

template<typename Document , typename Serializer = codec::tao_json_serializer, std::enable_if_t< codec::is_serializer_v< Serializer >, bool > = true>
auto content_as ( const std::string & path) const -> Document
inlinenodiscard

Decodes field of the document into type.

Template Parameters
Documentcustom type that codec::json_transcoder should use to decode the field
Parameters
paththe path of the result field
Returns
decoded document content
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ content_as() [2/2]

template<typename Document , typename Serializer = codec::tao_json_serializer, std::enable_if_t< codec::is_serializer_v< Serializer >, bool > = true>
auto content_as ( std::size_t index) const -> Document
inlinenodiscard

Decodes field of the document into type.

Template Parameters
Documentcustom type that codec::json_transcoder should use to decode the field
Parameters
indexthe index of the result field
Returns
decoded document content
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ has_value() [1/2]

auto has_value ( const std::string & path) const -> bool
inlinenodiscard

Returns whether the field has value.

Parameters
paththe path of the result field
Returns
true if the server returned value for the field
Since
1.0.0
Internal
Internal interface

◆ has_value() [2/2]

auto has_value ( std::size_t index) const -> bool
inlinenodiscard

Returns whether the field has value.

Parameters
indexthe index of the result field
Returns
true if the server returned value for the field
Since
1.0.0
Internal
Internal interface

◆ is_deleted()

auto is_deleted ( ) const -> bool
inlinenodiscard

Returns whether this document was deleted (a tombstone).

Will always be false unless lookup_in_options#access_deleted() has been set.

For internal use only: applications should not require it.

Returns
whether this document was a tombstone
Since
1.0.0
Internal
Internal interface

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