#include <couchbase/scan_result_item.hxx>
◆ scan_result_item() [1/3]
◆ scan_result_item() [2/3]
Constructs an instance representing a single item from the result of a scan operation.
- Parameters
-
id | the document ID |
cas | |
value | raw document contents along with flags describing its structure |
expiry_time | optional point in time when the document will expire |
- Since
- 1.0.0
- Internal
- Internal interface
◆ scan_result_item() [3/3]
Constructs an instance representing a single item from the result of an id-only scan operation.
- Parameters
-
- Since
- 1.0.0
- Internal
- Internal interface
◆ content_as()
template<typename Document , typename Transcoder = codec::default_json_transcoder, std::enable_if_t<!
codec::is_transcoder_v< Document >, bool > = true, std::enable_if_t<
codec::is_transcoder_v< Transcoder >, bool > = true>
auto content_as |
( |
| ) |
const -> Document
|
|
inlinenodiscard |
Decodes the content of the document using given codec.
- Note
- This method always returns an empty
std::optional
unless the collection#scan()
request was made using scan_options#ids_only()
set to false.
- Template Parameters
-
Document | custom type that Transcoder returns |
Transcoder | type that has static function decode that takes codec::encoded_value and returns Document |
- Returns
- decoded document content
- Since
- 1.0.0
- Committed
- Generally available API and should be preferred in production
◆ expiry_time()
auto expiry_time |
( |
| ) |
const -> const std::optional<std::chrono::system_clock::time_point>&
|
|
inlinenodiscard |
If the document has an expiry, returns the point in time when the loaded document expires.
- Note
- This method always returns an empty
std::optional
unless the collection#scan()
request was made using scan_options#ids_only()
set to false.
- Returns
- expiry time if present
- Since
- 1.0.0
- Uncommitted
- Might be changed in the future, and eventually promoted to committed
◆ id()
auto id |
( |
| ) |
const -> const std::string&
|
|
inlinenodiscard |
Returns the ID of the document.
- Returns
- document id
- Since
- 1.0.0
- Committed
- Generally available API and should be preferred in production
◆ id_only()
auto id_only |
( |
| ) |
const -> bool
|
|
inlinenodiscard |
Returns whether this scan result item only contains the document ID.
If true, accessing the content or CAS will return the default values.
- Returns
- whether this item comes from an id-only scan.
- Since
- 1.0.0
- Committed
- Generally available API and should be preferred in production
◆ operator==()
The documentation for this class was generated from the following file: