{
  "schema_version": 2,
  "id": "develop/data-types/sets",
  "title": "Redis sets",
  "url": "https://redis.io/docs/latest/develop/data-types/sets/",
  "summary": "Introduction to Redis sets",
  "aliases": [
    "/data-types/sets/",
    "/manual/data-types/sets/",
    "/develop/data-types/set/"
  ],
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-10T15:45:53+01:00",
  "page_type": "content",
  "content_hash": "6d1f55beaf117976d4af09f44e24a619bc950197ae9ed5346d15780bf0f4ead6",
  "sections": [
    {
      "id": "set-command-summary",
      "title": "Set command summary",
      "role": "content",
      "text": "**19 commands in this group:**\n\n[View all set commands](https://redis.io/commands/?group=set)\n\n| Command | Summary | Complexity | Since |\n|---------|---------|------------|-------|\n| [SADD](https://redis.io/commands/sadd/) | Adds one or more members to a set. Creates the key if it doesn't exist. | O(1) for each element added, so O(N) to add N e... | 1.0.0 |\n| [SCARD](https://redis.io/commands/scard/) | Returns the number of members in a set. | O(1) | 1.0.0 |\n| [SDIFF](https://redis.io/commands/sdiff/) | Returns the difference of multiple sets. | O(N) where N is the total number of elements in... | 1.0.0 |\n| [SDIFFCARD](https://redis.io/commands/sdiffcard/) | Returns the number of members of the difference between the first set and all successive sets. | O(N) where N is the total number of elements in... | 8.10.0 |\n| [SDIFFSTORE](https://redis.io/commands/sdiffstore/) | Stores the difference of multiple sets in a key. | O(N) where N is the total number of elements in... | 1.0.0 |\n| [SINTER](https://redis.io/commands/sinter/) | Returns the intersect of multiple sets. | O(N*M) worst case where N is the cardinality of... | 1.0.0 |\n| [SINTERCARD](https://redis.io/commands/sintercard/) | Returns the number of members of the intersect of multiple sets. | O(N*M) worst case where N is the cardinality of... | 7.0.0 |\n| [SINTERSTORE](https://redis.io/commands/sinterstore/) | Stores the intersect of multiple sets in a key. | O(N*M) worst case where N is the cardinality of... | 1.0.0 |\n| [SISMEMBER](https://redis.io/commands/sismember/) | Determines whether a member belongs to a set. | O(1) | 1.0.0 |\n| [SMEMBERS](https://redis.io/commands/smembers/) | Returns all members of a set. | O(N) where N is the set cardinality. | 1.0.0 |\n\n#### Set command summary (part 2)\n\n| Command | Summary | Complexity | Since |\n|---------|---------|------------|-------|\n| [SMISMEMBER](https://redis.io/commands/smismember/) | Determines whether multiple members belong to a set. | O(N) where N is the number of elements being ch... | 6.2.0 |\n| [SMOVE](https://redis.io/commands/smove/) | Moves a member from one set to another. | O(1) | 1.0.0 |\n| [SPOP](https://redis.io/commands/spop/) | Returns one or more random members from a set after removing them. Deletes the set if the last member was popped. | Without the count argument O(1), otherwise O(N)... | 1.0.0 |\n| [SRANDMEMBER](https://redis.io/commands/srandmember/) | Get one or multiple random members from a set | Without the count argument O(1), otherwise O(N)... | 1.0.0 |\n| [SREM](https://redis.io/commands/srem/) | Removes one or more members from a set. Deletes the set if the last member was removed. | O(N) where N is the number of members to be rem... | 1.0.0 |\n| [SSCAN](https://redis.io/commands/sscan/) | Iterates over members of a set. | O(1) for every call. O(N) for a complete iterat... | 2.8.0 |\n| [SUNION](https://redis.io/commands/sunion/) | Returns the union of multiple sets. | O(N) where N is the total number of elements in... | 1.0.0 |\n| [SUNIONCARD](https://redis.io/commands/sunioncard/) | Returns the number of members of the union of multiple sets. | O(N) where N is the total number of elements in... | 8.10.0 |\n| [SUNIONSTORE](https://redis.io/commands/sunionstore/) | Stores the union of multiple sets in a key. | O(N) where N is the total number of elements in... | 1.0.0 |\n\n\n\nA Redis set is an unordered collection of unique strings (members).\nYou can use Redis sets to efficiently:\n\n* Track unique items (e.g., track all unique IP addresses accessing a given blog post).\n* Represent relations (e.g., the set of all users with a given role).\n* Perform common set operations such as intersection, unions, and differences."
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "* Store the sets of bikes racing in France and the USA. Note that\nif you add a member that already exists, it will be ignored.\nFoundational: Add members to a set using SADD when you need to store unique items (duplicates are silently ignored)\n\n**Difficulty:** Beginner\n\n**Commands:** SADD\n\n**Complexity:**\n- SADD: O(1)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\n* Check whether bike:1 or bike:2 are racing in the US.\nFoundational: Test set membership using SISMEMBER when you need O(1) lookups (much faster than checking a list)\n\n**Difficulty:** Beginner\n\n**Builds upon:** sadd\n\n**Commands:** SISMEMBER\n\n**Complexity:**\n- SISMEMBER: O(1)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\n* Which bikes are competing in both races?\nSet intersection: Find common members across multiple sets using SINTER when you need to identify shared items (e.g., users in multiple groups)\n\n**Difficulty:** Intermediate\n\n**Builds upon:** sadd\n\n**Commands:** SINTER\n\n**Complexity:**\n- SINTER: O(N*M)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\n* How many bikes are racing in France?\nFoundational: Get the cardinality of a set using SCARD when you need to count unique items efficiently\n\n**Difficulty:** Beginner\n\n**Builds upon:** sadd\n\n**Commands:** SCARD\n\n**Complexity:**\n- SCARD: O(1)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]"
    },
    {
      "id": "tutorial",
      "title": "Tutorial",
      "role": "content",
      "text": "The [`SADD`](https://redis.io/docs/latest/commands/sadd) command adds new elements to a set. It's also possible\nto do a number of other operations against sets like testing if a given element\nalready exists, performing the intersection, union or difference between\nmultiple sets, and so forth.\n\nFoundational: Retrieve all members from a set using SMEMBERS when you need the complete set (note: order is not guaranteed)\n\n**Difficulty:** Beginner\n\n**Builds upon:** sadd\n\n**Commands:** DEL, SADD, SMEMBERS\n\n**Complexity:**\n- DEL: O(N)\n- SADD: O(1)\n- SMEMBERS: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\nHere I've added three elements to my set and told Redis to return all the\nelements. There is no order guarantee with a set. Redis is free to return the\nelements in any order at every call.\n\nRedis has commands to test for set membership. These commands can be used on single as well as multiple items:\n\nBatch membership checks: Test multiple items at once using SMISMEMBER when you need to reduce round trips to the server\n\n**Difficulty:** Intermediate\n\n**Builds upon:** sismember\n\n**Commands:** DEL, SADD, SISMEMBER, SMISMEMBER\n\n**Complexity:**\n- DEL: O(N)\n- SADD: O(1)\n- SISMEMBER: O(1)\n- SMISMEMBER: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\nWe can also find the difference between two sets. For instance, we may want\nto know which bikes are racing in France but not in the USA:\n\nSet difference: Find members in one set but not in others using SDIFF when you need to exclude items (warning: argument order matters)\n\n**Difficulty:** Intermediate\n\n**Builds upon:** sadd\n\n**Commands:** DEL, SADD, SDIFF\n\n**Complexity:**\n- DEL: O(N)\n- SADD: O(1)\n- SDIFF: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\nThere are other non trivial operations that are still easy to implement\nusing the right Redis commands. For instance we may want a list of all the\nbikes racing in France, the USA, and some other races. We can do this using\nthe [`SINTER`](https://redis.io/docs/latest/commands/sinter) command, which performs the intersection between different\nsets. In addition to intersection you can also perform\nunions, difference, and more. For example \nif we add a third race we can see some of these commands in action:\n\nAdvanced pattern: Combine SINTER, SUNION, and SDIFF to analyze complex relationships when you need to precompute set algebra across multiple datasets\n\n**Difficulty:** Advanced\n\n**Builds upon:** sinter, sdiff\n\n**Commands:** DEL, SADD, SINTER, SUNION, SDIFF\n\n**Complexity:**\n- DEL: O(N)\n- SADD: O(1)\n- SINTER: O(N*M)\n- SUNION: O(N)\n- SDIFF: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\nYou'll note that the [`SDIFF`](https://redis.io/docs/latest/commands/sdiff) command returns an empty array when the\ndifference between all sets is empty. You'll also note that the order of sets\npassed to [`SDIFF`](https://redis.io/docs/latest/commands/sdiff) matters, since the difference is not commutative.\n\nWhen you want to remove items from a set, you can use the [`SREM`](https://redis.io/docs/latest/commands/srem) command to\nremove one or more items from a set, or you can use the [`SPOP`](https://redis.io/docs/latest/commands/spop) command to\nremove a random item from a set. You can also _return_ a random item from a\nset without removing it using the [`SRANDMEMBER`](https://redis.io/docs/latest/commands/srandmember) command:\n\nRemoval strategies: Use SREM for targeted removal, SPOP for random removal, or SRANDMEMBER to inspect without modifying when you need flexible deletion patterns\n\n**Difficulty:** Intermediate\n\n**Builds upon:** sadd\n\n**Commands:** DEL, SADD, SREM, SPOP, SMEMBERS, SRANDMEMBER\n\n**Complexity:**\n- DEL: O(N)\n- SADD: O(1)\n- SREM: O(N)\n- SMEMBERS: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]"
    },
    {
      "id": "limits",
      "title": "Limits",
      "role": "limits",
      "text": "The max size of a Redis set is 2^32 - 1 (4,294,967,295) members."
    },
    {
      "id": "performance",
      "title": "Performance",
      "role": "performance",
      "text": "Most set operations, including adding, removing, and checking whether an item is a set member, are O(1).\nThis means that they're highly efficient.\nHowever, for large sets with hundreds of thousands of members or more, you should exercise caution when running the [`SMEMBERS`](https://redis.io/docs/latest/commands/smembers) command.\nThis command is O(n) and returns the entire set in a single response. \nAs an alternative, consider the [`SSCAN`](https://redis.io/docs/latest/commands/sscan), which lets you retrieve all members of a set iteratively."
    },
    {
      "id": "alternatives",
      "title": "Alternatives",
      "role": "content",
      "text": "Sets membership checks on large datasets (or on streaming data) can use a lot of memory.\nIf you're concerned about memory usage and don't need perfect precision, consider a [Bloom filter or Cuckoo filter](https://redis.io/docs/latest/develop/data-types/probabilistic/bloom-filter) as an alternative to a set.\n\nRedis sets are frequently used as a kind of index.\nIf you need to index and query your data, consider the [JSON](https://redis.io/docs/latest/develop/data-types/json) data type and the [Redis Search](https://redis.io/docs/latest/develop/ai/search-and-query) features."
    },
    {
      "id": "learn-more",
      "title": "Learn more",
      "role": "related",
      "text": "* [Redis Sets Explained](https://www.youtube.com/watch?v=PKdCppSNTGQ) and [Redis Sets Elaborated](https://www.youtube.com/watch?v=aRw5ME_5kMY) are two short but thorough video explainers covering Redis sets.\n* [Redis University's RU101](https://university.redis.com/courses/ru101/) explores Redis sets in detail."
    }
  ],
  "examples": [
    {
      "id": "examples-ex0",
      "language": "plaintext",
      "code": "> SADD bikes:racing:france bike:1\n(integer) 1\n> SADD bikes:racing:france bike:1\n(integer) 0\n> SADD bikes:racing:france bike:2 bike:3\n(integer) 2\n> SADD bikes:racing:usa bike:1 bike:4\n(integer) 2",
      "section_id": "examples"
    },
    {
      "id": "examples-ex1",
      "language": "csharp",
      "code": "long res1 = db.SetAdd(\"bikes:racing:france\", [\"bike:1\"]);\n        Console.WriteLine(res1);    // >>> 1\n\n        long res2 = db.SetAdd(\"bikes:racing:france\", [\"bike:1\"]);\n        Console.WriteLine(res2);    // >>> 0\n\n        long res3 = db.SetAdd(\"bikes:racing:france\", [\"bike:2\", \"bike:3\"]);\n        Console.WriteLine(res3);    // >>> 2\n\n        long res4 = db.SetAdd(\"bikes:racing:usa\", [\"bike:1\", \"bike:4\"]);\n        Console.WriteLine(res4);    // >>> 2",
      "section_id": "examples"
    },
    {
      "id": "examples-ex2",
      "language": "go",
      "code": "res1, err := rdb.SAdd(ctx, \"bikes:racing:france\", \"bike:1\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res1) // >>> 1\n\n\tres2, err := rdb.SAdd(ctx, \"bikes:racing:france\", \"bike:1\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res2) // >>> 0\n\n\tres3, err := rdb.SAdd(ctx, \"bikes:racing:france\", \"bike:2\", \"bike:3\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res3) // >>> 2\n\n\tres4, err := rdb.SAdd(ctx, \"bikes:racing:usa\", \"bike:1\", \"bike:4\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res4) // >>> 2",
      "section_id": "examples"
    },
    {
      "id": "examples-ex3",
      "language": "java",
      "code": "CompletableFuture<Void> sAdd = asyncCommands.sadd(\"bikes:racing:france\", \"bike:1\").thenCompose(res1 -> {\n                System.out.println(res1); // >>> 1\n                return asyncCommands.sadd(\"bikes:racing:france\", \"bike:1\");\n            }).thenCompose(res2 -> {\n                System.out.println(res2); // >>> 0\n                return asyncCommands.sadd(\"bikes:racing:france\", \"bike:2\", \"bike:3\");\n            }).thenCompose(res3 -> {\n                System.out.println(res3); // >>> 2\n                return asyncCommands.sadd(\"bikes:racing:usa\", \"bike:1\", \"bike:4\");\n            }).thenAccept(res4 -> {\n                System.out.println(res4); // >>> 2\n            }).toCompletableFuture();",
      "section_id": "examples"
    },
    {
      "id": "examples-ex4",
      "language": "java",
      "code": "Mono<Void> sAdd = reactiveCommands.sadd(\"bikes:racing:france\", \"bike:1\").doOnNext(result -> {\n                System.out.println(result); // >>> 1\n            }).flatMap(v -> reactiveCommands.sadd(\"bikes:racing:france\", \"bike:1\")).doOnNext(result -> {\n                System.out.println(result); // >>> 0\n            }).flatMap(v -> reactiveCommands.sadd(\"bikes:racing:france\", \"bike:2\", \"bike:3\")).doOnNext(result -> {\n                System.out.println(result); // >>> 2\n            }).flatMap(v -> reactiveCommands.sadd(\"bikes:racing:usa\", \"bike:1\", \"bike:4\")).doOnNext(result -> {\n                System.out.println(result); // >>> 2\n            }).then();",
      "section_id": "examples"
    },
    {
      "id": "examples-ex5",
      "language": "java",
      "code": "long res1 = jedis.sadd(\"bikes:racing:france\", \"bike:1\");\n        System.out.println(res1);  // >>> 1\n\n        long res2 = jedis.sadd(\"bikes:racing:france\", \"bike:1\");\n        System.out.println(res2);  // >>> 0\n\n        long res3 = jedis.sadd(\"bikes:racing:france\", \"bike:2\", \"bike:3\");\n        System.out.println(res3);  // >>> 2\n\n        long res4 = jedis.sadd(\"bikes:racing:usa\", \"bike:1\", \"bike:4\");\n        System.out.println(res4);  // >>> 2",
      "section_id": "examples"
    },
    {
      "id": "examples-ex6",
      "language": "javascript",
      "code": "const res1 = await client.sAdd('bikes:racing:france', 'bike:1')\nconsole.log(res1)  // >>> 1\n\nconst res2 = await client.sAdd('bikes:racing:france', 'bike:1')\nconsole.log(res2)  // >>> 0\nconst res3 = await client.sAdd('bikes:racing:france', ['bike:2', 'bike:3'])\nconsole.log(res3)  // >>> 2\nconst res4 = await client.sAdd('bikes:racing:usa', ['bike:1', 'bike:4'])\nconsole.log(res4)  // >>> 2",
      "section_id": "examples"
    },
    {
      "id": "examples-ex7",
      "language": "php",
      "code": "$res1 = $r->sadd('bikes:racing:france', ['bike:1']);\n        echo $res1 . PHP_EOL;\n        // >>> 1\n\n        $res2 = $r->sadd('bikes:racing:france', ['bike:1']);\n        echo $res2 . PHP_EOL;\n        // >>> 0\n\n        $res3 = $r->sadd('bikes:racing:france', ['bike:2', 'bike:3']);\n        echo $res3 . PHP_EOL;\n        // >>> 2\n\n        $res4 = $r->sadd('bikes:racing:usa', ['bike:1', 'bike:4']);\n        echo $res4 . PHP_EOL;\n        // >>> 2",
      "section_id": "examples"
    },
    {
      "id": "examples-ex8",
      "language": "python",
      "code": "res1 = r.sadd(\"bikes:racing:france\", \"bike:1\")\nprint(res1)  # >>> 1\n\nres2 = r.sadd(\"bikes:racing:france\", \"bike:1\")\nprint(res2)  # >>> 0\n\nres3 = r.sadd(\"bikes:racing:france\", \"bike:2\", \"bike:3\")\nprint(res3)  # >>> 2\n\nres4 = r.sadd(\"bikes:racing:usa\", \"bike:1\", \"bike:4\")\nprint(res4)  # >>> 2",
      "section_id": "examples"
    },
    {
      "id": "examples-ex9",
      "language": "ruby",
      "code": "res1 = r.sadd('bikes:racing:france', ['bike:1'])\nputs res1 # >>> 1\n\nres2 = r.sadd('bikes:racing:france', ['bike:1'])\nputs res2 # >>> 0\n\nres3 = r.sadd('bikes:racing:france', ['bike:2', 'bike:3'])\nputs res3 # >>> 2\n\nres4 = r.sadd('bikes:racing:usa', ['bike:1', 'bike:4'])\nputs res4 # >>> 2",
      "section_id": "examples"
    },
    {
      "id": "examples-ex10",
      "language": "rust",
      "code": "if let Ok(res) = r.sadd(\"bikes:racing:france\", \"bike:1\").await {\n            let res: usize = res;\n            println!(\"{res}\"); // >>> 1\n        }\n\n        if let Ok(res) = r.sadd(\"bikes:racing:france\", \"bike:1\").await {\n            let res: usize = res;\n            println!(\"{res}\"); // >>> 0\n        }\n\n        if let Ok(res) = r.sadd(\"bikes:racing:france\", &[\"bike:2\", \"bike:3\"]).await {\n            let res: usize = res;\n            println!(\"{res}\"); // >>> 2\n        }\n\n        if let Ok(res) = r.sadd(\"bikes:racing:usa\", &[\"bike:1\", \"bike:4\"]).await {\n            let res: usize = res;\n            println!(\"{res}\"); // >>> 2\n        }",
      "section_id": "examples"
    },
    {
      "id": "examples-ex11",
      "language": "rust",
      "code": "if let Ok(res) = r.sadd(\"bikes:racing:france\", \"bike:1\") {\n            let res: usize = res;\n            println!(\"{res}\"); // >>> 1\n        }\n\n        if let Ok(res) = r.sadd(\"bikes:racing:france\", \"bike:1\") {\n            let res: usize = res;\n            println!(\"{res}\"); // >>> 0\n        }\n\n        if let Ok(res) = r.sadd(\"bikes:racing:france\", &[\"bike:2\", \"bike:3\"]) {\n            let res: usize = res;\n            println!(\"{res}\"); // >>> 2\n        }\n\n        if let Ok(res) = r.sadd(\"bikes:racing:usa\", &[\"bike:1\", \"bike:4\"]) {\n            let res: usize = res;\n            println!(\"{res}\"); // >>> 2\n        }",
      "section_id": "examples"
    },
    {
      "id": "examples-ex12",
      "language": "plaintext",
      "code": "> SISMEMBER bikes:racing:usa bike:1\n(integer) 1\n> SISMEMBER bikes:racing:usa bike:2\n(integer) 0",
      "section_id": "examples"
    },
    {
      "id": "examples-ex13",
      "language": "csharp",
      "code": "bool res5 = db.SetContains(\"bikes:racing:france\", \"bike:1\");\n        Console.WriteLine(res5);    // >>> True\n\n        bool res6 = db.SetContains(\"bikes:racing:usa\", \"bike:2\");\n        Console.WriteLine(res6);    // >>> False",
      "section_id": "examples"
    },
    {
      "id": "examples-ex14",
      "language": "go",
      "code": "res5, err := rdb.SIsMember(ctx, \"bikes:racing:usa\", \"bike:1\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res5) // >>> true\n\n\tres6, err := rdb.SIsMember(ctx, \"bikes:racing:usa\", \"bike:2\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res6) // >>> false",
      "section_id": "examples"
    },
    {
      "id": "examples-ex15",
      "language": "java",
      "code": "CompletableFuture<Void> sIsMember = asyncCommands.sismember(\"bikes:racing:usa\", \"bike:1\").thenCompose(res5 -> {\n                System.out.println(res5); // >>> true\n                return asyncCommands.sismember(\"bikes:racing:usa\", \"bike:2\");\n            }).thenAccept(res6 -> {\n                System.out.println(res6); // >>> false\n            }).toCompletableFuture();",
      "section_id": "examples"
    },
    {
      "id": "examples-ex16",
      "language": "java",
      "code": "Mono<Boolean> sIsMember1 = reactiveCommands.sismember(\"bikes:racing:usa\", \"bike:1\").doOnNext(result -> {\n                System.out.println(result); // >>> true\n            });\n\n            Mono<Boolean> sIsMember2 = reactiveCommands.sismember(\"bikes:racing:usa\", \"bike:2\").doOnNext(result -> {\n                System.out.println(result); // >>> false\n            });",
      "section_id": "examples"
    },
    {
      "id": "examples-ex17",
      "language": "java",
      "code": "jedis.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\");\n        jedis.sadd(\"bikes:racing:usa\", \"bike:1\", \"bike:4\");\n\n        boolean res5 = jedis.sismember(\"bikes:racing:usa\", \"bike:1\");\n        System.out.println(res5);  // >>> true\n\n        boolean res6 = jedis.sismember(\"bikes:racing:usa\", \"bike:2\");\n        System.out.println(res6);  // >>> false",
      "section_id": "examples"
    },
    {
      "id": "examples-ex18",
      "language": "javascript",
      "code": "await client.del('bikes:racing:france')\nawait client.del('bikes:racing:usa')\nawait client.sAdd('bikes:racing:france', ['bike:1', 'bike:2', 'bike:3'])\nawait client.sAdd('bikes:racing:usa', ['bike:1', 'bike:4'])\nconst res5 = await client.sIsMember('bikes:racing:usa', 'bike:1')\nconsole.log(res5)  // >>> 1\n\nconst res6 = await client.sIsMember('bikes:racing:usa', 'bike:2')\nconsole.log(res6)  // >>> 0",
      "section_id": "examples"
    },
    {
      "id": "examples-ex19",
      "language": "php",
      "code": "$res5 = $r->sismember('bikes:racing:usa', 'bike:1');\n        echo $res5 . PHP_EOL;\n        // >>> 1\n\n        $res6 = $r->sismember('bikes:racing:usa', 'bike:2');\n        echo $res6 . PHP_EOL;\n        // >>> 0",
      "section_id": "examples"
    },
    {
      "id": "examples-ex20",
      "language": "python",
      "code": "r.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\")\nr.sadd(\"bikes:racing:usa\", \"bike:1\", \"bike:4\")\nres5 = r.sismember(\"bikes:racing:usa\", \"bike:1\")\nprint(res5)  # >>> 1\n\nres6 = r.sismember(\"bikes:racing:usa\", \"bike:2\")\nprint(res6)  # >>> 0",
      "section_id": "examples"
    },
    {
      "id": "examples-ex21",
      "language": "ruby",
      "code": "r.del('bikes:racing:france', 'bikes:racing:usa')\nr.sadd('bikes:racing:france', ['bike:1', 'bike:2', 'bike:3'])\nr.sadd('bikes:racing:usa', ['bike:1', 'bike:4'])\nres5 = r.sismember('bikes:racing:usa', 'bike:1')\nputs res5 # >>> true\n\nres6 = r.sismember('bikes:racing:usa', 'bike:2')\nputs res6 # >>> false",
      "section_id": "examples"
    },
    {
      "id": "examples-ex22",
      "language": "rust",
      "code": "if let Ok(res) = r.sismember(\"bikes:racing:usa\", \"bike:1\").await {\n            let res: bool = res;\n            println!(\"{}\", i32::from(res)); // >>> 1\n        }\n\n        if let Ok(res) = r.sismember(\"bikes:racing:usa\", \"bike:2\").await {\n            let res: bool = res;\n            println!(\"{}\", i32::from(res)); // >>> 0\n        }",
      "section_id": "examples"
    },
    {
      "id": "examples-ex23",
      "language": "rust",
      "code": "if let Ok(res) = r.sismember(\"bikes:racing:usa\", \"bike:1\") {\n            let res: bool = res;\n            println!(\"{}\", i32::from(res)); // >>> 1\n        }\n\n        if let Ok(res) = r.sismember(\"bikes:racing:usa\", \"bike:2\") {\n            let res: bool = res;\n            println!(\"{}\", i32::from(res)); // >>> 0\n        }",
      "section_id": "examples"
    },
    {
      "id": "examples-ex24",
      "language": "plaintext",
      "code": "> SINTER bikes:racing:france bikes:racing:usa\n1) \"bike:1\"",
      "section_id": "examples"
    },
    {
      "id": "examples-ex25",
      "language": "csharp",
      "code": "long res7 = db.SetAdd(\"{bikes:racing}:france\", [\"bike:1\", \"bike:2\", \"bike:3\"]);\n        long res8 = db.SetAdd(\"{bikes:racing}:usa\", [\"bike:1\", \"bike:4\"]);\n\n        RedisValue[] res9 = db.SetCombine(SetOperation.Intersect, [\"{bikes:racing}:france\", \"{bikes:racing}:usa\"]);\n        Console.WriteLine(string.Join(\", \", res9)); // >>> bike:1",
      "section_id": "examples"
    },
    {
      "id": "examples-ex26",
      "language": "go",
      "code": "res7, err := rdb.SInter(ctx, \"bikes:racing:france\", \"bikes:racing:usa\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res7) // >>> [bike:1]",
      "section_id": "examples"
    },
    {
      "id": "examples-ex27",
      "language": "java",
      "code": "CompletableFuture<Void> sInter = asyncCommands.sinter(\"bikes:racing:france\", \"bikes:racing:usa\")\n                    .thenAccept(res7 -> {\n                        System.out.println(res7); // >>> [bike:1]\n                    }).toCompletableFuture();",
      "section_id": "examples"
    },
    {
      "id": "examples-ex28",
      "language": "java",
      "code": "Mono<List<String>> sInter = reactiveCommands.sinter(\"bikes:racing:france\", \"bikes:racing:usa\").collectList()\n                    .doOnNext(result -> {\n                        System.out.println(result); // >>> [bike:1]\n                    });",
      "section_id": "examples"
    },
    {
      "id": "examples-ex29",
      "language": "java",
      "code": "jedis.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\");\n        jedis.sadd(\"bikes:racing:usa\", \"bike:1\", \"bike:4\");\n\n        Set<String> res7 = jedis.sinter(\"bikes:racing:france\", \"bikes:racing:usa\");\n        System.out.println(res7);  // >>> [bike:1]",
      "section_id": "examples"
    },
    {
      "id": "examples-ex30",
      "language": "javascript",
      "code": "await client.del('bikes:racing:france')\nawait client.del('bikes:racing:usa')\nawait client.sAdd('bikes:racing:france', ['bike:1', 'bike:2', 'bike:3'])\nawait client.sAdd('bikes:racing:usa', ['bike:1', 'bike:4'])\nconst res7 = await client.sInter(['bikes:racing:france', 'bikes:racing:usa'])\nconsole.log(res7)  // >>> ['bike:1']",
      "section_id": "examples"
    },
    {
      "id": "examples-ex31",
      "language": "php",
      "code": "$res7 = $r->sinter(['bikes:racing:france', 'bikes:racing:usa']);\n        echo json_encode($res7) . PHP_EOL;\n        // >>> [\"bike:1\"]",
      "section_id": "examples"
    },
    {
      "id": "examples-ex32",
      "language": "python",
      "code": "r.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\")\nr.sadd(\"bikes:racing:usa\", \"bike:1\", \"bike:4\")\nres7 = r.sinter(\"bikes:racing:france\", \"bikes:racing:usa\")\nprint(res7)  # >>> {'bike:1'}",
      "section_id": "examples"
    },
    {
      "id": "examples-ex33",
      "language": "ruby",
      "code": "r.del('bikes:racing:france', 'bikes:racing:usa')\nr.sadd('bikes:racing:france', ['bike:1', 'bike:2', 'bike:3'])\nr.sadd('bikes:racing:usa', ['bike:1', 'bike:4'])\nres7 = r.sinter('bikes:racing:france', 'bikes:racing:usa')\nputs res7.inspect # >>> [\"bike:1\"]",
      "section_id": "examples"
    },
    {
      "id": "examples-ex34",
      "language": "rust",
      "code": "if let Ok(res) = r.sinter(&[\"bikes:racing:france\", \"bikes:racing:usa\"]).await {\n            let res: HashSet<String> = res;\n            let res = sorted_set(res);\n            println!(\"{res:?}\"); // >>> [\"bike:1\"]\n        }",
      "section_id": "examples"
    },
    {
      "id": "examples-ex35",
      "language": "rust",
      "code": "if let Ok(res) = r.sinter(&[\"bikes:racing:france\", \"bikes:racing:usa\"]) {\n            let res: HashSet<String> = res;\n            let res = sorted_set(res);\n            println!(\"{res:?}\"); // >>> [\"bike:1\"]\n        }",
      "section_id": "examples"
    },
    {
      "id": "examples-ex36",
      "language": "plaintext",
      "code": "> SCARD bikes:racing:france\n(integer) 3",
      "section_id": "examples"
    },
    {
      "id": "examples-ex37",
      "language": "csharp",
      "code": "long res10 = db.SetAdd(\"bikes:racing:france\", [\"bike:1\", \"bike:2\", \"bike:3\"]);\n        long res11 = db.SetLength(\"bikes:racing:france\");\n        Console.WriteLine(res11);   // >>> 3",
      "section_id": "examples"
    },
    {
      "id": "examples-ex38",
      "language": "go",
      "code": "res8, err := rdb.SCard(ctx, \"bikes:racing:france\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res8) // >>> 3",
      "section_id": "examples"
    },
    {
      "id": "examples-ex39",
      "language": "java",
      "code": "CompletableFuture<Void> sCard = asyncCommands.scard(\"bikes:racing:france\").thenAccept(res8 -> {\n                System.out.println(res8); // >>> 3\n            }).toCompletableFuture();",
      "section_id": "examples"
    },
    {
      "id": "examples-ex40",
      "language": "java",
      "code": "Mono<Long> sCard = reactiveCommands.scard(\"bikes:racing:france\").doOnNext(result -> {\n                System.out.println(result); // >>> 3\n            });",
      "section_id": "examples"
    },
    {
      "id": "examples-ex41",
      "language": "java",
      "code": "jedis.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\");\n\n        long res8 = jedis.scard(\"bikes:racing:france\");\n        System.out.println(res8);  // >>> 3",
      "section_id": "examples"
    },
    {
      "id": "examples-ex42",
      "language": "javascript",
      "code": "await client.del('bikes:racing:france')\nawait client.sAdd('bikes:racing:france', ['bike:1', 'bike:2', 'bike:3'])\nconst res8 = await client.sCard('bikes:racing:france')\nconsole.log(res8)  // >>> 3",
      "section_id": "examples"
    },
    {
      "id": "examples-ex43",
      "language": "php",
      "code": "$res8 = $r->scard('bikes:racing:france');\n        echo $res8 . PHP_EOL;\n        // >>> 3",
      "section_id": "examples"
    },
    {
      "id": "examples-ex44",
      "language": "python",
      "code": "r.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\")\nres8 = r.scard(\"bikes:racing:france\")\nprint(res8)  # >>> 3",
      "section_id": "examples"
    },
    {
      "id": "examples-ex45",
      "language": "ruby",
      "code": "r.del('bikes:racing:france')\nr.sadd('bikes:racing:france', ['bike:1', 'bike:2', 'bike:3'])\nres8 = r.scard('bikes:racing:france')\nputs res8 # >>> 3",
      "section_id": "examples"
    },
    {
      "id": "examples-ex46",
      "language": "rust",
      "code": "if let Ok(res) = r.scard(\"bikes:racing:france\").await {\n            let res: usize = res;\n            println!(\"{res}\"); // >>> 3\n        }",
      "section_id": "examples"
    },
    {
      "id": "examples-ex47",
      "language": "rust",
      "code": "if let Ok(res) = r.scard(\"bikes:racing:france\") {\n            let res: usize = res;\n            println!(\"{res}\"); // >>> 3\n        }",
      "section_id": "examples"
    },
    {
      "id": "tutorial-ex0",
      "language": "plaintext",
      "code": "> DEL bikes:racing:france\n(integer) 1\n> SADD bikes:racing:france bike:1 bike:2 bike:3\n(integer) 3\n> SMEMBERS bikes:racing:france\n1) \"bike:3\"\n2) \"bike:1\"\n3) \"bike:2\"",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex1",
      "language": "csharp",
      "code": "db.KeyDelete(\"bikes:racing:france\");\n\n        long res12 = db.SetAdd(\"bikes:racing:france\", [\"bike:1\", \"bike:2\", \"bike:3\"]);\n        RedisValue[] res13 = db.SetMembers(\"bikes:racing:france\");\n        Console.WriteLine(string.Join(\", \", res13));    // >>> bike:3, bike:2, bike:1",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex2",
      "language": "go",
      "code": "rdb.Del(ctx, \"bikes:racing:france\")\n\n\tres9, err := rdb.SAdd(ctx, \"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res9) // >>> 3\n\n\tres10, err := rdb.SMembers(ctx, \"bikes:racing:france\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Sort the strings in the slice to make sure the output is lexicographical\n\tsort.Strings(res10)\n\n\tfmt.Println(res10) // >>> [bike:1 bike:2 bike:3]",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex3",
      "language": "java",
      "code": "CompletableFuture<Void> sAddSMembers = asyncCommands.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\")\n                    .thenCompose(res9 -> {\n                        System.out.println(res9); // >>> 3\n                        return asyncCommands.smembers(\"bikes:racing:france\");\n                    }).thenAccept(res10 -> {\n                        System.out.println(res10); // >>> [bike:1, bike:2, bike:3]\n                    }).toCompletableFuture();",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex4",
      "language": "java",
      "code": "Mono<Void> sAddSMembers = reactiveCommands.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\")\n                    .doOnNext(result -> {\n                        System.out.println(result); // >>> 3\n                    }).flatMap(v -> reactiveCommands.smembers(\"bikes:racing:france\").collectList()).doOnNext(result -> {\n                        System.out.println(result); // >>> [bike:1, bike:2, bike:3]\n                    }).then();",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex5",
      "language": "java",
      "code": "jedis.del(\"bikes:racing:france\");\n\n        long res9 = jedis.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\");\n        System.out.println(res9);  // >>> 3\n\n        Set<String> res10 = jedis.smembers(\"bikes:racing:france\");\n        System.out.println(res10);  // >>> [bike:1, bike:2, bike:3]",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex6",
      "language": "javascript",
      "code": "await client.del('bikes:racing:france')\n\nconst res9 = await client.sAdd('bikes:racing:france', ['bike:1', 'bike:2', 'bike:3'])\nconsole.log(res9)  // >>> 3\n\nconst res10 = await client.sMembers('bikes:racing:france')\nconsole.log(res10)  // >>> ['bike:1', 'bike:2', 'bike:3']",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex7",
      "language": "php",
      "code": "$r->del('bikes:racing:france');\n\n        $res9 = $r->sadd('bikes:racing:france', ['bike:1', 'bike:2', 'bike:3']);\n        echo $res9 . PHP_EOL;\n        // >>> 3\n\n        $res10 = $r->smembers('bikes:racing:france');\n        sort($res10);\n        echo json_encode($res10) . PHP_EOL;\n        // >>> [\"bike:1\",\"bike:2\",\"bike:3\"]",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex8",
      "language": "python",
      "code": "r.delete(\"bikes:racing:france\")\n\nres9 = r.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\")\nprint(res9)  # >>> 3\n\nres10 = r.smembers(\"bikes:racing:france\")\nprint(res10)  # >>> {'bike:1', 'bike:2', 'bike:3'}",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex9",
      "language": "ruby",
      "code": "r.del('bikes:racing:france')\n\nres9 = r.sadd('bikes:racing:france', ['bike:1', 'bike:2', 'bike:3'])\nputs res9 # >>> 3\n\nres10 = r.smembers('bikes:racing:france')\nputs res10.sort.inspect # >>> [\"bike:1\", \"bike:2\", \"bike:3\"]",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex10",
      "language": "rust",
      "code": "let _: usize = r.del(\"bikes:racing:france\").await.unwrap_or(0);\n\n        if let Ok(res) = r.sadd(\"bikes:racing:france\", &[\"bike:1\", \"bike:2\", \"bike:3\"]).await {\n            let res: usize = res;\n            println!(\"{res}\"); // >>> 3\n        }\n\n        if let Ok(res) = r.smembers(\"bikes:racing:france\").await {\n            let res: HashSet<String> = res;\n            let res = sorted_set(res);\n            println!(\"{res:?}\"); // >>> [\"bike:1\", \"bike:2\", \"bike:3\"]\n        }",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex11",
      "language": "rust",
      "code": "let _: usize = r.del(\"bikes:racing:france\").unwrap_or(0);\n\n        if let Ok(res) = r.sadd(\"bikes:racing:france\", &[\"bike:1\", \"bike:2\", \"bike:3\"]) {\n            let res: usize = res;\n            println!(\"{res}\"); // >>> 3\n        }\n\n        if let Ok(res) = r.smembers(\"bikes:racing:france\") {\n            let res: HashSet<String> = res;\n            let res = sorted_set(res);\n            println!(\"{res:?}\"); // >>> [\"bike:1\", \"bike:2\", \"bike:3\"]\n        }",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex12",
      "language": "plaintext",
      "code": "# Recreate the France racing set so this example runs on its own.\n> DEL bikes:racing:france\n(integer) 1\n> SADD bikes:racing:france bike:1 bike:2 bike:3\n(integer) 3\n> SISMEMBER bikes:racing:france bike:1\n(integer) 1\n> SMISMEMBER bikes:racing:france bike:2 bike:3 bike:4\n1) (integer) 1\n2) (integer) 1\n3) (integer) 0",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex13",
      "language": "csharp",
      "code": "// Recreate the set so this example runs on its own.\n        db.KeyDelete(\"bikes:racing:france\");\n        db.SetAdd(\"bikes:racing:france\", [\"bike:1\", \"bike:2\", \"bike:3\"]);\n\n        bool res14 = db.SetContains(\"bikes:racing:france\", \"bike:1\");\n        Console.WriteLine(res14);   // >>> true\n\n        bool[] res15 = db.SetContains(\"bikes:racing:france\", [\"bike:2\", \"bike:3\", \"bike:4\"]);\n        Console.WriteLine(string.Join(\", \", res15));    // >>> True, True, False",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex14",
      "language": "go",
      "code": "res11, err := rdb.SIsMember(ctx, \"bikes:racing:france\", \"bike:1\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res11) // >>> true\n\n\tres12, err := rdb.SMIsMember(ctx, \"bikes:racing:france\", \"bike:2\", \"bike:3\", \"bike:4\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res12) // >>> [true true false]",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex15",
      "language": "java",
      "code": "// Recreate the set so this example runs on its own. The chain is\n            // ordered, so the DEL + SADD complete before the reads below.\n            CompletableFuture<Void> sMIsMember = asyncCommands.del(\"bikes:racing:france\")\n                    .thenCompose(d -> asyncCommands.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\"))\n                    .thenCompose(a -> asyncCommands.sismember(\"bikes:racing:france\", \"bike:1\")).thenCompose(res11 -> {\n                        System.out.println(res11); // >>> true\n                        return asyncCommands.smismember(\"bikes:racing:france\", \"bike:2\", \"bike:3\", \"bike:4\");\n                    }).thenAccept(res12 -> {\n                        System.out.println(res12); // >>> [true, true, false]\n                    }).toCompletableFuture();",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex16",
      "language": "java",
      "code": "// Recreate the set so this example runs on its own. Block it\n            // sequentially: a DEL inside the shared Mono.when() below would\n            // race the sibling reads on the same key.\n            reactiveCommands.del(\"bikes:racing:france\")\n                    .then(reactiveCommands.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\"))\n                    .block();\n\n            Mono<Boolean> sIsMember3 = reactiveCommands.sismember(\"bikes:racing:france\", \"bike:1\").doOnNext(result -> {\n                System.out.println(result); // >>> true\n            });\n\n            Mono<List<Boolean>> sMIsMember = reactiveCommands.smismember(\"bikes:racing:france\", \"bike:2\", \"bike:3\", \"bike:4\")\n                    .collectList().doOnNext(result -> {\n                        System.out.println(result); // >>> [true, true, false]\n                    });",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex17",
      "language": "java",
      "code": "// Recreate the set so this example runs on its own.\n        jedis.del(\"bikes:racing:france\");\n        jedis.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\");\n\n        boolean res11 = jedis.sismember(\"bikes:racing:france\", \"bike:1\");\n        System.out.println(res11);  // >>> true\n\n        List<Boolean> res12 = jedis.smismember(\"bikes:racing:france\", \"bike:2\", \"bike:3\", \"bike:4\");\n        System.out.println(res12);  // >>> [true,true,false]",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex18",
      "language": "javascript",
      "code": "// Recreate the set so this example runs on its own.\nawait client.del('bikes:racing:france')\nawait client.sAdd('bikes:racing:france', ['bike:1', 'bike:2', 'bike:3'])\n\nconst res11 = await client.sIsMember('bikes:racing:france', 'bike:1')\nconsole.log(res11)  // >>> 1\n\nconst res12 = await client.smIsMember('bikes:racing:france', ['bike:2', 'bike:3', 'bike:4'])\nconsole.log(res12)  // >>> [1, 1, 0]",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex19",
      "language": "php",
      "code": "// Recreate the set so this example runs on its own.\n        $r->del('bikes:racing:france');\n        $r->sadd('bikes:racing:france', 'bike:1', 'bike:2', 'bike:3');\n\n        $res11 = $r->sismember('bikes:racing:france', 'bike:1');\n        echo $res11 . PHP_EOL;\n        // >>> 1\n\n        $res12 = $r->smismember('bikes:racing:france', 'bike:2', 'bike:3', 'bike:4');\n        echo json_encode($res12) . PHP_EOL;\n        // >>> [1,1,0]",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex20",
      "language": "python",
      "code": "# Recreate the set so this example runs on its own.\nr.delete(\"bikes:racing:france\")\nr.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\")\n\nres11 = r.sismember(\"bikes:racing:france\", \"bike:1\")\nprint(res11)  # >>> 1\n\nres12 = r.smismember(\"bikes:racing:france\", \"bike:2\", \"bike:3\", \"bike:4\")\nprint(res12)  # >>> [1, 1, 0]",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex21",
      "language": "ruby",
      "code": "# Recreate the set so this example runs on its own.\nr.del('bikes:racing:france')\nr.sadd('bikes:racing:france', ['bike:1', 'bike:2', 'bike:3'])\n\nres11 = r.sismember('bikes:racing:france', 'bike:1')\nputs res11 # >>> true\n\nres12 = r.smismember('bikes:racing:france', 'bike:2', 'bike:3', 'bike:4')\nputs res12.inspect # >>> [true, true, false]",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex22",
      "language": "rust",
      "code": "// Recreate the set so this example runs on its own.\n        let _: usize = r.del(\"bikes:racing:france\").await.unwrap_or(0);\n        let _: usize = r\n            .sadd(\"bikes:racing:france\", &[\"bike:1\", \"bike:2\", \"bike:3\"])\n            .await\n            .unwrap_or(0);\n\n        if let Ok(res) = r.sismember(\"bikes:racing:france\", \"bike:1\").await {\n            let res: bool = res;\n            println!(\"{}\", i32::from(res)); // >>> 1\n        }\n\n        if let Ok(res) = r\n            .smismember(\"bikes:racing:france\", &[\"bike:2\", \"bike:3\", \"bike:4\"])\n            .await\n        {\n            let res: Vec<bool> = res;\n            let res: Vec<i32> = res.into_iter().map(i32::from).collect();\n            println!(\"{res:?}\"); // >>> [1, 1, 0]\n        }",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex23",
      "language": "rust",
      "code": "// Recreate the set so this example runs on its own.\n        let _: usize = r.del(\"bikes:racing:france\").unwrap_or(0);\n        let _: usize = r\n            .sadd(\"bikes:racing:france\", &[\"bike:1\", \"bike:2\", \"bike:3\"])\n            .unwrap_or(0);\n\n        if let Ok(res) = r.sismember(\"bikes:racing:france\", \"bike:1\") {\n            let res: bool = res;\n            println!(\"{}\", i32::from(res)); // >>> 1\n        }\n\n        if let Ok(res) = r.smismember(\"bikes:racing:france\", &[\"bike:2\", \"bike:3\", \"bike:4\"]) {\n            let res: Vec<bool> = res;\n            let res: Vec<i32> = res.into_iter().map(i32::from).collect();\n            println!(\"{res:?}\"); // >>> [1, 1, 0]\n        }",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex24",
      "language": "plaintext",
      "code": "> DEL bikes:racing:usa\n(integer) 1\n> SADD bikes:racing:usa bike:1 bike:4\n(integer) 2\n> SDIFF bikes:racing:france bikes:racing:usa\n1) \"bike:3\"\n2) \"bike:2\"",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex25",
      "language": "csharp",
      "code": "long res16 = db.SetAdd(\"{bikes:racing}:france\", [\"bike:1\", \"bike:2\", \"bike:3\"]);\n        long res17 = db.SetAdd(\"{bikes:racing}:usa\", [\"bike:1\", \"bike:4\"]);\n        RedisValue[] res18 = db.SetCombine(SetOperation.Difference, [\"{bikes:racing}:france\", \"{bikes:racing}:usa\"]);\n        Console.WriteLine(string.Join(\", \", res18));    // >>> bike:2, bike:3",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex26",
      "language": "go",
      "code": "_, err := rdb.SAdd(ctx, \"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = rdb.SAdd(ctx, \"bikes:racing:usa\", \"bike:1\", \"bike:4\").Result()\n\n\tres13, err := rdb.SDiff(ctx, \"bikes:racing:france\", \"bikes:racing:usa\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Sort the strings in the slice to make sure the output is lexicographical\n\tsort.Strings(res13)\n\n\tfmt.Println(res13) // >>> [bike:2 bike:3]",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex27",
      "language": "java",
      "code": "CompletableFuture<Void> sDiff = asyncCommands.sdiff(\"bikes:racing:france\", \"bikes:racing:usa\")\n                    .thenAccept(res13 -> {\n                        System.out.println(res13); // >>> [bike:2, bike:3]\n                    }).toCompletableFuture();",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex28",
      "language": "java",
      "code": "Mono<List<String>> sDiff = reactiveCommands.sdiff(\"bikes:racing:france\", \"bikes:racing:usa\").collectList()\n                    .doOnNext(result -> {\n                        System.out.println(result); // >>> [bike:2, bike:3]\n                    });",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex29",
      "language": "java",
      "code": "jedis.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\");\n        jedis.sadd(\"bikes:racing:usa\", \"bike:1\", \"bike:4\");\n\n        Set<String> res13 = jedis.sdiff(\"bikes:racing:france\", \"bikes:racing:usa\");\n        System.out.println(res13);  // >>> [bike:2, bike:3]",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex30",
      "language": "javascript",
      "code": "await client.del('bikes:racing:france')\nawait client.del('bikes:racing:usa')\n\nawait client.sAdd('bikes:racing:france', ['bike:1', 'bike:2', 'bike:3'])\nawait client.sAdd('bikes:racing:usa', ['bike:1', 'bike:4'])\nconst res13 = await client.sDiff(['bikes:racing:france', 'bikes:racing:usa'])\nconsole.log(res13)  // >>> [ 'bike:2', 'bike:3' ]",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex31",
      "language": "php",
      "code": "$r->sadd('bikes:racing:france', ['bike:1', 'bike:2', 'bike:3']);\n        $r->sadd('bikes:racing:usa', ['bike:1', 'bike:4']);\n\n        $res13 = $r->sdiff(['bikes:racing:france', 'bikes:racing:usa']);\n        sort($res13);\n        echo json_encode($res13) . PHP_EOL;\n        // >>> [\"bike:2\",\"bike:3\"]",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex32",
      "language": "python",
      "code": "r.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\")\nr.sadd(\"bikes:racing:usa\", \"bike:1\", \"bike:4\")\n\nres13 = r.sdiff(\"bikes:racing:france\", \"bikes:racing:usa\")\nprint(res13)  # >>> {'bike:2', 'bike:3'}",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex33",
      "language": "ruby",
      "code": "r.sadd('bikes:racing:france', ['bike:1', 'bike:2', 'bike:3'])\nr.sadd('bikes:racing:usa', ['bike:1', 'bike:4'])\n\nres13 = r.sdiff('bikes:racing:france', 'bikes:racing:usa')\nputs res13.sort.inspect # >>> [\"bike:2\", \"bike:3\"]",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex34",
      "language": "rust",
      "code": "let _: usize = r.del(\"bikes:racing:france\").await.unwrap_or(0);\n        let _: usize = r.del(\"bikes:racing:usa\").await.unwrap_or(0);\n        let _: usize = r\n            .sadd(\"bikes:racing:france\", &[\"bike:1\", \"bike:2\", \"bike:3\"])\n            .await\n            .unwrap_or(0);\n        let _: usize = r\n            .sadd(\"bikes:racing:usa\", &[\"bike:1\", \"bike:4\"])\n            .await\n            .unwrap_or(0);\n\n        if let Ok(res) = r.sdiff(&[\"bikes:racing:france\", \"bikes:racing:usa\"]).await {\n            let res: HashSet<String> = res;\n            let res = sorted_set(res);\n            println!(\"{res:?}\"); // >>> [\"bike:2\", \"bike:3\"]\n        }",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex35",
      "language": "rust",
      "code": "let _: usize = r.del(\"bikes:racing:france\").unwrap_or(0);\n        let _: usize = r.del(\"bikes:racing:usa\").unwrap_or(0);\n        let _: usize = r.sadd(\"bikes:racing:france\", &[\"bike:1\", \"bike:2\", \"bike:3\"]).unwrap_or(0);\n        let _: usize = r.sadd(\"bikes:racing:usa\", &[\"bike:1\", \"bike:4\"]).unwrap_or(0);\n\n        if let Ok(res) = r.sdiff(&[\"bikes:racing:france\", \"bikes:racing:usa\"]) {\n            let res: HashSet<String> = res;\n            let res = sorted_set(res);\n            println!(\"{res:?}\"); // >>> [\"bike:2\", \"bike:3\"]\n        }",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex36",
      "language": "plaintext",
      "code": "> DEL bikes:racing:france bikes:racing:usa bikes:racing:italy\n(integer) 2\n> SADD bikes:racing:france bike:1 bike:2 bike:3\n(integer) 3\n> SADD bikes:racing:usa bike:1 bike:4\n(integer) 2\n> SADD bikes:racing:italy bike:1 bike:2 bike:3 bike:4\n(integer) 4\n> SINTER bikes:racing:france bikes:racing:usa bikes:racing:italy\n1) \"bike:1\"\n> SUNION bikes:racing:france bikes:racing:usa bikes:racing:italy\n1) \"bike:2\"\n2) \"bike:1\"\n3) \"bike:4\"\n4) \"bike:3\"\n> SDIFF bikes:racing:france bikes:racing:usa bikes:racing:italy\n(empty array)\n> SDIFF bikes:racing:france bikes:racing:usa\n1) \"bike:3\"\n2) \"bike:2\"\n> SDIFF bikes:racing:usa bikes:racing:france\n1) \"bike:4\"",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex37",
      "language": "csharp",
      "code": "db.KeyDelete(\"{bikes:racing}:france\");\n        db.KeyDelete(\"{bikes:racing}:usa\");\n        db.KeyDelete(\"{bikes:racing}:italy\");\n\n        long res19 = db.SetAdd(\"{bikes:racing}:france\", [\"bike:1\", \"bike:2\", \"bike:3\"]);\n        long res20 = db.SetAdd(\"{bikes:racing}:usa\", [\"bike:1\", \"bike:4\"]);\n        long res21 = db.SetAdd(\"{bikes:racing}:italy\", [\"bike:1\", \"bike:2\", \"bike:3\", \"bike:4\"]);\n\n        RedisValue[] res22 = db.SetCombine(SetOperation.Intersect, [\"{bikes:racing}:france\", \"{bikes:racing}:usa\", \"{bikes:racing}:italy\"\n        ]);\n        Console.WriteLine(string.Join(\", \", res22));    // >>> bike:1\n\n        RedisValue[] res23 = db.SetCombine(SetOperation.Union, [\"{bikes:racing}:france\", \"{bikes:racing}:usa\", \"{bikes:racing}:italy\"\n        ]);\n        Console.WriteLine(string.Join(\", \", res23));    // >>> bike:1, bike:2, bike:3, bike:4\n\n        RedisValue[] res24 = db.SetCombine(SetOperation.Difference, [\"{bikes:racing}:france\", \"{bikes:racing}:usa\", \"{bikes:racing}:italy\"\n        ]);\n        Console.WriteLine(string.Join(\", \", res24));    // >>> <empty set>\n\n        RedisValue[] res25 = db.SetCombine(SetOperation.Difference, [\"{bikes:racing}:usa\", \"{bikes:racing}:france\"]);\n        Console.WriteLine(string.Join(\", \", res25));    // >>> bike:4\n\n        RedisValue[] res26 = db.SetCombine(SetOperation.Difference, [\"{bikes:racing}:france\", \"{bikes:racing}:usa\"]);\n        Console.WriteLine(string.Join(\", \", res26));    // >>> bike:2, bike:3",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex38",
      "language": "go",
      "code": "rdb.Del(ctx, \"bikes:racing:france\")\n\trdb.Del(ctx, \"bikes:racing:usa\")\n\trdb.Del(ctx, \"bikes:racing:italy\")\n\n\t_, err := rdb.SAdd(ctx, \"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = rdb.SAdd(ctx, \"bikes:racing:usa\", \"bike:1\", \"bike:4\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = rdb.SAdd(ctx, \"bikes:racing:italy\", \"bike:1\", \"bike:2\", \"bike:3\", \"bike:4\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tres14, err := rdb.SInter(ctx, \"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res14) // >>> [bike:1]\n\n\tres15, err := rdb.SUnion(ctx, \"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Sort the strings in the slice to make sure the output is lexicographical\n\tsort.Strings(res15)\n\n\tfmt.Println(res15) // >>> [bike:1 bike:2 bike:3 bike:4]\n\n\tres16, err := rdb.SDiff(ctx, \"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res16) // >>> []\n\n\tres17, err := rdb.SDiff(ctx, \"bikes:racing:usa\", \"bikes:racing:france\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res17) // >>> [bike:4]\n\n\tres18, err := rdb.SDiff(ctx, \"bikes:racing:france\", \"bikes:racing:usa\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Sort the strings in the slice to make sure the output is lexicographical\n\tsort.Strings(res18)\n\n\tfmt.Println(res18) // >>> [bike:2 bike:3]",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex39",
      "language": "java",
      "code": "CompletableFuture<Void> multisets = asyncCommands.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\")\n                    .thenCompose(res14 -> {\n                        System.out.println(res14); // >>> 0\n                        return asyncCommands.sadd(\"bikes:racing:usa\", \"bike:1\", \"bike:4\");\n                    }).thenCompose(res15 -> {\n                        System.out.println(res15); // >>> 0\n                        return asyncCommands.sadd(\"bikes:racing:italy\", \"bike:1\", \"bike:2\", \"bike:3\", \"bike:4\");\n                    }).thenCompose(res16 -> {\n                        System.out.println(res16); // >>> 4\n                        return asyncCommands.sinter(\"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\");\n                    }).thenCompose(res17 -> {\n                        System.out.println(res17); // >>> [bike:1]\n                        return asyncCommands.sunion(\"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\");\n                    }).thenCompose(res18 -> {\n                        System.out.println(res18); // >>> [bike:1, bike:2, bike:3, bike:4]\n                        return asyncCommands.sdiff(\"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\");\n                    }).thenCompose(res19 -> {\n                        System.out.println(res19); // >>> []\n                        return asyncCommands.sdiff(\"bikes:racing:usa\", \"bikes:racing:france\");\n                    }).thenCompose(res20 -> {\n                        System.out.println(res20); // >>> [bike:4]\n                        return asyncCommands.sdiff(\"bikes:racing:france\", \"bikes:racing:usa\");\n                    }).thenAccept(res21 -> {\n                        System.out.println(res21); // >>> [bike:2, bike:3]\n                    }).toCompletableFuture();",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex40",
      "language": "java",
      "code": "Mono<Void> add3sets = reactiveCommands.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\")\n                    .doOnNext(result -> {\n                        System.out.println(result); // >>> 0\n                    }).flatMap(v -> reactiveCommands.sadd(\"bikes:racing:usa\", \"bike:1\", \"bike:4\")).doOnNext(result -> {\n                        System.out.println(result); // >>> 0\n                    }).flatMap(v -> reactiveCommands.sadd(\"bikes:racing:italy\", \"bike:1\", \"bike:2\", \"bike:3\", \"bike:4\"))\n                    .doOnNext(result -> {\n                        System.out.println(result); // >>> 4,\n                    }).then();\n            add3sets.block();\n\n            Mono<List<String>> multisets1 = reactiveCommands\n                    .sinter(\"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\").collectList().doOnNext(result -> {\n                        System.out.println(result); // >>> [bike:1]\n                    });\n\n            Mono<List<String>> multisets2 = reactiveCommands\n                    .sunion(\"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\").collectList().doOnNext(result -> {\n                        System.out.println(result); // >>> [bike:1, bike:2, bike:3, bike:4]\n                    });\n\n            Mono<List<String>> multisets3 = reactiveCommands\n                    .sdiff(\"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\").collectList().doOnNext(result -> {\n                        System.out.println(result); // >>> []\n                    });\n\n            Mono<List<String>> multisets4 = reactiveCommands.sdiff(\"bikes:racing:usa\", \"bikes:racing:france\").collectList()\n                    .doOnNext(result -> {\n                        System.out.println(result); // >>> [bike:4]\n                    });\n\n            Mono<List<String>> multisets5 = reactiveCommands.sdiff(\"bikes:racing:france\", \"bikes:racing:usa\").collectList()\n                    .doOnNext(result -> {\n                        System.out.println(result); // >>> [bike:2, bike:3]\n                    });",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex41",
      "language": "java",
      "code": "jedis.del(\"bikes:racing:france\");\n        jedis.del(\"bikes:racing:usa\");\n        jedis.del(\"bikes:racing:italy\");\n\n        jedis.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\");\n        jedis.sadd(\"bikes:racing:usa\", \"bike:1\", \"bike:4\");\n        jedis.sadd(\"bikes:racing:italy\", \"bike:1\", \"bike:2\", \"bike:3\", \"bike:4\");\n\n        Set<String> res14 = jedis.sinter(\"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\");\n        System.out.println(res14);  // >>> [bike:1]\n\n        Set<String> res15 = jedis.sunion(\"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\");\n        System.out.println(res15);  // >>> [bike:1, bike:2, bike:3, bike:4]\n\n        Set<String> res16 = jedis.sdiff(\"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\");\n        System.out.println(res16);  // >>> []\n\n        Set<String> res17 = jedis.sdiff(\"bikes:racing:usa\", \"bikes:racing:france\");\n        System.out.println(res17);  // >>> [bike:4]\n\n        Set<String> res18 = jedis.sdiff(\"bikes:racing:france\", \"bikes:racing:usa\");\n        System.out.println(res18);  // >>> [bike:2, bike:3]",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex42",
      "language": "javascript",
      "code": "await client.del('bikes:racing:france')\nawait client.del('bikes:racing:usa')\nawait client.del('bikes:racing:italy')\n\nawait client.sAdd('bikes:racing:france', ['bike:1', 'bike:2', 'bike:3'])\nawait client.sAdd('bikes:racing:usa', ['bike:1', 'bike:4'])\nawait client.sAdd('bikes:racing:italy', ['bike:1', 'bike:2', 'bike:3', 'bike:4'])\n\nconst res14 = await client.sInter(\n  ['bikes:racing:france', 'bikes:racing:usa', 'bikes:racing:italy']\n)\nconsole.log(res14)  // >>> ['bike:1']\n\nconst res15 = await client.sUnion(\n  ['bikes:racing:france', 'bikes:racing:usa', 'bikes:racing:italy']\n)\nconsole.log(res15)  // >>> ['bike:1', 'bike:2', 'bike:3', 'bike:4']\n\nconst res16 = await client.sDiff(['bikes:racing:france', 'bikes:racing:usa', 'bikes:racing:italy'])\nconsole.log(res16)  // >>> []\n\nconst res17 = await client.sDiff(['bikes:racing:usa', 'bikes:racing:france'])\nconsole.log(res17)  // >>> ['bike:4']\n\nconst res18 = await client.sDiff(['bikes:racing:france', 'bikes:racing:usa'])\nconsole.log(res18)  // >>> ['bike:2', 'bike:3']",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex43",
      "language": "php",
      "code": "$r->del('bikes:racing:france');\n        $r->del('bikes:racing:usa');\n        $r->del('bikes:racing:italy');\n            \n        $r->sadd('bikes:racing:france', ['bike:1', 'bike:2', 'bike:3']);\n        $r->sadd('bikes:racing:usa', ['bike:1', 'bike:4']);\n        $r->sadd('bikes:racing:italy', ['bike:1', 'bike:2', 'bike:3', 'bike:4']);\n\n        $res14 = $r->sinter(['bikes:racing:france', 'bikes:racing:usa', 'bikes:racing:italy']);\n        echo json_encode($res14) . PHP_EOL;\n        // >>> [\"bike:1\"]\n\n        $res15 = $r->sunion(['bikes:racing:france', 'bikes:racing:usa', 'bikes:racing:italy']);\n        sort($res15);\n        echo json_encode($res15) . PHP_EOL;\n        // >>> [\"bike:1\",\"bike:2\",\"bike:3\",\"bike:4\"]\n\n        $res16 = $r->sdiff(['bikes:racing:france', 'bikes:racing:usa', 'bikes:racing:italy']);\n        echo json_encode($res16) . PHP_EOL;\n        // >>> []\n\n        $res17 = $r->sdiff(['bikes:racing:usa', 'bikes:racing:france']);\n        echo json_encode($res17) . PHP_EOL;\n        // >>> [\"bike:4\"]\n\n        $res18 = $r->sdiff(['bikes:racing:france', 'bikes:racing:usa']);\n        sort($res18);\n        echo json_encode($res18) . PHP_EOL;\n        // >>> [\"bike:2\",\"bike:3\"]",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex44",
      "language": "python",
      "code": "r.delete(\"bikes:racing:france\")\nr.delete(\"bikes:racing:usa\")\nr.delete(\"bikes:racing:italy\")\n\nr.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\")\nr.sadd(\"bikes:racing:usa\", \"bike:1\", \"bike:4\")\nr.sadd(\"bikes:racing:italy\", \"bike:1\", \"bike:2\", \"bike:3\", \"bike:4\")\n\nres13 = r.sinter(\"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\")\nprint(res13)  # >>> {'bike:1'}\n\nres14 = r.sunion(\"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\")\nprint(res14)  # >>> {'bike:1', 'bike:2', 'bike:3', 'bike:4'}\n\nres15 = r.sdiff(\"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\")\nprint(res15)  # >>> set()\n\nres16 = r.sdiff(\"bikes:racing:usa\", \"bikes:racing:france\")\nprint(res16)  # >>> {'bike:4'}\n\nres17 = r.sdiff(\"bikes:racing:france\", \"bikes:racing:usa\")\nprint(res17)  # >>> {'bike:2', 'bike:3'}",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex45",
      "language": "ruby",
      "code": "r.del('bikes:racing:france', 'bikes:racing:usa', 'bikes:racing:italy')\n\nr.sadd('bikes:racing:france', ['bike:1', 'bike:2', 'bike:3'])\nr.sadd('bikes:racing:usa', ['bike:1', 'bike:4'])\nr.sadd('bikes:racing:italy', ['bike:1', 'bike:2', 'bike:3', 'bike:4'])\n\nres14 = r.sinter('bikes:racing:france', 'bikes:racing:usa', 'bikes:racing:italy')\nputs res14.inspect # >>> [\"bike:1\"]\n\nres15 = r.sunion('bikes:racing:france', 'bikes:racing:usa', 'bikes:racing:italy')\nputs res15.sort.inspect # >>> [\"bike:1\", \"bike:2\", \"bike:3\", \"bike:4\"]\n\nres16 = r.sdiff('bikes:racing:france', 'bikes:racing:usa', 'bikes:racing:italy')\nputs res16.inspect # >>> []\n\nres17 = r.sdiff('bikes:racing:france', 'bikes:racing:usa')\nputs res17.sort.inspect # >>> [\"bike:2\", \"bike:3\"]\n\nres18 = r.sdiff('bikes:racing:usa', 'bikes:racing:france')\nputs res18.inspect # >>> [\"bike:4\"]",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex46",
      "language": "rust",
      "code": "let _: usize = r\n            .del(&[\"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\"])\n            .await\n            .unwrap_or(0);\n        let _: usize = r\n            .sadd(\"bikes:racing:france\", &[\"bike:1\", \"bike:2\", \"bike:3\"])\n            .await\n            .unwrap_or(0);\n        let _: usize = r\n            .sadd(\"bikes:racing:usa\", &[\"bike:1\", \"bike:4\"])\n            .await\n            .unwrap_or(0);\n        let _: usize = r\n            .sadd(\"bikes:racing:italy\", &[\"bike:1\", \"bike:2\", \"bike:3\", \"bike:4\"])\n            .await\n            .unwrap_or(0);\n\n        if let Ok(res) = r\n            .sinter(&[\"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\"])\n            .await\n        {\n            let res: HashSet<String> = res;\n            let res = sorted_set(res);\n            println!(\"{res:?}\"); // >>> [\"bike:1\"]\n        }\n\n        if let Ok(res) = r\n            .sunion(&[\"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\"])\n            .await\n        {\n            let res: HashSet<String> = res;\n            let res = sorted_set(res);\n            println!(\"{res:?}\"); // >>> [\"bike:1\", \"bike:2\", \"bike:3\", \"bike:4\"]\n        }\n\n        if let Ok(res) = r\n            .sdiff(&[\"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\"])\n            .await\n        {\n            let res: HashSet<String> = res;\n            let res = sorted_set(res);\n            println!(\"{res:?}\"); // >>> []\n        }\n\n        if let Ok(res) = r.sdiff(&[\"bikes:racing:france\", \"bikes:racing:usa\"]).await {\n            let res: HashSet<String> = res;\n            let res = sorted_set(res);\n            println!(\"{res:?}\"); // >>> [\"bike:2\", \"bike:3\"]\n        }\n\n        if let Ok(res) = r.sdiff(&[\"bikes:racing:usa\", \"bikes:racing:france\"]).await {\n            let res: HashSet<String> = res;\n            let res = sorted_set(res);\n            println!(\"{res:?}\"); // >>> [\"bike:4\"]\n        }",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex47",
      "language": "rust",
      "code": "let _: usize = r.del(&[\"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\"]).unwrap_or(0);\n        let _: usize = r.sadd(\"bikes:racing:france\", &[\"bike:1\", \"bike:2\", \"bike:3\"]).unwrap_or(0);\n        let _: usize = r.sadd(\"bikes:racing:usa\", &[\"bike:1\", \"bike:4\"]).unwrap_or(0);\n        let _: usize = r.sadd(\"bikes:racing:italy\", &[\"bike:1\", \"bike:2\", \"bike:3\", \"bike:4\"]).unwrap_or(0);\n\n        if let Ok(res) =\n            r.sinter(&[\"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\"])\n        {\n            let res: HashSet<String> = res;\n            let res = sorted_set(res);\n            println!(\"{res:?}\"); // >>> [\"bike:1\"]\n        }\n\n        if let Ok(res) =\n            r.sunion(&[\"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\"])\n        {\n            let res: HashSet<String> = res;\n            let res = sorted_set(res);\n            println!(\"{res:?}\"); // >>> [\"bike:1\", \"bike:2\", \"bike:3\", \"bike:4\"]\n        }\n\n        if let Ok(res) =\n            r.sdiff(&[\"bikes:racing:france\", \"bikes:racing:usa\", \"bikes:racing:italy\"])\n        {\n            let res: HashSet<String> = res;\n            let res = sorted_set(res);\n            println!(\"{res:?}\"); // >>> []\n        }\n\n        if let Ok(res) = r.sdiff(&[\"bikes:racing:france\", \"bikes:racing:usa\"]) {\n            let res: HashSet<String> = res;\n            let res = sorted_set(res);\n            println!(\"{res:?}\"); // >>> [\"bike:2\", \"bike:3\"]\n        }\n\n        if let Ok(res) = r.sdiff(&[\"bikes:racing:usa\", \"bikes:racing:france\"]) {\n            let res: HashSet<String> = res;\n            let res = sorted_set(res);\n            println!(\"{res:?}\"); // >>> [\"bike:4\"]\n        }",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex48",
      "language": "plaintext",
      "code": "> DEL bikes:racing:france\n(integer) 1\n> SADD bikes:racing:france bike:1 bike:2 bike:3 bike:4 bike:5\n(integer) 5\n> SREM bikes:racing:france bike:1\n(integer) 1\n> SPOP bikes:racing:france\n\"bike:3\"\n> SMEMBERS bikes:racing:france\n1) \"bike:2\"\n2) \"bike:4\"\n3) \"bike:5\"\n> SRANDMEMBER bikes:racing:france\n\"bike:2\"",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex49",
      "language": "csharp",
      "code": "db.KeyDelete(\"bikes:racing:france\");\n\n        long res27 = db.SetAdd(\"bikes:racing:france\", [\"bike:1\", \"bike:2\", \"bike:3\", \"bike:4\", \"bike:5\"]);\n\n        bool res28 = db.SetRemove(\"bikes:racing:france\", \"bike:1\");\n        Console.WriteLine(res28);   // >>> True\n\n        RedisValue res29 = db.SetPop(\"bikes:racing:france\");\n        Console.WriteLine(res29);   // >>> bike:3\n\n        RedisValue[] res30 = db.SetMembers(\"bikes:racing:france\");\n        Console.WriteLine(string.Join(\", \", res30));    // >>> bike:2, bike:4, bike:5\n\n        RedisValue res31 = db.SetRandomMember(\"bikes:racing:france\");\n        Console.WriteLine(res31);   // >>> bike:4",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex50",
      "language": "go",
      "code": "rdb.Del(ctx, \"bikes:racing:france\")\n\n\t_, err := rdb.SAdd(ctx, \"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\", \"bike:4\", \"bike:5\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tres19, err := rdb.SRem(ctx, \"bikes:racing:france\", \"bike:1\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res19) // >>> 1\n\n\tres20, err := rdb.SPop(ctx, \"bikes:racing:france\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res20) // >>> <random element>\n\n\tres21, err := rdb.SMembers(ctx, \"bikes:racing:france\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res21) // >>> <remaining elements>\n\n\tres22, err := rdb.SRandMember(ctx, \"bikes:racing:france\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res22) // >>> <random element>",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex51",
      "language": "java",
      "code": "CompletableFuture<Void> sRem = asyncCommands\n                    .sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\", \"bike:4\", \"bike:5\").thenCompose(res22 -> {\n                        System.out.println(res22); // >>> 2\n                        return asyncCommands.srem(\"bikes:racing:france\", \"bike:1\");\n                    }).thenCompose(res23 -> {\n                        System.out.println(res23); // >>> 1\n                        return asyncCommands.spop(\"bikes:racing:france\");\n                    }).thenCompose(res24 -> {\n                        System.out.println(res24); // >>> bike:3 (for example)\n                        return asyncCommands.smembers(\"bikes:racing:france\");\n                    }).thenCompose(res25 -> {\n                        System.out.println(res25); // >>> [bike:2, bike:4, bike:5] (for example)\n                        return asyncCommands.srandmember(\"bikes:racing:france\");\n                    }).thenAccept(res26 -> {\n                        System.out.println(res26); // >>> bike:4 (for example)\n                    }).toCompletableFuture();",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex52",
      "language": "java",
      "code": "Mono<Void> sRem = reactiveCommands.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\", \"bike:4\", \"bike:5\")\n                    .doOnNext(result -> {\n                        System.out.println(result); // >>> 2\n                    }).flatMap(v -> reactiveCommands.srem(\"bikes:racing:france\", \"bike:1\")).doOnNext(result -> {\n                        System.out.println(result); // >>> 1\n                    }).flatMap(v -> reactiveCommands.spop(\"bikes:racing:france\")).doOnNext(result -> {\n                        System.out.println(result); // >>> bike:3 (for example)\n                    }).flatMap(v -> reactiveCommands.smembers(\"bikes:racing:france\").collectList()).doOnNext(result -> {\n                        System.out.println(result); // >>> [bike:2, bike:4, bike:5] (for example)\n                    }).flatMap(v -> reactiveCommands.srandmember(\"bikes:racing:france\")).doOnNext(result -> {\n                        System.out.println(result); // >>> bike:4 (for example)\n                    }).then();",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex53",
      "language": "java",
      "code": "jedis.del(\"bikes:racing:france\");\n        jedis.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\", \"bike:4\", \"bike:5\");\n\n        long res19 = jedis.srem(\"bikes:racing:france\", \"bike:1\");\n        System.out.println(res18);  // >>> 1\n\n        String res20 = jedis.spop(\"bikes:racing:france\");\n        System.out.println(res20);  // >>> bike:3\n\n        Set<String> res21 = jedis.smembers(\"bikes:racing:france\");\n        System.out.println(res21);  // >>> [bike:2, bike:4, bike:5]\n\n        String res22 = jedis.srandmember(\"bikes:racing:france\");\n        System.out.println(res22);  // >>> bike:4",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex54",
      "language": "javascript",
      "code": "await client.del('bikes:racing:france')\n\nawait client.sAdd('bikes:racing:france', ['bike:1', 'bike:2', 'bike:3', 'bike:4', 'bike:5'])\n\nconst res19 = await client.sRem('bikes:racing:france', 'bike:1')\nconsole.log(res19)  // >>> 1\n\nconst res20 = await client.sPop('bikes:racing:france')\nconsole.log(res20)  // >>> bike:3 or other random value\n\nconst res21 = await client.sMembers('bikes:racing:france')\nconsole.log(res21)  // >>> ['bike:2', 'bike:4', 'bike:5']; depends on previous result\n\nconst res22 = await client.sRandMember('bikes:racing:france')\nconsole.log(res22)  // >>> bike:4 or other random value",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex55",
      "language": "php",
      "code": "$r->del('bikes:racing:france');\n\n        $r->sadd('bikes:racing:france', ['bike:1', 'bike:2', 'bike:3', 'bike:4', 'bike:5']);\n\n        $res19 = $r->srem('bikes:racing:france', ['bike:1']);\n        echo $res19 . PHP_EOL;\n        // >>> 1\n\n        $res20 = $r->spop('bikes:racing:france');\n        echo $res20 . PHP_EOL;\n        // >>> bike:3 (for example)\n\n        $res21 = $r->smembers('bikes:racing:france');\n        sort($res21);\n        echo json_encode($res21) . PHP_EOL;\n        // >>> [\"bike:2\",\"bike:4\",\"bike:5\"]\n\n        $res22 = $r->srandmember('bikes:racing:france');\n        echo $res22 . PHP_EOL;\n        // >>> bike:4 (for example)",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex56",
      "language": "python",
      "code": "r.delete(\"bikes:racing:france\")\n\nr.sadd(\"bikes:racing:france\", \"bike:1\", \"bike:2\", \"bike:3\", \"bike:4\", \"bike:5\")\n\nres18 = r.srem(\"bikes:racing:france\", \"bike:1\")\nprint(res18)  # >>> 1\n\nres19 = r.spop(\"bikes:racing:france\")\nprint(res19)  # >>> bike:3\n\nres20 = r.smembers(\"bikes:racing:france\")\nprint(res20)  # >>> {'bike:2', 'bike:4', 'bike:5'}\n\nres21 = r.srandmember(\"bikes:racing:france\")\nprint(res21)  # >>> bike:4",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex57",
      "language": "ruby",
      "code": "r.del('bikes:racing:france')\n\nr.sadd('bikes:racing:france', ['bike:1', 'bike:2', 'bike:3', 'bike:4', 'bike:5'])\n\nres19 = r.srem('bikes:racing:france', ['bike:1'])\nputs res19 # >>> 1\n\nres20 = r.spop('bikes:racing:france')\nputs res20 # >>> bike:3, for example\n\nres21 = r.smembers('bikes:racing:france')\nputs res21.sort.inspect # >>> Remaining members, in no particular order\n\nres22 = r.srandmember('bikes:racing:france')\nputs res22 # >>> bike:4, for example",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex58",
      "language": "rust",
      "code": "let _: usize = r.del(\"bikes:racing:france\").await.unwrap_or(0);\n        let _: usize = r\n            .sadd(\n                \"bikes:racing:france\",\n                &[\"bike:1\", \"bike:2\", \"bike:3\", \"bike:4\", \"bike:5\"],\n            )\n            .await\n            .unwrap_or(0);\n\n        if let Ok(res) = r.srem(\"bikes:racing:france\", \"bike:1\").await {\n            let res: usize = res;\n            println!(\"{res}\"); // >>> 1\n        }\n\n        if let Ok(res) = r.spop(\"bikes:racing:france\").await {\n            let res: Option<String> = res;\n            match res {\n                Some(res) => println!(\"{res}\"), // >>> bike:3 (for example)\n                None => println!(\"(nil)\"),\n            }\n        }\n\n        if let Ok(res) = r.smembers(\"bikes:racing:france\").await {\n            let res: HashSet<String> = res;\n            let res = sorted_set(res);\n            println!(\"{res:?}\"); // >>> [\"bike:2\", \"bike:4\", \"bike:5\"] (for example)\n        }\n\n        if let Ok(res) = r.srandmember(\"bikes:racing:france\").await {\n            let res: Option<String> = res;\n            match res {\n                Some(res) => println!(\"{res}\"), // >>> bike:4 (for example)\n                None => println!(\"(nil)\"),\n            }\n        }",
      "section_id": "tutorial"
    },
    {
      "id": "tutorial-ex59",
      "language": "rust",
      "code": "let _: usize = r.del(\"bikes:racing:france\").unwrap_or(0);\n        let _: usize = r\n            .sadd(\n                \"bikes:racing:france\",\n                &[\"bike:1\", \"bike:2\", \"bike:3\", \"bike:4\", \"bike:5\"],\n            )\n            .unwrap_or(0);\n\n        if let Ok(res) = r.srem(\"bikes:racing:france\", \"bike:1\") {\n            let res: usize = res;\n            println!(\"{res}\"); // >>> 1\n        }\n\n        if let Ok(res) = r.spop(\"bikes:racing:france\") {\n            let res: Option<String> = res;\n            match res {\n                Some(res) => println!(\"{res}\"), // >>> bike:3 (for example)\n                None => println!(\"(nil)\"),\n            }\n        }\n\n        if let Ok(res) = r.smembers(\"bikes:racing:france\") {\n            let res: HashSet<String> = res;\n            let res = sorted_set(res);\n            println!(\"{res:?}\"); // >>> [\"bike:2\", \"bike:4\", \"bike:5\"] (for example)\n        }\n\n        if let Ok(res) = r.srandmember(\"bikes:racing:france\") {\n            let res: Option<String> = res;\n            match res {\n                Some(res) => println!(\"{res}\"), // >>> bike:4 (for example)\n                None => println!(\"(nil)\"),\n            }\n        }",
      "section_id": "tutorial"
    }
  ]
}
