StoreValue.Builder Class
A builder for constructing StoreValue instances.
Rather than having to manually construct the options and instantiating a StoreValue directly, this builder may be used.
var storeValue = new StoreValue.Builder()
     .withBucket('myBucket')
     .withKey('myKey')
     .withContent(myObj);
     .build();
Constructor
StoreValue.Builder
        ()
    
    Item Index
Methods
withBucket
        - 
                        
bucket 
Set the bucket. Note that this can also be provided via RiakObject passed in via withContent() and doing so will take precidence over this method.
Parameters:
- 
                        
bucketStringthe bucket in Riak
 
withBucketType
        - 
                        
bucketType 
Set the bucket type. If not supplied, 'default' is used. Note that this can also be provided via RiakObject passed in via withContent() and doing so will take precidence over this method.
Parameters:
- 
                        
bucketTypeStringthe bucket type in riak
 
withCallback
        - 
                        
callback 
Set the callback to be executed when the operation completes.
Parameters:
- 
                        
callbackFunctionThe allback to be executed when the operation completes.
- 
                                    
errStringAn error message. Will be null if no error.
 - 
                                    
responseObjectThe response from Riak
- 
                                                
vclockBufferThe vector clock for this object (and its siblings) - 
                                                
valuesObject | RiakObject[]An array of one or more values. Either RiakObjects or JS objects if convertToJs was used. - 
                                                
generatedKeyStringThe key generated by Riak if one was not supplied. 
 - 
                                                
 
 - 
                                    
 
withContent
        - 
                        
value 
Set the value and its metadata to be stored in Riak. If a JS object is supplied, it will be converted to JSON using JSON.stringify()
Parameters:
- 
                        
valueRiakObject | String | Buffer | Objectthe data to store in Riak
 
withDw
        - 
                        
dw 
Set the DW value. How many replicas to commit to durable storage before returning a successful response. If not set the bucket default is used.
Parameters:
- 
                        
dwNumberthe DW value.
 
withIfNoneMatch
        - 
                        
ifNoneMatch 
Set the if_none_match flag.
Setting this to true means store the value only if this bucket/key combination are not already defined.
Be aware that there are several cases where this may not actually happen. Use of this option is discouraged.
Parameters:
- 
                        
ifNoneMatchBooleanthe if_non-match value.
 
withIfNotModified
        - 
                        
ifNotModified 
Set the if_not_modified flag.
Setting this to true means to store the value only if the supplied vclock matches the one in the database.
Be aware there are several cases where this may not actually happen. Use of this feature is discouraged.
Parameters:
- 
                        
ifNotModifiedBooleanthe if_not_modified value.
 
withKey
        - 
                        
key 
Set the key. If not set, riak will generate and return a key. Note that this can also be provided via RiakObject passed in via withContent() and doing so will take precidence over this method.
Parameters:
- 
                        
keyStringthe key in riak.
 
withPw
        - 
                        
pw 
Set the PW value. How many primary nodes must be up when the write is attempted. If not set the bucket default is used.
Parameters:
- 
                        
pwNumberthe PW value.
 
withReturnBody
        - 
                        
returnBody - 
                        
[convertToJs] - 
                        
[conflictResolver] 
Return the object after storing (including any siblings). If siblings are present, an optional conflictResolver can be provided to resolve them.
Parameters:
- 
                        
returnBodyBooleantrue to return the object.
 - 
                        
[convertToJs]Boolean optionalconvert the returned value(s) to JS objects using JSON.parse()
 - 
                        
[conflictResolver]Function optionalthe conflict resolver
- 
                                    
riakobjectsRiakObject[]array of RiakObjects returned by Riak.
 
 - 
                                    
 
withReturnHead
        - 
                        
[conflictResolver] - 
                        
returnHead 
Return the metadata after storing the value.
Causes Riak to only return the metadata for the object. If siblings are present, an optional conflictResolver can be provided to resolve them.
Parameters:
- 
                        
[conflictResolver]Function optionalthe conflict resolver
- 
                                    
riakobjectsRiakObject[]array of RiakObjects returned by Riak.
 
 - 
                                    
 - 
                        
returnHeadBooleantrue to return only metadata.
 
withTimeout
        - 
                        
timeout 
Set a timeout for this operation.
Parameters:
- 
                        
timeoutNumbera timeout in milliseconds.
 
withVClock
        - 
                        
vclock 
Set the vector clock. Convenience method if a RiakObject is not supplied as content. Note that a vclock supplied via RiakObject in withContent() will have precendence over this.
Parameters:
- 
                        
vclockBuffera vector clock returned from a previous fetch
 
withW
        - 
                        
w 
Set the W value. How many replicas to write to before returning a successful response. If not set the bucket default is used.
Parameters:
- 
                        
wNumberthe W value.
 
