Introduction to Redis Hashes

Commands for Hashes in Redis

 
127.0.0.1:6379> hset student chem 25
(integer) 1

127.0.0.1:6379> hset student phy 35
(integer) 1

127.0.0.1:6379> hset student nosql 2
(integer) 1

127.0.0.1:6379> hget student chem
"25"

127.0.0.1:6379> hkeys student
1 "chem"
2 "phy"
3 "nosql"

127.0.0.1:6379> hvals student
1 "25"
2 "35"
3 "2"

127.0.0.1:6379> hgetall student
1 "chem"
2 "25"
3 "phy"
4 "35"
5 "nosql"
6 "2"