Getting Started with Redis (collection)

Source: Internet
Author: User

CollectionA collection of Redis is an unordered collection of strings. In Redis you can add, delete, and test whether a file exists, in member O (1) time complexity. Example
redis 127.0.0.1:6379> Sadd Tutoriallist redis   (integer) 1  REDIS   
127.0.0.1:6379> Sadd tutoriallist MongoDB   redis   
127.0.0.1:6379> Sadd tutoriallist RABITMQ   redis   
127.0.0.1:6379> Sadd tutoriallist RABITMQ   redis   
127.0.0.1:6379> Smembers tutoriallist  

Note: in the example above, the RABITMQ collection is added two times, but because the collection element has a unique property.

The maximum number of elements in the collection is 232-1 (4294967295, which can hold more than 4 billion elements).

Ordered collectionan ordered collection of Redis is similar to a collection of Redis, a collection of strings that are not duplicates. The difference is that each member of an ordered set uses fractions in order to take an ordered set command, from the smallest to the largest member score. Although members are unique, the scores may be duplicated.
Example
redis 127.0.0.1:6379> Zadd Tutoriallist 0 redis   (integer) 1  REDIS   
127.0.0.1:6379> zadd tutoriallist 0 MongoDB   redis   
127.0.0.1:6379> zadd tutoriallist 0 RABITMQ   redis   
127.0.0.1:6379> zadd tutoriallist 0 RABITMQ   redis   
127.0.0.1:6379> zrangebyscore tutoriallist 0 1) "Redis" 2) "MongoDB" 3) "RABITMQ"


 


From for notes (Wiz)

Getting Started with Redis (collection)

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.