Redis ordered collection command using-zset

Source: Internet
Author: User
Tags set set

Zset Features:

Like set set, ordered, element is a string, each element is associated with a floating point value, and in the order of the score from small to large

zadd: Add one or more elements

Zadd Key [nx| XX] [CH] [INCR] score member [score member ...]

127.0.0.1:6379> Zadd bus 200000.01127.0.0.1:6379> zadd bus 300000.51127.0.0.1:6379> ZADD Bus 400000.81127.0.0.1:6379> zadd bus 650000.01127.0.0.1:6379> zadd bus 800000.51

zrem: Remove one or more elements

  Zrem key member [member ...]

127.0.0.1:6379>1127.0.0.1:6379>1127.0.0.1:6379>1127.0.0.1:6379>  1127.0.0.1:6379>1

Zscore: Show score

127.0.0.1:6379> Zscore bus Land Rover "850000.90000000002"

Zincrby:

  Zincrby Key Increment member

127.0.0.1:6379> Zscore bus Land Rover "850000.90000000002"127.0.0.1:6379> Zincrby Bus 100000.9 Land Rover "950001.80000000005"127.0.0.1:6379> zincrby bus-100000.9  Land Rover "850000.90000000002"

Redis ordered collection command using-zset

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.