SecondaryIndexQuery Class
Command used to perform a secondary index query.
As a convenience, a builder class is provided:
var query = new SecondaryIndexQuery.Builder()
.withBucket('myBucket')
.withIndexName('email_bin')
.withIndexKey('roach@basho.com')
.withCallback(myCallback)
.build();
Constructor
SecondaryIndexQuery
-
options -
callback
Parameters:
-
optionsObjectThe options for this command.
-
[bucketType=default]String optionalThe bucket type in riak. If not supplied 'default' is used.
-
bucketStringThe bucket in riak.
-
indexNameStringThe secondary index name to query
-
[indexKey]String | Number optionalA single index key to query
-
[rangeStart]String | Number optionalStarting key for a range query
-
[rangeEnd]String | Number optionalEnding key for a range query
-
[returnKeyAndIndex=false]Boolean optionalReturn the index keys along with the object keys
-
[maxResults]Number optionalLimit the results returned and paginate if necessary
-
[continuation]Buffer optionalA continuation returned from a previous query that set maxResults. Used for pagination.
-
[stream=true]Boolean optionalWhether to stream or accumulate the result before calling callback.
-
[timeout]Number optionalSet a timeout for this operation.
-
[paginationSort=false]Boolean optionalTrue to sort a non-paginated query.
-
-
callbackFunctionthe callback to be executed by the command.
-
errStringAn error message. Will ne null if no error.
-
responseObjectThe response from Riak.
-
valuesObjectObject keys returned by the query, and optionally the index keys. -
doneBooleanTrue if you have received all the results. -
continuationBufferThe continuation if a continuation was returned.
-
-
dataObjectadditional error data. Will be null if no error.
-
Item Index
Methods
constructPbRequest
()
Object
protected
Returns:
getCallback
()
Function
private
Returns:
getExpectedResponseCode
()
Number
private
Returns:
getPbReqBuilder
()
Object
private
Returns:
getRiakMessage
()
Object
private
Returns:
onError
-
msg -
data
Parameters:
-
msgStringan error message -
dataObjectadditional error data
onRiakError
-
rpbErrorResp
Parameters:
-
rpbErrorRespObjectthe RpbErrorResp protocol buffer
onSuccess
-
pbResponseMessage
Parameters:
-
pbResponseMessageObjectthe protocol buffer received from riak
