i got a redis hash eg
key field value
1000 state "ca"
1000 zip "95054"
2000 state "ca"
2000 zip "95050"
3000 state "ny"
3000 zip "12345"
how can i answer questions like how many state are “CA” . i need to do count of values for a field. is it possible ? help would be appreciated.
-Avi
I think you need to store a separate count for the unique values. You can get the length of a single hash, but not when you in this case got three different keys.
command key field value
If you want to get how many hash keys with state "ca" use: