43442 发表于 2014-4-4 10:33:39

Redis数据类型及其操作—Hashes


hash commands in redis命令语法描述示例备注
HSETHSET key-name key value添加key-value到hash中HSET hash-key key1 value1
HGETHGET key-name key返回hash中key的值HGET hash-key key1
HDELHGET key-name key删除hash的keyHDEL hash-key key1
HMSETHMSET key-name key value 一次添加多个key-value到hash中HMSET hash-key2 key1 value1 key2 value2
HMGETHMGET key-name key 一次返回多个key的值HMGET hash-key2 key1 key2
HLENHLEN key-name返回hash元素个数HLEN hash-key2
HEXISTSHEXISTS key-name key判断是否包含key的键HEXISTS hash-key2 key2
HKEYSHKEYS key-name返回hash中所有keyHKEYS hash-key2key1 key2
HVALSHVALS key-name返回hash中所有valueHVALS hash-key2value1 value2
HGETALLHGETALL key-name返回所有key-valueHGETALL hash-key2
HINCRBYHINCRBY key-name key count对hash中key的值增加countHINCRBY hash-key2 key3 1
HINCRBYFLOATHINCRBYFLOAT key-name key count对hash中key的值增加countHINCRBY hash-key2 key3 2.0







页: [1]
查看完整版本: Redis数据类型及其操作—Hashes