I would like to get all keys, with its values, from a hash, where the keys match a specific pattern. I use redis with the c# library ServiceStack.Redis.
I have found the command Keys with a pattern
: http://redis.io/commands/keys if it is simple string_key -- string_val but nothing if its within a hash.
There is List<string> GetValuesFromHash(string hashId, params string[] keys);
but it only works if the keys perfectyl match the keys in redis. A key:*
would return null
e.g.
myHash =
key:1 -- val1,
asdf -- asdfe,
key:2 -- val2
Now I would like to get all keys with its values from myHash
if the key, within the hash, matches the following pattern: key:*
That would result in
key:1 -- val1,
key:2 -- val2