JsStore provides you a way to update data with arithmetic operators.

e.g - Let's say, you want to add 5 to current stored data.

var rowsUpdated = await connection.update({
    in: "Table_Name",
    set: {
        Column1: {
            '+': value1
        },
        Column2: value2
    },
    where: {
        Column3: some_value,
        Column4: some_another_value
    }
});
alert(rowsUpdated + ' rows updated');

Example

Supported operators are -


  • ' + ' : Add value to stored value
  • ' - ' : Substract value from stored value
  • ' * ' : Multiply with stored value
  • ' / ' : Divide with stored value by supplied value
  • ' {push} ' : Push an item to stored value. Works only if stored value is an array otherwise throws exception.