Type: Hash¶
Set¶
HSET¶
- Syntax:
HSET key field value [field value ...]
- Description: Set one or more pair of field-value.
HSETNX¶
- Syntax:
HSETNX key field value
- Description: Set a pair of field-value if key is not exist.
HMSET¶
- Syntax:
HMSET key field value [field value ...]
- Description: Set more pair of field-value.
Get¶
HGET¶
- Syntax:
HGET key field
- Description: Gets the value of field at Hash named
key
.
HMGET¶
- Syntax:
HMGET key field [field ...]
- Description: Gets more values of fields at Hash named
key
.
HGETALL¶
- Syntax:
HGETALL key
- Description: Gets all pair of field-value at Hash named
key
.
HRANDFIELD¶
- Syntax:
HRANDFIELD key [count [WITHVALUES]]
- Description: Returns a random key from the Hash named
key
.Count
is 1 by default.
HKEYS¶
- Syntax:
HKEYS key
- Description: Returns all fields of the Hash named
key
.
HVALS¶
- Syntax:
HVALS key
- Description: Returns all values of the Hash named
key
.
HEXISTS¶
- Syntax:
HEXISTS key field
- Description: Returns whether the field exists in Hash named
key
.
Del¶
HDEL¶
- Syntax:
HDEL key field [field ...]
- Description: Removes one or more pair field-value from the Hash named
key
.
Length¶
HLEN¶
- Syntax:
HLEN key
- Description: Returns the number of field-value in Hash named
key
.
HSTRLEN¶
- Syntax:
HSTRLEN key field
- Description: Returns the length of field's value in Hash named
key
.
Calculation¶
HINCRBY¶
- Syntax:
HINCRBY key field increment
- Description: Increases increment from a numeric value, similar
key.field++
.
HINCRBYFLOAT¶
- Syntax:
HINCRBYFLOAT key field increment
- Description: Increases a float value to a numeric value.