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:
-
options
ObjectThe options for this command.
-
[bucketType=default]
String optionalThe bucket type in riak. If not supplied 'default' is used.
-
bucket
StringThe bucket in riak.
-
indexName
StringThe 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.
-
-
callback
Functionthe callback to be executed by the command.
-
err
StringAn error message. Will ne null if no error.
-
response
ObjectThe response from Riak.
-
values
ObjectObject keys returned by the query, and optionally the index keys. -
done
BooleanTrue if you have received all the results. -
continuation
BufferThe continuation if a continuation was returned.
-
-
data
Objectadditional 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:
-
msg
Stringan error message -
data
Objectadditional error data
onRiakError
-
rpbErrorResp
Parameters:
-
rpbErrorResp
Objectthe RpbErrorResp protocol buffer
onSuccess
-
pbResponseMessage
Parameters:
-
pbResponseMessage
Objectthe protocol buffer received from riak