|
Redis hash is a mapping table of fields and values of type String, which is particularly suitable for storing objects. Each hash in Redis can store 232 - 1 key-value pairs (over 4 billion).
In the above example, we set some description information (name, descrip{filter}tion, likes, visitors) of redis to the w3ckey of the hash table.
Redis hash commandThe following table lists the basic related commands for redis hash: | serial number | Command and description | | 1 | HDEL key field2 [field2] Delete one or more hash table fields | | 2 | HEXISTS key field Check the hash table key for the specified field. | | 3 | HGET key field Gets the value /td > stored in the specified field in the hash table | | 4 | HGETALL key Get all the fields and values that specify the key in the hash table | | 5 | HINCRBY key field increment Add an increment to the integer value of the specified field in the hash table key. | | 6 | HINCRBYFLOAT key field increment Add an increment to the floating-point value of the specified field in the hash table key. | | 7 | HKEYS key Get the fields in all hash tables | | 8 | HLEN key Get the number of fields in the hash table | | 9 | HMGET key field1 [field2] Get the values for all given fields | | 10 | HMSET key field1 value1 [field2 value2 ] Set multiple field-value pairs to the hash table key at the same time. | | 11 | HSET key field value Set the value of the field in the hash table key to value. | | 12 | HSETNX key field value Set the value of the hash table field only if the field field does not exist. | | 13 | HVALS key Get all the values in the hash table | | 14 | HSCAN key cursor [MATCH pattern] [COUNT count] Key-value pairs in the iteration hash table. |
|