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:
-
options
ObjectThe options for this command.
-
[bucketType=default]
String optionalThe bucket type in riak. If not supplied 'default' is used.
-
bucket
StringThe bucket in riak.
-
[key]
String optionalThe key for the object you want to store.
-
[vclock]
Buffer optionalThe vector clock to use.
-
value
RiakObject | 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.
-
objects
RiakObject[] | 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.
-
-
callback
FunctionThe allback to be executed when the operation completes.
-
err
StringAn error message. Will be null if no error.
-
response
ObjectThe response from Riak
-
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. -
generatedKey
StringThe key generated by Riak if one was not supplied.
-
-
data
Objectadditional 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:
-
msg
Stringan error message -
data
Objectadditional error data
onRiakError
-
rpbErrorResp
Parameters:
-
rpbErrorResp
Objectthe RpbErrorResp protocol buffer
onSuccess
-
pbResponseMessage
Parameters:
-
pbResponseMessage
Objectthe protocol buffer received from riak