NAME

Couchbase::Couch::Handle - Class for couch request handles

DESCRIPTION

This class represents a common inteface for various request handles. Emphasis will be placed on the iterating view handle, since this is the most common use case (technical and more 'correct' documentation will follow).

The iterator is simple to use. Simply initialize it (which is done for you automatically by one of the Couchbase::Couch::Base methods which return this object) and step through it. When there are no more results through which to step, the iterator is empty.

Note that iterator objects are fully re-entrant and fully compatible with the normal Couchbase::Client blocking API. This means that multiple iterators are allowed, and that you may perform modifications on the items being iterated upon.

Couchbase::Couch::Handle::ViewIterator

next()

Return the next result in the iterator. The returned object is either a false value (indicating no more results), or a Couchbase::Couch::ViewRow object.

If called in array/list context, a list of rows is returned; the amount of rows returned is dependent on how much data is currently in the row read buffer.

stop()

Abort iteration. This means to stop fetching extra data from the network. There will likely still be extra data available from "next"

path()

Returns the path for which this iterator was issued

count()

Returns the total amount of rows in the result set. This does not mean the amount of rows which will be returned via the iterator, but rather the server-side count of the the rows which matched the query parameters

info()

This returns a Couchbase::Couch::HandleInfo object to obtain metadata about the view execution. This will usually only return something meaningful after all rows have been fetched (but you can try!)

remaining_json()

Return the remaining JSON structure as a read-only hashref. Useful if you think the iterator is missing something.