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:
-
additions
String | 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:
-
useBasicQuorum
Booleanthe basic_quorum value.
withBucket
-
bucket
Set the bucket.
Parameters:
-
bucket
Stringthe bucket in Riak
withBucketType
-
bucketType
Set the bucket type.
Parameters:
-
bucketType
Stringthe bucket type in riak
withCallback
-
callback
Set the callback.
Parameters:
-
callback
Functionthe 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.
-
-
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:
-
context
ByteBufferthe causal context
withDw
-
dw
Set the DW value. If not set the bucket default is used.
Parameters:
-
dw
Numberthe DW value.
withKey
-
key
Set the key. If this is not set one will be generated by and returned from Riak
Parameters:
-
key
Stringthe key in riak.
withPw
-
pw
Set the PW value. If not set the bucket default is used.
Parameters:
-
pw
Numberthe PW value.
withRemovals
-
removals
The values you wish to remove from this set. Note: when performing removals a context must be provided.
Parameters:
-
removals
String | 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:
-
returnBody
Booleanthe 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:
-
setsAsBuffers
Booleantrue to not convert set contents to strings.
withTimeout
-
timeout
Set a timeout for this operation.
Parameters:
-
timeout
Numbera timeout in milliseconds.
withW
-
w
Set the W value. If not set the bucket default is used.
Parameters:
-
w
Numberthe W value.