SADDEX

Syntax

  1. SADDEX key seconds member [member ...]

Time complexity: O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.

ACL categories: @write, @set, @fast

Warning: Experimental! Dragonfly specific.

Similar to SADD but adds one or more members that expire after specified number of seconds. An error is returned when the value stored at key is not a set.

Return

Integer reply: the number of elements that were added to the set, not including all the elements already present in the set.

Examples

  1. dragonfly> SADDEX myset 10 "Hello"
  2. (integer) 1
  3. dragonfly> SADDEX myset 20 World Dragonfly
  4. (integer) 2
  5. dragonfly> SMEMBERS myset
  6. 1) "Hello"
  7. 2) "World"
  8. 3) "Dragonfly"