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:
-
options
ObjectThe options to use for this command.
-
bucketType
StringThe bucket type in riak.
-
bucket
StringThe 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.
-
-
callback
FunctionRhe callback to be executed when the operation completes.
-
err
StringAn error message. Will ne null if no error.
-
response
ObjectThe response from Riak. will be null if returnBody is not set.
-
generatedKey
StringIf no key was supplied, Riak will generate and return one here. -
context
BufferAn opaque context to be used in any subsequent modification of the set. -
values
String | BufferAn array holding the values in the set. String by default, Buffers if setsAsBuffers was used.
-
-
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