UPDATE_BEFORE
UPDATE_BEFORE
Force a view update before returning data
Represents regular Couchbase Map/Reduce View query
from(string $designDocumentName, string $viewName) : \Couchbase\ViewQuery
Creates a new Couchbase ViewQuery instance for performing a view query.
string | $designDocumentName | the name of the design document to query |
string | $viewName | the name of the view to query |
fromSpatial(string $designDocumentName, string $viewName) : \Couchbase\SpatialViewQuery
Creates a new Couchbase ViewQuery instance for performing a spatial query.
string | $designDocumentName | the name of the design document to query |
string | $viewName | the name of the view to query |
limit(integer $limit) : \Couchbase\ViewQuery
Limits the result set to a specified number rows.
integer | $limit | maximum number of records in the response |
skip(integer $skip) : \Couchbase\ViewQuery
Skips a number o records rom the beginning of the result set
integer | $skip | number of records to skip |
consistency(integer $consistency) : \Couchbase\ViewQuery
Specifies the mode of updating to perorm before and after executing the query
integer | $consistency | use constants UPDATE_BEFORE, UPDATE_NONE, UPDATE_AFTER |
order(integer $order) : \Couchbase\ViewQuery
Orders the results by key as specified
integer | $order | use contstants ORDER_ASCENDING, ORDER_DESCENDING |
reduce(boolean $reduce) : \Couchbase\ViewQuery
Specifies whether the reduction function should be applied to results of the query.
boolean | $reduce |
group(boolean $group) : \Couchbase\ViewQuery
Group the results using the reduce function to a group or single row.
Important: this setter and groupLevel should not be used together in the same ViewQuery. It is sufficient to only set the grouping level only and use this setter in cases where you always want the highest group level implictly.
boolean | $group |
groupLevel(integer $groupLevel) : \Couchbase\ViewQuery
Specify the group level to be used.
Important: group() and this setter should not be used together in the same ViewQuery. It is sufficient to only use this setter and use group() in cases where you always want the highest group level implictly.
integer | $groupLevel | the number of elements in the keys to use |
key(mixed $key) : \Couchbase\ViewQuery
Restict results of the query to the specified key
mixed | $key | key |
keys(array $keys) : \Couchbase\ViewQuery
Restict results of the query to the specified set of keys
array | $keys | set of keys |
range(mixed $startKey, mixed $endKey, boolean $inclusiveEnd = false) : \Couchbase\ViewQuery
Specifies a range of the keys to return from the index.
mixed | $startKey | |
mixed | $endKey | |
boolean | $inclusiveEnd |
idRange(string $startKeyDocumentId, string $endKeyDocumentId) : \Couchbase\ViewQuery
Specifies start and end document IDs in addition to range limits.
This might be needed for more precise pagination with a lot of documents with the same key selected into the same page.
string | $startKeyDocumentId | document ID |
string | $endKeyDocumentId | document ID |
custom(array $customParameters) : \Couchbase\ViewQuery
Specifies custom options to pass to the server.
Note that these options are expected to be already encoded.
array | $customParameters | parameters |