UpdateSet Class
Command used tp update a set in Riak
As a convenience, a builder class is provided:
var update = new UpdateSet.Builder()
.withBucketType('sets')
.withBucket('myBucket')
.withKey('set_1')
.withAdditions(['this', 'that', 'other'])
.withCallback(callback)
.build();
Constructor
UpdateSet
-
options -
callback
Parameters:
-
optionsObjectThe options to use for this command.
-
bucketTypeStringThe bucket type in riak.
-
bucketStringThe bucket in riak.
-
[key]String optionalThe key for the set you want to store. Riak will generate one if not set.
-
[additions]String | Buffer optionalThe values to be added to the set.
-
[removals]String | Buffer optionalThe values to remove from the set. Note that a context is required.
-
[context]Buffer optionalThe context from a previous fetch. Required for remove operations.
-
[returnBody=true]Boolean optionalReturn the set.
-
[setsAsBuffers=false]Boolean optionalReturn the set as an array of Buffers rather than strings.
-
[w]Number optionalThe W value to use.
-
[dw]Number optionalThe DW value to use.
-
[pw]Number optionalThe PW value to use.
-
[timeout]Number optionalSet a timeout for this command.
-
-
callbackFunctionRhe callback to be executed when the operation completes.
-
errStringAn error message. Will ne null if no error.
-
responseObjectThe response from Riak. will be null if returnBody is not set.
-
generatedKeyStringIf no key was supplied, Riak will generate and return one here. -
contextBufferAn opaque context to be used in any subsequent modification of the set. -
valuesString | BufferAn array holding the values in the set. String by default, Buffers if setsAsBuffers was used.
-
-
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
