Redis–sort set type operation

Source: Internet
Author: User

Sort set operation: Sort set adds a column to the set base for storing sequential sequences
Set Operation:
Zadd Key:zadd Key Sortnum value specifies that the key increment element, if value exists, update sortnum
Zrem:zrem key value deletes the value of the specified key
Zincrby:zincrby Key Sortnum value specifies that the sequence of key-value is self-increment and does not exist add
Zremrangebyrank zremrangebyrank Key POS1 pos2 Delete the specified key from small to large after ordering the elements in the POS1 to Pos2 range
Zremrangebyscore zremrangbyscore Key SORTNUM1 sortnum2 Delete the specified key from small to large after ordering the elements within SORTNUM1 to sortnum2

Query operation:
Zrange zrange key pos1 pos2 (withscores) query specifies key from POS1 to Pos2 value, from small to large, plus withscores outputs the sequence together
Zrevrange zrange key pos1 pos2 (withscores) query specifies key from POS1 to Pos2 value, small sort from avenue, plus withscores outputs the sequence together
Zrank:zrank key value is sorted from small to large, returning the subscript position of the specified Key-value
Zrevrank Zrevrank key value from large to small sort, returns the subscript position of the specified Key-value
Zrangebyscore zrangebyscore Key Sortnum1 sortnum2 Returns the value in the specified Sortnum size interval
Zcount:zcount Key Sortnum1 Sortnum2 Returns the number of value in the specified Sortnum size interval
Zcard:zcard Key returns the number of elements in key
Zscore Zscore key value returns the sequence of the specified key-value

Redis–sort set type operation

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.