Views

class couchbase.views.ViewErrorMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

What a view query does when a node reports an error.

Warning

couchbase.bucket.ViewErrorMode is deprecated, and will be removed in a future release. Import ViewErrorMode from couchbase.views.

CONTINUE returns the rows the other nodes sent; STOP ends the query.

CONTINUE = 'continue'
STOP = 'stop'
class couchbase.views.ViewMetaData(record: _ViewMetaDataRecord)

The metadata the view service returned with a view query’s rows.

debug_info() → str | None

Get the debug information the view service returned.

Returns:

The debug information, if the query asked for it.

Return type:

str | None

total_rows() → int | None

Get the number of rows in the view’s index, before the query’s filters.

Returns:

The number of rows, if the service sent it.

Return type:

int | None

class couchbase.views.ViewOrdering(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

The order, by key, a view query returns its rows in.

Warning

couchbase.bucket.ViewOrdering is deprecated, and will be removed in a future release. Import ViewOrdering from couchbase.views.

ASCENDING = 'false'
DESCENDING = 'true'
class couchbase.views.ViewRow(key: Any = None, id: str | None = None, value: Any = None, document: Any = None)

One row of a view query.

key

The key the view’s map function emitted.

Type:

Any

id

The ID of the document that emitted the row, or None for a reduced row.

Type:

str | None

value

The value the view’s map function emitted, or the reduced value.

Type:

Any

document

The emitting document’s content, when it was fetched with the row.

Type:

Any

class couchbase.views.ViewScanConsistency(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

How current a view’s index must be when a view query reads it.

Warning

couchbase.bucket.ViewScanConsistency is deprecated, and will be removed in a future release. Import ViewScanConsistency from couchbase.views.

NOT_BOUNDED reads the index as it is. REQUEST_PLUS updates the index first, so the query sees every mutation made before it. UPDATE_AFTER reads the index as it is and then updates it.

NOT_BOUNDED = 'ok'
REQUEST_PLUS = 'false'
UPDATE_AFTER = 'update_after'