Result Objects

This is the base class for all result operations

class couchbase.result.Result

The standard return type for Couchbase operations.

This is a lightweight object and may be subclassed by other operations which may required additional fields.

rc

libcouchbase error code

success

Determine whether operation succeeded or not

errstr

Returns a textual representation of the error

key

Key for the operation

class couchbase.result.OperationResult

Bases: Result

Result type returned for operations which do not fetch data

class couchbase.result.ValueResult

Bases: OperationResult

The result type returned for operations which retrieve a value

cas

CAS For the key

flags

Flags for the value

value

Value for the operation

class couchbase.result.HttpResult

Bases: Result

Generic object returned for HTTP operations

done

Return true if this request has no more data. This is most useful when issuing a streaming request where multiple chunks of data may arrive.

headers

Headers dict for the request. None unless ‘fetch_headers’ was passed to the request

http_status

HTTP Status Code

rows_per_call

Minimum number of rows to pass to callback

success

Whether the HTTP request was successful

url

HTTP URI

value

HTTP Payload

class couchbase.result.MultiResult
all_ok

Whether all the items in this result are successful

Observe Results

Observe Constants

These constants are returned as values for ObserveInfo.flags field.

couchbase.OBS_FOUND

The key exists on the given node’s cache, though it may not have been stored to disk yet.

couchbase.OBS_PERSISTED

The key is persisted to the given node’s disk.

couchbase.OBS_NOTFOUND

The key is not present in the node’s cache.

couchbase.OBS_LOGICALLY_DELETED

The key is not present in the node’s cache, however it is still present on the persistent store. If the node would crash at this moment, the key would still be present when it starts up again.

This is equivalent to OBS_NOTFOUND | OBS_PERSISTED

ObserveInfo Object

class couchbase.result.ObserveInfo

Object containing information about a key’s OBSERVED state

cas

CAS as it exists on the given node. It is possible (though not likely) that different nodes will have a different CAS value for a given key. In this case, the actual CAS being used should be the one from the master (use from_master)

flags

Server-side flags received from observe

from_master

Whether this response is from the master node. This evaluates to False if this status is from a replica

Table Of Contents

Previous topic

Querying Views

Next topic

Exception Objects

This Page