Set Collection type Redis

Source: Internet
Author: User

  1. To add an element to a set named key:

    Command: Sadd #不允许有重复的值

  2. 2

    Delete the element in the set named key:

    Command: Srem

  3. 3

    Randomly returns and deletes an element in a set named key:

    Command: Spop #随机弹出元素

  4. Returns the difference set between all given key and the first key:

    Command: Sdiff

  5. Returns the difference between all the given key and the first key, and saves the result as another key:

    Command: Sdiffstore

  6. Returns the intersection of all given keys:

    Command: Sinter

  7. Returns the intersection of all given keys and saves the result as another key:

    Command: Sinterstore

  8. Returns the set of all the given keys:

    Command: Sunion

  9. Returns the set of all the given keys:

    Command: Sunionstore

  10. Remove the member from the set corresponding to the first key and add it to the second corresponding set:

    Command: Smove

  11. Returns the number of elements of a set named key:

    Command: SCard

  12. Test whether the member is a set element with the name key:

    Command: Sismember #判断元素里的值 exists

  13. Randomly returns an element of a set named key, but does not delete the element:

    Command: Srandmember #随机返回一个元素

    END

teach you how to use Redis (total 7 articles)

Set Collection type Redis

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.