Hash
HINCRBYFLOAT
Increments the value of a hash field by a given float value.
await redis.hset("key", {
field: 20,
});
const after = await redis.hincrby("key", "field", 2.5);
console.log(after); // 22.5
Arguments
key
string
requiredThe key of the hash.
field
string
requiredThe field to increment
increment
float
requiredHow much to increment the field by. Can be negative to subtract.
Response
The new value of the field after the increment.
await redis.hset("key", {
field: 20,
});
const after = await redis.hincrby("key", "field", 2.5);
console.log(after); // 22.5