{
  "id": "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.",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-07-30T08:54:30-07:00",
  "page_type": "content",
  "content_hash": "6dbd0d2345aa42800e6e03b307737049d58f8ef3e772b6b25735a2a1ff754228",
  "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": "[code example]"
    },
    {
      "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": [
    {
      "id": "examples-ex0",
      "language": "plaintext",
      "code": "> HIMPORT PREPARE u name email age\nOK",
      "section_id": "examples"
    }
  ]
}
