Redis 4: unordered collection of Storage types

Source: Internet
Author: User

 1  . Sadd num a B C add three ABC elements to the num set  2  . Srem num B: delete Element B from the num set  3  . Smembers num get all elements in the num set  4  . Sismember num C judge whether C exists in the num set ================================== 5  . Operation sadd num a B c sadd num2 a B c d difference set (calculate the portion on the left more than the portion on the right): sdiff num  2 Returns the null sdiff num2 num and returns the intersection of D (the part that is simultaneously on the left and right) sinter num num2 returns a B c Union (merges the elements on both sides of the left and right without duplicates) sunion num num2 returns a B c d ==================================== 6  . Scard num gets the number of elements in the num set.  7  . Sdiffstore num3 num2 num: place the result of the difference set between num and num2 to the num3 set.  8  The intersection of. sinterstore and above  9  . Sunionstore same as above  10 . Srandmember num count random acquisition of Random Elements in count num
11. spop num randomly pops up an element from the num set.
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.