Home > Redis > Redis Learning Note – 07 Command in Redis (Hash)

Redis Learning Note – 07 Command in Redis (Hash)

HMGET key field [field …]
Returns the values associated with the specified fields in the hash stored at key.
For every field that does not exist in the hash, a nil value is returned. Because a non-existing keys are treated as empty hashes, running HMGET against a non-existing key will return a list of nil values.
HDEL key field [field …]
Removes the specified fields from the hash stored at key. Specified fields that do not exist within this hash are ignored. If key does not exist, it is treated as an empty hash and this command returns 0.
HLEN key
Returns the number of fields contained in the hash stored at key.
01

02

HEXISTS key field
Returns if field is an existing field in the hash stored at key.
HKEYS key
Returns all field names in the hash stored at key.
HVALS key
Returns all values in the hash stored at key.
HGETALL key
Returns all fields and values of the hash stored at key. In the returned value, every field name is followed by its value, so the length of the reply is twice the size of the hash.
03

 

HINCRBY key field increment
Increments the number stored at field in the hash stored at key by increment. The range of values supported by HINCRBY is limited to 64 bit signed integers.
HINCRBYFLOAT key field increment
Increment the specified field of an hash stored at key, and representing a floating point number, by the specified increment. An error is returned if one of the following conditions occur:
The field contains a value of the wrong type (not a string).
The current field content or the specified increment are not parsable as a double precision floating point number.
04

Source: http://redis.io/commands#hash

Categories: Redis
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: