{
  "id": "himport-discard",
  "title": "HIMPORT DISCARD",
  "url": "https://redis.io/docs/latest/commands/himport-discard/",
  "summary": "Removes a single session-local fieldset by name.",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-07-30T08:54:30-07:00",
  "page_type": "content",
  "content_hash": "59bdc37e20b0befa504a2ad13c28e61d24ba957ef1d2cd665d06f8961dd0dd7f",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Removes a single session-local fieldset, previously defined with [`HIMPORT PREPARE`](https://redis.io/docs/latest/commands/himport-prepare), from the current connection."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>fieldset-name</code></summary>\n\nThe name of the fieldset to remove from the current connection.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "[code example]"
    },
    {
      "id": "details",
      "title": "Details",
      "role": "content",
      "text": "Discarding a fieldset only removes the fieldset itself; it does not affect any hashes already created from it with [`HIMPORT SET`](https://redis.io/docs/latest/commands/himport-set).\n\nUse `HIMPORT DISCARD` to free up resources on the connection once a bulk-ingestion job that used a given fieldset has finished. If you don't discard it, the fieldset stays allocated on the connection until the connection closes or the client issues the [`RESET`](https://redis.io/docs/latest/commands/reset) command."
    },
    {
      "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[Integer reply](../../develop/reference/protocol-spec#integers): `1` if the fieldset was removed, or `0` if no fieldset with that name existed on the connection.\n\n**RESP3:**\n\n[Integer reply](../../develop/reference/protocol-spec#integers): `1` if the fieldset was removed, or `0` if no fieldset with that name existed on the connection."
    },
    {
      "id": "see-also",
      "title": "See also",
      "role": "related",
      "text": "[`HIMPORT PREPARE`](https://redis.io/docs/latest/commands/himport-prepare/) | [`HIMPORT DISCARDALL`](https://redis.io/docs/latest/commands/himport-discardall/)"
    }
  ],
  "examples": [
    {
      "id": "examples-ex0",
      "language": "plaintext",
      "code": "> HIMPORT PREPARE u name email age\nOK\n> HIMPORT DISCARD u\n(integer) 1\n> HIMPORT DISCARD u\n(integer) 0",
      "section_id": "examples"
    }
  ]
}
