redis data type of dictionary

1、hset

hset(name, key, value)
 # 参数:
     # name,redis的name
     # key,name对应的hash中的key
     # value,name对应的hash中的value

2、hmset

hmset (name, Mapping)
 # Batch setting the value of the name corresponding to the hash 
# parameters: 
    # name, the name Redis 
    # Mapping, dictionaries, such as: { 'k1': 'v1 ', 'k2': 'v2' }

3, hget

hget (name, key)    
 # acquired value acquired in accordance with the corresponding hash key in the name

4, hmget

hmget (name, Keys, * args)
 # obtain a plurality of values in the name of the key corresponding to the hash 
# parameters: 
    # name, the corresponding name Reids 
    # Keys, to obtain key set, such as: [ 'k1', 'k2 ' , 'K3'] 
    # * args, to get the key, such as: K1, K2, K3 
    # Keys or * args

5、hgetall

hgetall (name)
 # get name of all the corresponding hash key 
# generally do not, can lead to explosion stack

6, choose

hlen (name)
 # Get the number corresponding to the name of the hash key value

7、hkeys

hkeys (name)
 # acquired name corresponding to the hash value of all of the key

8, whales

hvals (name)
 # acquired name corresponding to the hash value of all the values

9、hexits

hexists (name, key)
 # Check the name corresponding hash whether there is a current passed key

10, the

HDEL (name, * Keys)
 # The name specified in the corresponding hash key value pairs deleted

11、hincrby

hincrby (name, key, AMOUNT =. 1 )
 # increment name corresponding to the hash value of the specified key, does not exist, create key = AMOUNT 
# parameters: 
    # name, Redis the name 
    # key, the corresponding hash key 
    # AMOUNT , ever-increasing number (integer)

12, hscan_iter scan

hscan_iter (name, match = None, COUNT = None)
 # use package hscan create generator yield, to achieve a batch redis acquired data 
# parameters: 
    # match, matches the specified key, the default None indicates all Key 
    # COUNT, each minimum number of slices acquired, using default Redis None indicates default slice number 
# as: 
    # for r.hscan_iter in Item ( 'XX'): 
    #      Print Item

 

Guess you like

Origin www.cnblogs.com/wt7018/p/11568585.html