redis hash data types

 Hash 

 hset set hash table fields

     hset 8000 ename tom   hset 8000 job salesman

      hget 8000 ename  "tom"

 

 hget Gets the hash table field values 

 hmget acquiring a plurality of hash table field values 

 hgetall get all the hash table field values 

 

 a plurality of fields provided hash table hmset

     hmset  8000 ename tom   job salesman  deptno

   

 hkeys get all the hash table field names

      hkeys 9000    

         "ename"
         "job"

 hvals get all the hash table field values

        1) "tom"

         2) "salesman"

 

 hlen Gets the number of fields

     9000 choose 2

hexists hash table to determine whether there is a field

  hexists 8000 job 1 exists 0 does not exist

 

hdel delete the field hash table

   hdel 8000 job

 

hincrby: Let the hash table a field value plus a specified integer value (you can add a negative number)

   hincrby 8000 deptno 10

 

hincrbyfloat: Let the hash table a field value plus a specified floating-point (you can add a negative number)

   hincrby 8000 deptno 10.5

 

Guess you like

Origin www.cnblogs.com/ericblog1992/p/11389025.html