Redis Command Reference (ii)

Source: Internet
Author: User

The above one is mostly for the processing of the ordered collection, here the common operation commands are introduced.

First, INCR : atomic operation Anti-concurrency , the key value from 1, if the non-numeric error , if there is no key, it is automatically created .

INCR  Key Example:    INCR  myNum    // If MyNum does not exist, it is initialized to 0 and self-increment to 1

Typical use: counters: such as statistical options, statistics page access, in-game recording scores

      Limiter: Typical usage is to limit the number of requests that expose the API

Second, Incrby: ibid., increment a value from a key value

Incrby  Key  Increment example:    incrby  8  //mynum self-increment 8, if non-numeric error. 

 - 3  on day, then execute the command INCR Peter::2012.3.  A . You can extend this simple pattern in several ways: by combining INCR and EXPIRE, you can achieve the purpose of counting only within the specified lifetime (counting). The client can atomically get the current value of the counter and clear the counter by using the Getset command, for more information refer to the Getset command. With other self-increment /decrement operations, such as DECR and Incrby, users can increase or decrease the value of the counter by performing different actions, such as the use of these commands in the game's scoreboard.

Third, SCAN : Iterate the walker, return the array, the first element is the next cursor, the second element is the array of values traversed.

A cursor of 0 o'clock indicates that the traversal begins, and if the next cursor returned is 0 o'clock, the traversal is complete.

Parameter two:match: Similar to the one in MySQL, the filter function.

           count: Iterating to an array of values

Redis Command Reference (ii)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.