If you just want to search inside a hash key as in the screenshot, you can use HSCAN
to traverse all the fields of the hash, this returns the value as well. Then test for the value client-side. Or, you can move this logic to a Lua script
to do it Redis-server-side.
If you want to search in all the keys, consider the following:
- You will need to traverse the whole keyspace, key by key, using
SCAN
.
- Depending on the type, perform the search inside the key.
- Sets and sorted sets can be searched with SSCAN and ZSCAN for values, using
MATCH
option.
- For all other types, you need to do the search by your own.
Again, you can implement the above in a Lua script for a more efficient implementation. This answer can get you started.