{
  "schema_version": 2,
  "id": "commands/spersist",
  "title": "SPERSIST",
  "url": "https://redis.io/docs/latest/commands/spersist/",
  "summary": "Removes the expiration time for each specified member",
  "since": "8.12.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-11-23T06:19:08-08:00",
  "page_type": "content",
  "content_hash": "165345a5155ba76a445cc4c776b2ed4044fa198a91c5bf06e920108e9bcd4031",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Removes the existing expiration from one or more set members. This turns each member from _volatile_ (a member with an expiration) back into _persistent_ (a member with no TTL, which never expires)."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary>\n\nThe name of the key that holds the set.\n\n</details>\n\n<details open><summary><code>MEMBERS nummembers member [member ...]</code></summary>\n\nThe set members to remove the expiration from. `nummembers` is the number of members, followed by that many member names.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "[code example]"
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Not supported\">&#x274c; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> | <span title=\"Not supported\">&#x274c; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\n* [Array reply](https://redis.io/docs/latest/develop/reference/protocol-spec#arrays). For each member:\n    - [Integer reply](https://redis.io/docs/latest/develop/reference/protocol-spec#integers): `-2` if no such member exists in the set, or the key does not exist.\n    - [Integer reply](https://redis.io/docs/latest/develop/reference/protocol-spec#integers): `-1` if the member exists but has no associated expiration.\n    - [Integer reply](https://redis.io/docs/latest/develop/reference/protocol-spec#integers): `1` if the expiration was removed.\n* [Simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors):\n    - if parsing failed, mandatory arguments are missing, unknown arguments are specified, or argument values are of the wrong type or out of range.\n    - if the key exists but is not a set.\n\n**RESP3:**\n\n* [Array reply](https://redis.io/docs/latest/develop/reference/protocol-spec#arrays). For each member:\n    - [Integer reply](https://redis.io/docs/latest/develop/reference/protocol-spec#integers): `-2` if no such member exists in the set, or the key does not exist.\n    - [Integer reply](https://redis.io/docs/latest/develop/reference/protocol-spec#integers): `-1` if the member exists but has no associated expiration.\n    - [Integer reply](https://redis.io/docs/latest/develop/reference/protocol-spec#integers): `1` if the expiration was removed.\n* [Simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors):\n    - if parsing failed, mandatory arguments are missing, unknown arguments are specified, or argument values are of the wrong type or out of range.\n    - if the key exists but is not a set."
    },
    {
      "id": "see-also",
      "title": "See also",
      "role": "related",
      "text": "[`SEXPIRE`](https://redis.io/docs/latest/commands/sexpire) | [`SPEXPIRE`](https://redis.io/docs/latest/commands/spexpire) | [`SEXPIREAT`](https://redis.io/docs/latest/commands/sexpireat) | [`SPEXPIREAT`](https://redis.io/docs/latest/commands/spexpireat) | [`SADDEX`](https://redis.io/docs/latest/commands/saddex) | [`STTL`](https://redis.io/docs/latest/commands/sttl) | [`SPTTL`](https://redis.io/docs/latest/commands/spttl) | [`SEXPIRETIME`](https://redis.io/docs/latest/commands/sexpiretime) | [`SPEXPIRETIME`](https://redis.io/docs/latest/commands/spexpiretime)"
    },
    {
      "id": "related-topics",
      "title": "Related topics",
      "role": "related",
      "text": "- [Set member expiration](https://redis.io/docs/latest/develop/data-types/sets#member-expiration)"
    }
  ],
  "examples": [
    {
      "id": "examples-ex0",
      "language": "redis",
      "code": "redis> SADD myset member1 member2\n(integer) 2\nredis> SEXPIRE myset 300 MEMBERS 2 member1 member2\n1) (integer) 1\n2) (integer) 1\nredis> SPERSIST myset MEMBERS 1 member2\n1) (integer) 1\nredis> STTL myset MEMBERS 2 member1 member2\n1) (integer) 300\n2) (integer) -1\nredis> SPERSIST myset MEMBERS 2 member2 member3\n1) (integer) -1\n2) (integer) -2",
      "section_id": "examples"
    }
  ]
}
