hIncrBy

PHP Redis

hIncrBy

Description

Increments the value of a member from a hash by a given amount.

根据HASH表的KEY,为KEY对应的VALUE自增参数VALUE。

Parameters

key
member
value: (integer) value that will be added to the member's value

Return value

LONG the new value

Examples
$redis->delete('h');
$redis->hIncrBy('h', 'x', 2); /* returns 2: h[x] = 2 now. */
$redis->hIncrBy('h', 'x', 1); /* h[x] ← 2 + 1. Returns 3 */