FetchValue.Builder Class
A builder for constructing FetchValue instances.
Rather than having to manually construct the options and instantiating a FetchValue directly, this builder may be used.
var fetchValue = new FetchValue.Builder()
.withBucket('myBucket')
.withKey('myKey')
.build();
Constructor
FetchValue.Builder
()
Item Index
Methods
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. If not supplied, 'default' is used.
Parameters:
-
bucketType
Stringthe bucket type in riak
withCallback
-
callback
Set the callback to be executed when the operation completes.
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.
-
isNotFound
BooleanTrue if there was no value in Riak. -
isUnchanged
BooleanTrue if the object has not changed (based on a vclock provided via ifModified) -
vclock
BufferThe vector clock for this object (and its siblings) -
values
Object | RiakObject[]An array of one or more values. Either RiakObjects or JS objects if convertToJs was used.
-
-
withConflictResolver
-
conflictResolver
Provide a conflict resolver to resolve siblings. If siblings are present Riak will return all of them. The provided function will be used to resolve these to a single response.
If a conflict resolver is not provided all siblings will be returned.
Parameters:
-
conflictResolver
Function- the conflict resolver to be used.
withConvertValueToJs
-
convert
Convert the value stored in Riak to a JS object. Values are stored in Riak as bytes. Setting this to true will convert the value to a JS object using JSON.parse() before passing them to the conflict resolver.
Parameters:
-
convert
Boolean- true to convert the value(s), false otherwise.
withHeadOnly
-
headOnly
Return only the metadata. Causes Riak to only return the metadata for the object. The value will be asSet to null.
Parameters:
-
headOnly
Booleantrue to return only metadata.
withIfModified
-
vclock
Return the object if the supplied vclock does not match.
Parameters:
-
vclock
Bufferthe vclock to match on
withKey
-
key
Set the key.
Parameters:
-
key
Stringthe key in riak.
withNotFoundOk
-
notFoundOk
Set the not_found_ok value. If true a vnode returning notfound for a key increments the r tally. False is higher consistency, true is higher availability. If not asSet the bucket default is used.
Parameters:
-
notFoundOk
Booleanthe not_found_ok value.
withPr
-
pr
Set the PR value. If not asSet the bucket default is used.
Parameters:
-
pr
Numberthe PR value.
withR
-
r
Set the R value. If not asSet the bucket default is used.
Parameters:
-
r
Numberthe R value.
withReturnDeletedVClock
-
returnDeletedVClock
Set whether to return tombstones.
Parameters:
-
returnDeletedVClock
Booleantrue to return tombstones, false otherwise.
withTimeout
-
timeout
Set a timeout for this operation.
Parameters:
-
timeout
Numbera timeout in milliseconds.