How does redis search for field values?

the data is designed as follows:

assume that the user information is stored below,

127.0.0.1:6379> HMSET user:1 username  age 11 status 1
OK
127.0.0.1:6379> HMSET user:2 username  age 12 status 0
OK
127.0.0.1:6379> HMSET user:3 username  age  11 status 1
OK
127.0.0.1:6379> HMSET user:4 username  age 13 status 0
OK

so I want to use the value of the status field to find out what all status=1 users should do. Or there is a problem with such a design. Thank you for your guidance.

Mar.14,2021

redis itself does not support such an operation! Then you might as well use elasticsearch


suggest new set: key-> status value- > userid

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea3588-1c49.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea3588-1c49.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?