{
  "schema_version": 2,
  "id": "commands/himport-prepare",
  "title": "HIMPORT PREPARE",
  "url": "https://redis.io/docs/latest/commands/himport-prepare/",
  "summary": "Defines a session-local fieldset that maps a name to a sorted set of field names.",
  "since": "8.10.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:47:41+01:00",
  "page_type": "content",
  "content_hash": "a3fd78670844a154207110510154610fc3d28bbbdee7f203af3ee0e707c114dc",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Defines a session-local fieldset that maps a name to an ordered list of field names, to be used by later [`HIMPORT SET`](https://redis.io/docs/latest/commands/himport-set) commands on the same connection."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>fieldset-name</code></summary>\n\nThe name to give the fieldset. The fieldset is scoped to the current connection. Preparing a fieldset with a name that already exists on the connection replaces the previous definition.\n\n</details>\n\n<details open><summary><code>field [field ...]</code></summary>\n\nOne or more field names to store under the fieldset, in the order you intend to supply their values to [`HIMPORT SET`](https://redis.io/docs/latest/commands/himport-set). A field name must not appear more than once in the same fieldset.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "redis> HIMPORT PREPARE u name email age\nOK"
    },
    {
      "id": "details",
      "title": "Details",
      "role": "content",
      "text": "A fieldset is scoped to the client connection: it is not visible to other clients and is discarded when the connection closes or the client issues the [`RESET`](https://redis.io/docs/latest/commands/reset) command. A connection can prepare several fieldsets, each under its own name.\n\nThe command returns an error if the same field name is given more than once."
    },
    {
      "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[Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK`.\n\n**RESP3:**\n\n[Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK`."
    },
    {
      "id": "see-also",
      "title": "See also",
      "role": "related",
      "text": "[`HIMPORT SET`](https://redis.io/docs/latest/commands/himport-set) | [`HIMPORT DISCARD`](https://redis.io/docs/latest/commands/himport-discard) | [`HIMPORT DISCARDALL`](https://redis.io/docs/latest/commands/himport-discardall)"
    }
  ],
  "examples": []
}
