Redis: Hashes Cheat Sheet

Hdel Command

redis 127.0.0.1:6379> HDEL KEY_NAME FIELD1.. FIELDN

Hexists Command

redis 127.0.0.1:6379> HEXISTS KEY_NAME FIELD_NAME

Hget Command

redis 127.0.0.1:6379> HGET KEY_NAME FIELD_NAME 

Hgetall Command

redis 127.0.0.1:6379> HGETALL KEY_NAME 

Hincrby Command

redis 127.0.0.1:6379> HINCRBY KEY_NAME FIELD_NAME INCR_BY_NUMBER

Hincrbyfloat Command

redis 127.0.0.1:6379> HINCRBYFLOAT KEY_NAME FIELD_NAME INCR_BY_NUMBER 

Hkeys Command

redis 127.0.0.1:6379> HKEYS KEY_NAME FIELD_NAME INCR_BY_NUMBER 

Hlen Command

redis 127.0.0.1:6379> HLEN KEY_NAME

Hmget Command

redis 127.0.0.1:6379> HMGET KEY_NAME FIELD1...FIELDN 

Hset Command

redis 127.0.0.1:6379> HSET KEY_NAME FIELD VALUE

Hsetnx Command

redis 127.0.0.1:6379> HSETNX KEY_NAME FIELD VALUE

Hvals Command

redis 127.0.0.1:6379> HVALS KEY_NAME FIELD VALUE

Leave a Reply

Your email address will not be published.