Skip to content

Increment

Description

This operation increments the key's value by a specific number.

Method

Backendless.Hive(hiveName).KeyValueStore().increment(key, amount);

where:

Argument                Description
hiveName Name of a hive where the operation is performed. String value.
key Key name identifying a key-value pair. String value.
amount A number to increment the value of the key.

Return Value

Тhe incremented value.

Example

The example below increments the value associated with the key "John" by 2.

Backendless.Hive("workedHours").KeyValueStore().increment("John", 2);

where:

Argument                Description
"workedHours" Name of a hive where the operation is performed.
"John" Key name to increment the associated value by 2.

Codeless Reference

keyvalue_api_increment

where:

Argument                Description
hive name Name of a hive where the operation is performed.
key name Key name identifying a key-value pair.
increment by Specify a number to increment the value by.

Returns the incremented value.

Consider the following Key Value storage:

keyvalue_api_example_increment_decrement

The example below increments the value for the "Apples" key by 2:

keyvalue_api_example_increment


The key-value storage will look as shown below after the Codeless logic runs:
keyvalue_api_example_increment_2