Redis database of basic data management operations

  To understand and master a variety of data types the command mode of operation, and the operation of various types of data values. Meanwhile, skilled memory list, the hash, and the set of ordered set of common data types operation command. To complete instructions in accordance with the corresponding instruction format.

①string data type of exercise

  APPEND KEY VALUE

  GETRANGE KEY START END

  SETRANGE KEY OFFSET VALUE

  GETBIT KEY OFFSET

  SETBIT KEY OFFSET VALUE

  INCRBY KEY-NAME amount

  Decrby key-name amount

②LIST data type of exercise

  Hrifusः \ Lafusः

  LRANGE \ Capellen \ Lpop \ RPOP

  LINDEX

  LTRIM \ LINSERT \ LSet

 

single SET operation

  SADD key-name item1 item2

  SREM key-name item1 item2

  SISMEMBER key-name item

  SMEMBERS key-name

  SCARD key-name

  SRANDMEMBER key-name

  SPOP key-name

④ plurality SET operation

  SMOVE source destination member

  SINTER KEY1 KEY2

  SUNIOU KEY1 KEY2

  SDIFF  KEY1 KEY2

⑤ ordered collection / Zset

  ZADD KEY SCORE MEMBER

  ZCARD KEY

  ZCOUNT KEY MIN MAX

  Zrankou

  ZINCRBY

  ZRANGEBYSCORE/ ZREVRANGEBYSCORE /ZREGEVANCE

⑥Hash / hash / hash

  HSET Key Field value

  HGET Key Field

  HEXISTS key field

  HLEN KEY

  Hincrby

  Hmset

  Hgetall

  Hkeys

  whales

  Hmset

  Hgetall

  Hkeys

  whales

 

to sum up

In this study, the summary and relevant experience harvesting, can be divided into the following points:

  1. Through the experiment, to learn how to use the commands way REDIS database management functions. A preliminary understanding of the various types of command data mode of operation, as well as various types of data values. At the same time, to complete the basic instructions in accordance with the corresponding instruction format.
  2. When the collection of the experiment and the ordered set is operated, part of the instructions related concepts SCORE. At the same time, basically mastered the difference between a collection and an ordered set, the key is: there is no set of weights, and there is an ordered set of weights that meaning.
  3. During the experiment, without first on the concept of "key" to give "value", and takes the value or manipulate the values, then you will be prompted redis non-empty or direct error. The key is to have a clear stroke order period. Part of the data type of instruction is to add the prefix plus the ADD, and some part is the prefix plus the set, which is the same reason for removing elements. Thus, requirements for successful operation of the instruction is the degree of memorizing the instruction type.

 

Guess you like

Origin www.cnblogs.com/Raodi/p/11590095.html