Redis Common Type Data operations

Source: Internet
Author: User

SortedSet

Added: Zadd key score1 member1 score2 member2 ...

Zad Mysort Laosong Zhangsan

Obtained: Zscore Key member

Zscore Mysort Laosong

Count Members Zcard key

Zcard Mysort

Delete zrem key Member1[member2 Member3 ...]

Zrem Mysort Zhangsan

Range Query Zrange key start end [Withscores]

Zrange Mysort 0-1 Withscores

Find eligible elements in order from start to finish

Zrevrange key start stop [Withscores]

Zrevange Key Mysort 0-1 withscores

Set

Add Sadd key [value1 value2]

Sadd MySet 1 2 3

Get Smembers Key

Smembers MySet

Delete Srem key membres [members1 Member2]

Srem MySet

List

Add Lpush key value1 value2 on both ends

Rpush Key value1 value2

Get Lrange key Start end

Lrange MyList 0-1

Delete Lpop key

Rpop Key

Get number Llen key

  

General Operations Keys

View All Key:keys *

Remove the pinned Key:del key

Determine if key exists: Exists key

Rename: Rename key Newkey

View the type of the specified key (there are only five types of results): Type key

Redis Common Type Data operations

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.