Reputation: 2755
Assuming that myhash
is like:
redis 127.0.0.1:6379> HSET myhash field1 "foo"
(integer) 1
redis 127.0.0.1:6379> HSET myhash field2 "bar"
(integer) 1
redis 127.0.0.1:6379> HGETALL myhash
1) "field1"
2) "Hello"
3) "field2"
4) "World"
How can I get number of myhash
elements, that is 2
, from redis-cli?
I'm learning redis from this tutorial but could not find my answer there.
Upvotes: 3
Views: 3386