UpdateMap.MapOperation Class
Class that encapsulates modifications to a Map in Riak.
Rather than manually constructing this yourself, a fluent API is provided.
var mapOp = new UpdateMap.MapOperation();
mapOp.incrementCounter('counter_1', 50)
.addToSet('set_1', 'set_value_1')
.setRegister('register_1', new Buffer('register_value_1'))
.setFlag('flag_1', true)
.map('inner_map')
.incrementCounter('counter_1', 50)
.addToSet('set_2', 'set_value_2');
Constructor
UpdateMap.MapOperation
()
Item Index
Methods
addToSet
-
key
-
value
Add a value to a set (and create is necessary) in a map.
Parameters:
-
key
Stringthe key for the set in the map.
-
value
String | Bufferthe value to add to the set.
incrementCounter
-
key
-
increment
Increment (and/or create) a counter inside the map.
Parameters:
-
key
Stringthe key in the map for this counter.
-
increment
Numberthe amount to increment (or decrement if negative)
map
-
key
Access/create a map inside the current one. This adds/accesses a nested map and returns a reference to another MapOperation that applies to it. You can then modify the components of that map;
mapOp.map('inner_map')
.incrementCounter('counter_1', 50)
.addToSet('set_2', 'set_value_2');
Parameters:
-
key
Stringthe key for the nested map in the current map.
removeCounter
-
key
Remove a counter from a map.
Parameters:
-
key
Stringthe key in the map for this counter.
removeFlag
-
key
Remove a flag from a map.
Parameters:
-
key
Stringthe key for the flag in the map.
removeFromSet
-
key
-
value
Remove a value from a set in a map.
Parameters:
-
key
Stringthe key for the set in the map.
-
value
String | Bufferthe value to remove from the set.
removeMap
-
key
Remove a map from a map.
Parameters:
-
key
Stringthe key for the map in the map.
removeRegister
-
key
Remove a register from a map.
Parameters:
-
key
Stringthe key for the register in the map.
removeSet
-
key
Remove a set from a map.
Parameters:
-
key
Stringthe key for the set in the map.
setFlag
-
key
-
value
Set a flag in a map.
Parameters:
-
key
Stringthe key for the set in the map.
-
value
Booleanthe value for the flag.
setRegister
-
key
-
value
Set a register in a map.
Parameters:
-
key
Stringthe key for the register in the map.
-
value
String | Bufferthe value for the register.