API Docs for: 2.2.2
Show:

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

()

Methods

addToSet

(
  • key
  • value
)
chainable

Add a value to a set (and create is necessary) in a map.

Parameters:

  • key String

    the key for the set in the map.

  • value String | Buffer

    the value to add to the set.

incrementCounter

(
  • key
  • increment
)
chainable

Increment (and/or create) a counter inside the map.

Parameters:

  • key String

    the key in the map for this counter.

  • increment Number

    the amount to increment (or decrement if negative)

map

(
  • key
)
chainable

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 String

    the key for the nested map in the current map.

removeCounter

(
  • key
)
chainable

Remove a counter from a map.

Parameters:

  • key String

    the key in the map for this counter.

removeFlag

(
  • key
)
chainable

Remove a flag from a map.

Parameters:

  • key String

    the key for the flag in the map.

removeFromSet

(
  • key
  • value
)
chainable

Remove a value from a set in a map.

Parameters:

  • key String

    the key for the set in the map.

  • value String | Buffer

    the value to remove from the set.

removeMap

(
  • key
)
chainable

Remove a map from a map.

Parameters:

  • key String

    the key for the map in the map.

removeRegister

(
  • key
)
chainable

Remove a register from a map.

Parameters:

  • key String

    the key for the register in the map.

removeSet

(
  • key
)
chainable

Remove a set from a map.

Parameters:

  • key String

    the key for the set in the map.

setFlag

(
  • key
  • value
)
chainable

Set a flag in a map.

Parameters:

  • key String

    the key for the set in the map.

  • value Boolean

    the value for the flag.

setRegister

(
  • key
  • value
)
chainable

Set a register in a map.

Parameters:

  • key String

    the key for the register in the map.

  • value String | Buffer

    the value for the register.