StoreValue Class
Command used to store data in Riak.
As a convenience, a builder class is provided:
var storeValue = new StoreValue.Builder()
.withBucket('myBucket')
.withKey('myKey')
.withContent(myObj)
.build();
Constructor
StoreValue
-
options -
callback
Parameters:
-
optionsObjectThe options for this command.
-
[bucketType=default]String optionalThe bucket type in riak. If not supplied 'default' is used.
-
bucketStringThe bucket in riak.
-
[key]String optionalThe key for the object you want to store.
-
[vclock]Buffer optionalThe vector clock to use.
-
valueRiakObject | String | Buffer | ObjectThe value to store in Riak. JS Objects will be passed to JSON.stringify().
-
[w]Number optionalThe W value to use.
-
[dw]Number optionalThe DW value to use.
-
[pw]Number optionalThe PW value to use.
-
[returnBody]Boolean optionalReturn the stored object and meta (incl. siblings)
-
[returnHead]Boolean optionalReturn the metatdata only for the stored object.
-
[convertToJs]Boolean optionalConvert the returned value(s) to JS objects using JSON.parse()
-
[conflictResolver]Function optionalA function used to resolve siblings to a single object.
-
objectsRiakObject[] | ObjectThe array of objects returned from Riak.
-
-
[timeout]Number optionalSet a timeout for this command.
-
[ifNotModified]Boolean optionalThe if_not_modified flag.
-
[ifNoneMatch]Boolean optionalThe if_none_match flag.
-
-
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.
-
-
dataObjectadditional 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:
-
msgStringan error message -
dataObjectadditional error data
onRiakError
-
rpbErrorResp
Parameters:
-
rpbErrorRespObjectthe RpbErrorResp protocol buffer
onSuccess
-
pbResponseMessage
Parameters:
-
pbResponseMessageObjectthe protocol buffer received from riak
