API ReferenceHashes
HIncrementByFloat
Atomically increment a floating-point field in a hash
Syntax
Redix.HIncrementByFloat(key, field, amount, callback)Parameters
Prop
Type
Returns
Prop
Type
Examples
-- Increment player rating
Redix.HIncrementByFloat('player:123:stats', 'rating', 0.5, function(err, newRating)
if not err then
print('New rating:', tonumber(newRating))
end
end)
-- Update balance
Redix.HIncrementByFloat('player:123:wallet', 'balance', 150.75)