redis common data types and operations 02

hash

   1.hash for storing objects, the format of the object's key

   command:

   Setting:

        1. Set the individual properties: hset key field value key: delegate property field: attribute name representative of value: the value of the property

        2. plurality of attributes: hmset key field value [field value .......]

        3. Get a property value: hget key field

        4. Get the plurality of property values: hmget key field [field ....]

        5. Obtain all property values: hgetall key

        6. Get all the attributes: hkeys key

        7. Return the number of attributes comprising: hlen key

        8. Get all values: hvals key

 

list 

       1. The list of element types to string

       2. Insert sequential ordering

       3. Add the element at the head or tail of the list

Set up

     1. Insert the data in the header: lpush key value [value ....]

     2. Insert the data at the end: rpush key value [value ....] 

     3. Before an element | linsert key before inserting a new element after | after pivot value

     4. Set the index of the specified element value

         The index is based on the index 0

         Indices may be negative, it represents the offset list is counted from the tail, as a -1 is the last element in the list

         lset  key   index  value 

  Obtain

       1. Remove the first element and returns the corresponding list of key: lpop key  

       2. Remove the last element stored in the key and return to the list of: RPOP key

          Returns the specified element is stored within the scope of the list's key

          start and end offsets are based on the index 0

Unfinished. . . . . . . . . . . . . . . . . . . . . . . . . . . . .

 

   

       

     

       

 

Guess you like

Origin www.cnblogs.com/yingxiongguixing/p/11600473.html