Results

AnalyticsResult

class couchbase.result.AnalyticsResult
rows()

The rows which have been returned by the analytics query.

Note

If using the acouchbase API be sure to use async for when looping over rows.

Returns

Either an iterable or async iterable.

Return type

Iterable

metadata()

The meta-data which has been returned by the analytics query.

Returns

An instance of AnalyticsMetaData.

Return type

AnalyticsMetaData

CounterResult

class couchbase.result.CounterResult
property cas: Optional[int]

The CAS of the document, if it exists

Type

Optional[int]

property content: Optional[int]

The value of the document after the operation completed.

Type

Optional[int]

property key: Optional[str]

Key for the operation, if it exists.

Type

Optional[str]

DiagnosticsResult

class couchbase.result.DiagnosticsResult
property id: str

The unique identifier for this report.

Type

str

property endpoints: Dict[str, Any]

A map of service endpoints and their diagnostic status.

Type

Dict[str, Any]

property state: couchbase.diagnostics.ClusterState

The cluster state.

Type

ClusterState

property sdk: str

The name of the SDK which generated this report.

Type

str

property version: int

The version number of this report.

Type

int

as_json() str

Returns a JSON formatted diagnostics report.

Returns

JSON formatted diagnostics report.

Return type

str

ExistsResult

class couchbase.result.ExistsResult
property exists: bool

True if the document exists, false otherwise.

Type

bool

GetResult

class couchbase.result.GetResult
property cas: Optional[int]

The CAS of the document, if it exists

Type

Optional[int]

property content_as: Any

The contents of the document.

Get the value as a dict:

res = collection.get(key)
value = res.content_as[dict]
Type

Any

property key: Optional[str]

Key for the operation, if it exists.

Type

Optional[str]

property expiry_time: Optional[datetime.datetime]

The expiry of the document, if it was requested.

Type

Optional[datetime]

LookupInResult

class couchbase.result.LookupInResult
property cas: Optional[int]

The CAS of the document, if it exists

Type

Optional[int]

property content_as: couchbase.result.ContentSubdocProxy

A proxy to return the value at the specified index.

Get first value as a dict:

res = collection.lookup_in(key, (SD.get("geo"), SD.exists("city")))
value = res.content_as[dict](0)
Type

ContentSubdocProxy

MultiCounterResult

class couchbase.result.MultiCounterResult
property all_ok: bool

True if all operations succeeded, false otherwise.

Type

bool

property exceptions: Dict[str, pycbc_core.exception]

Map of keys to their respective exceptions, if the operation had an exception.

Type

Dict[str, Exception]

property results: Dict[str, couchbase.result.CounterResult]

Map of keys to their respective MutationResult, if the operation has a result.

Type

Dict[str, MutationResult]

MultiGetResult

class couchbase.result.MultiGetResult
property all_ok: bool

True if all operations succeeded, false otherwise.

Type

bool

property exceptions: Dict[str, pycbc_core.exception]

Map of keys to their respective exceptions, if the operation had an exception.

Type

Dict[str, Exception]

property results: Dict[str, couchbase.result.GetResult]

Map of keys to their respective GetResult, if the operation has a result.

Type

Dict[str, GetResult]

MultiExistsResult

class couchbase.result.MultiExistsResult
property all_ok: bool

True if all operations succeeded, false otherwise.

Type

bool

property exceptions: Dict[str, pycbc_core.exception]

Map of keys to their respective exceptions, if the operation had an exception.

Type

Dict[str, Exception]

property results: Dict[str, couchbase.result.ExistsResult]

Map of keys to their respective MutationResult, if the operation has a result.

Type

Dict[str, MutationResult]

MultiMutationResult

class couchbase.result.MultiMutationResult
property all_ok: bool

True if all operations succeeded, false otherwise.

Type

bool

property exceptions: Dict[str, pycbc_core.exception]

Map of keys to their respective exceptions, if the operation had an exception.

Type

Dict[str, Exception]

property results: Dict[str, couchbase.result.MutationResult]

Map of keys to their respective MutationResult, if the operation has a result.

Type

Dict[str, MutationResult]

MutateInResult

class couchbase.result.MutateInResult
property cas: Optional[int]

The CAS of the document, if it exists

Type

Optional[int]

property content_as: couchbase.result.ContentSubdocProxy

A proxy to return the value at the specified index.

Get first value as a str:

res = collection.mutate_in(key, (SD.upsert("city", "New City"),
                                SD.replace("faa", "CTY")))
value = res.content_as[str](0)
Type

ContentSubdocProxy

MutationResult

class couchbase.result.MutationResult
property cas: Optional[int]

The CAS of the document, if it exists

Type

Optional[int]

mutation_token() Optional[couchbase.result.MutationToken]

Get the operation’s mutation token, if it exists.

Returns

The operation’s mutation token.

Return type

Optional[MutationToken]

PingResult

class couchbase.result.PingResult
property id: str

The unique identifier for this report.

Type

str

property endpoints: Dict[str, Any]

A map of service endpoints and their ping status.

Type

Dict[str, Any]

property sdk: str

The name of the SDK which generated this report.

Type

str

property version: int

The version number of this report.

Type

int

as_json() str

Returns a JSON formatted diagnostics report.

Returns

JSON formatted diagnostics report.

Return type

str

QueryResult

class couchbase.result.QueryResult
rows()

The rows which have been returned by the query.

Note

If using the acouchbase API be sure to use async for when looping over rows.

Returns

Either an iterable or async iterable.

Return type

Iterable

metadata()

The meta-data which has been returned by the query.

Returns

An instance of QueryMetaData.

Return type

QueryMetaData

SearchResult

class couchbase.result.SearchResult
rows()

The rows which have been returned by the search query.

Note

If using the acouchbase API be sure to use async for when looping over rows.

Returns

Either an iterable or async iterable.

Return type

Iterable

metadata()

The meta-data which has been returned by the search query.

Returns

An instance of SearchMetaData.

Return type

SearchMetaData

ViewResult

class couchbase.result.ViewResult
rows()

The rows which have been returned by the view query.

Note

If using the acouchbase API be sure to use async for when looping over rows.

Returns

Either an iterable or async iterable.

Return type

Iterable

metadata()

The meta-data which has been returned by the view query.

Returns

An instance of ViewMetaData.

Return type

ViewMetaData