R
R
Raccoon Raccoons2015-12-28 17:34:49
Redis
Raccoon Raccoons, 2015-12-28 17:34:49

How to return values ​​by filter in Redis?

https://github.com/phpredis/phpredis
in the database There are entries like this:

$redis->hSet('user_1', 'banan1', 'hello1'); 
$redis->hSet('user_1', 'arbuz_1', 'hello2'); 

$redis->hSet('user_2', 'arbuz_1', 'hello3'); 
$redis->hSet('user_2', 'arbuz_2'', 'hello4');  
$redis->hSet('user_2', 'mandarinn_1', 'hello5');

Tell me pliz how to get all the values ​​of the User_2 elements that store watermelons?
those. Logically, you need something like :
var_dump( $redis->hget('user_2', 'arbuz_*'));
but the asterisk doesn't work here.
Is it possible to implement this somehow on redis?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question