Redis Learning Note (14)--redis Common operation Instruction (v)

Source: Internet
Author: User
Tags min redis
Zset ordered set common operation instruction

The ordered set is based on the set, adding a score value, such as the previous set is K v1 v2 v3, now Zset is k score1 v1 score2 v2 score3 v3
Zadd key score value [score value]

Adding elements to an ordered collection

Zrange key start stop [Withscores]

Intercepts a collection element based on a given start and end position

If the withscores is not with a parameter, only the value is shown, with this argument, the score and the value

Zrangebyscore key min Max [withscores] [limit offset count]

Get the contents of a collection element based on minimum and maximum fractions

The optional LIMIT parameter specifies the number and range of results returned

You can also use the left parenthesis, which means it does not contain boundary values.

Zrem Key value

Delete Element

Zcard Key

Gets the number of elements in an ordered collection

Zcount Key min Max

Gets the number of elements in the specified fractional interval

Zrank Key value

Gets the subscript corresponding to the given value

Zrevrank Key value

After the collection is flipped, gets the subscript for the given value

Zrevrange key start stop [Withscores]

Flip a Collection

Zrevrangebyscore key Max min [withscores] [limit offset count]

Gets the contents of the collection element based on the maximum and minimum fractions

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.