Closed
Description
Testing #22302
I'm looking at the 'Replace the database' section. I'm new to Redis.
It explains nicely what line I need to replace with what, but I'm puzzled of what the new code means and how redis works.
redis_client.hincrby(f"item_id:{item_id}", "quantity", quantity)
what does this call do? What is hincrby
. What's the effect to the database?
Maybe it is easier to start with the set:
redis_client.hset(
f"item_id:{item_id}",
mapping={
"item_id": item_id,
"item_name": item_name,
"quantity": quantity,
})
This seems to store an object with multiple properties. And hincrby
allows to increment one of the properties?