Results

class acouchbase.result.AsyncAnalyticsResult(analytics_request: _Rows[object, AnalyticsMetaData])

The result of an analytics query: its rows, read with async for, then its metadata.

metadata() → AnalyticsMetaData | None

Get the metadata the service returned after the analytics query’s rows.

Returns:

The metadata, or None until every row has been read.

Return type:

AnalyticsMetaData | None

rows() → AsyncRowIterator[Any, AnalyticsMetaData]

The rows which have been returned by the analytics query.

Returns:

An async iterable over the analytics query’s rows. Use async for to loop over it.

Return type:

AsyncIterable

class acouchbase.result.AsyncQueryResult(n1ql_request: _Rows[_ExecuteT, QueryMetaData])

The result of a query: its rows, read with async for, then its metadata.

execute() → _ExecuteT

Read every row of the query.

Returns:

The rows. On the asyncio API, a task that resolves to them.

Return type:

list[Any]

Example:

rows = cluster.query("SELECT * FROM `travel-sample` WHERE country LIKE 'United%' LIMIT 2").execute()
metadata() → QueryMetaData | None

Get the metadata the service returned after the query’s rows.

Returns:

The metadata, or None until every row has been read.

Return type:

QueryMetaData | None

rows() → AsyncRowIterator[Any, QueryMetaData]

The rows which have been returned by the query.

Returns:

An async iterable over the query’s rows. Use async for to loop over it.

Return type:

AsyncIterable

class acouchbase.result.AsyncScanResultIterable(rows: object, executor: _ScanCanceller)

The documents a range scan returns, read with async for.

cancel_scan() → None

Cancel the scan. Iterating its rows then ends at the next row the scan would return.

rows() → AsyncRowIterator[ScanResult, None]

Get the documents the scan returns.

Returns:

An async iterable over the documents. Use async for to loop over it.

Return type:

AsyncIterable

class acouchbase.result.AsyncSearchResult(search_request: _Rows[object, _SearchFinalMetadata])

The result of a search: its rows, read with async for, then its metadata and facets.

facets() → dict[str, SearchFacetResult] | None

Get the results of the search’s facets, which the service returns after its rows.

Returns:

Each facet’s result, by the facet’s name, or None until every row has been read.

Return type:

dict[str, SearchFacetResult] | None

metadata() → SearchMetaData | None

Get the metadata the service returned after the search’s rows.

Returns:

The metadata, or None until every row has been read.

Return type:

SearchMetaData | None

rows() → AsyncRowIterator[SearchRow, _SearchFinalMetadata]

The rows which have been returned by the search query.

Returns:

An async iterable over the search query’s rows. Use async for to loop over it.

Return type:

AsyncIterable

class acouchbase.result.AsyncViewResult(view_request: _Rows[object, ViewMetaData])

The result of a view query: its rows, read with async for, then its metadata.

metadata() → ViewMetaData | None

Get the metadata the service returned after the view query’s rows.

Returns:

The metadata, or None until every row has been read.

Return type:

ViewMetaData | None

rows() → AsyncRowIterator[ViewRow, ViewMetaData]

The rows which have been returned by the view query.

Returns:

An async iterable over the view query’s rows. Use async for to loop over it.

Return type:

AsyncIterable

This module also publishes these, described where they are first documented: