Answer the question
In order to leave comments, you need to log in
How to store an associative array in redis?
I read in the guides that you can store a bunch of everything in redis, and even there seemed to be a point that associative arrays are possible. However, it gives an error and I managed to save so far only in a JSON string. That would be enough, but with Russian characters the length of the string becomes 4 times longer and takes up 4 times more memory.
Answer the question
In order to leave comments, you need to log in
An associative array is a hash, respectively a group of commands for this data type: https://redis.io/commands/hgetall
(looking at the tags) For example phpredis are implemented
example from here
$redis->hMSet('user:1', array('name' => 'Joe', 'salary' => 2000));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question