UpdateSet.Builder Class
A builder for constructing UpdateSet instances.
Rather than having to manually construct the options and instantiating a UpdateSet directly, this builder may be used.
var update = new UpdateSet.Builder()
.withBucketType('myBucketType')
.withBucket('myBucket')
.withKey('myKey')
.withAdditions(['this', 'that', 'other'])
.withCallback(myCallback)
.build();
Constructor
UpdateSet.Builder
()
Item Index
Methods
withAdditions
-
additions
The values you wish to add to this set.
Parameters:
-
additionsString | BufferThe values to add.
withBasicQuorum
-
useBasicQuorum
Set the basic_quorum value. The parameter controls whether a read request should return early in some fail cases. E.g. If a quorum of nodes has already returned notfound/error, don't wait around for the rest.
Parameters:
-
useBasicQuorumBooleanthe basic_quorum value.
withBucket
-
bucket
Set the bucket.
Parameters:
-
bucketStringthe bucket in Riak
withBucketType
-
bucketType
Set the bucket type.
Parameters:
-
bucketTypeStringthe bucket type in riak
withCallback
-
callback
Set the callback.
Parameters:
-
callbackFunctionthe 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.
-
-
withContext
-
context
Set the causal context. The context is necessary for set removals. It is an opaque field, and should not be parsed or modified.
Parameters:
-
contextByteBufferthe causal context
withDw
-
dw
Set the DW value. If not set the bucket default is used.
Parameters:
-
dwNumberthe DW value.
withKey
-
key
Set the key. If this is not set one will be generated by and returned from Riak
Parameters:
-
keyStringthe key in riak.
withPw
-
pw
Set the PW value. If not set the bucket default is used.
Parameters:
-
pwNumberthe PW value.
withRemovals
-
removals
The values you wish to remove from this set. Note: when performing removals a context must be provided.
Parameters:
-
removalsString | BufferThe values to remove.
withReturnBody
-
returnBody
Set the return_body value. If true, the callback is passed the contents of the set after the update.
Parameters:
-
returnBodyBooleanthe return_body value.
withSetsAsBuffers
-
setsAsBuffers
Return sets as arrays of Buffers rather than strings. By default the contents of sets are converted to strings. Setting this to true will cause this not to occur and the raw bytes returned as Buffer objects.
Parameters:
-
setsAsBuffersBooleantrue to not convert set contents to strings.
withTimeout
-
timeout
Set a timeout for this operation.
Parameters:
-
timeoutNumbera timeout in milliseconds.
withW
-
w
Set the W value. If not set the bucket default is used.
Parameters:
-
wNumberthe W value.
