-
Notifications
You must be signed in to change notification settings - Fork 345
DEV: (cmds) add new hash bulk insertion commands/docs #3671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dwdougherty
wants to merge
3
commits into
feature-oss-8.10
Choose a base branch
from
DOC-6861
base: feature-oss-8.10
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| --- | ||
| acl_categories: | ||
| - '@hash' | ||
| - '@slow' | ||
| arguments: | ||
| - display_text: fieldset-name | ||
| name: fieldset-name | ||
| type: string | ||
| arity: 3 | ||
| categories: | ||
| - docs | ||
| - develop | ||
| - stack | ||
| - oss | ||
| - rs | ||
| - rc | ||
| - oss | ||
| - kubernetes | ||
| - clients | ||
| complexity: O(N) where N is the number of session-local fieldsets. | ||
| description: Removes a single session-local fieldset by name. | ||
| group: hash | ||
| hidden: false | ||
| hints: | ||
| - request_policy:all_shards | ||
| linkTitle: HIMPORT DISCARD | ||
| railroad_diagram: /images/railroad/himport-discard.svg | ||
| since: 8.10.0 | ||
| summary: Removes a single session-local fieldset by name. | ||
| syntax_fmt: HIMPORT DISCARD fieldset-name | ||
| title: HIMPORT DISCARD | ||
| --- | ||
| Removes a single session-local fieldset, previously defined with [`HIMPORT PREPARE`]({{< relref "/commands/himport-prepare" >}}), from the current connection. | ||
|
|
||
| ## Required arguments | ||
|
|
||
| <details open><summary><code>fieldset-name</code></summary> | ||
|
|
||
| The name of the fieldset to remove from the current connection. | ||
|
|
||
| </details> | ||
|
|
||
| ## Examples | ||
|
|
||
| ```shell | ||
| > HIMPORT PREPARE u name email age | ||
| OK | ||
| > HIMPORT DISCARD u | ||
| (integer) 1 | ||
| > HIMPORT DISCARD u | ||
| (integer) 0 | ||
| ``` | ||
|
|
||
| ## Redis Software and Redis Cloud compatibility | ||
|
|
||
| | Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | | ||
| |:----------------------|:-----------------|:------| | ||
| | <span title="Not supported">❌ Standard</span><br /><span title="Not supported"><nobr>❌ Active-Active</nobr></span> | <span title="Not supported">❌ Standard</span><br /><span title="Not supported"><nobr>❌ Active-Active</nobr></span> | | | ||
|
|
||
| ## Return information | ||
|
|
||
| {{< multitabs id="himport-discard-return-info" | ||
| tab1="RESP2" | ||
| tab2="RESP3" >}} | ||
|
|
||
| [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. | ||
|
|
||
| -tab-sep- | ||
|
|
||
| [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. | ||
|
|
||
| {{< /multitabs >}} | ||
|
|
||
| ## See also | ||
|
|
||
| [`HIMPORT PREPARE`]({{< relref "commands/himport-prepare/" >}}) | [`HIMPORT DISCARDALL`]({{< relref "commands/himport-discardall/" >}}) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| --- | ||
| acl_categories: | ||
| - '@hash' | ||
| - '@slow' | ||
| arity: 2 | ||
| categories: | ||
| - docs | ||
| - develop | ||
| - stack | ||
| - oss | ||
| - rs | ||
| - rc | ||
| - oss | ||
| - kubernetes | ||
| - clients | ||
| complexity: O(N) where N is the number of session-local fieldsets. | ||
| description: Removes all session-local fieldsets for the connection. | ||
| group: hash | ||
| hidden: false | ||
| hints: | ||
| - request_policy:all_shards | ||
| linkTitle: HIMPORT DISCARDALL | ||
| railroad_diagram: /images/railroad/himport-discardall.svg | ||
| since: 8.10.0 | ||
| summary: Removes all session-local fieldsets for the connection. | ||
| syntax_fmt: HIMPORT DISCARDALL | ||
| title: HIMPORT DISCARDALL | ||
| --- | ||
| Removes every fieldset held by the current connection, discarding all definitions previously created with [`HIMPORT PREPARE`]({{< relref "/commands/himport-prepare" >}}). | ||
|
|
||
| ## Examples | ||
|
|
||
| ```shell | ||
| > HIMPORT PREPARE u name email age | ||
| OK | ||
| > HIMPORT PREPARE o id total | ||
| OK | ||
| > HIMPORT DISCARDALL | ||
| (integer) 2 | ||
| ``` | ||
|
|
||
| ## Redis Software and Redis Cloud compatibility | ||
|
|
||
| | Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | | ||
| |:----------------------|:-----------------|:------| | ||
| | <span title="Not supported">❌ Standard</span><br /><span title="Not supported"><nobr>❌ Active-Active</nobr></span> | <span title="Not supported">❌ Standard</span><br /><span title="Not supported"><nobr>❌ Active-Active</nobr></span> | | | ||
|
|
||
| ## Return information | ||
|
|
||
| {{< multitabs id="himport-discardall-return-info" | ||
| tab1="RESP2" | ||
| tab2="RESP3" >}} | ||
|
|
||
| [Integer reply](../../develop/reference/protocol-spec#integers): the number of fieldsets removed. | ||
|
|
||
| -tab-sep- | ||
|
|
||
| [Integer reply](../../develop/reference/protocol-spec#integers): the number of fieldsets removed. | ||
|
|
||
| {{< /multitabs >}} | ||
|
|
||
| ## See also | ||
|
|
||
| [`HIMPORT PREPARE`]({{< relref "commands/himport-prepare/" >}}) | [`HIMPORT DISCARD`]({{< relref "commands/himport-discard/" >}}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| --- | ||
| acl_categories: | ||
| - '@hash' | ||
| - '@slow' | ||
| arguments: | ||
| - display_text: fieldset-name | ||
| name: fieldset-name | ||
| type: string | ||
| - display_text: field | ||
| multiple: true | ||
| name: field | ||
| type: string | ||
| arity: -4 | ||
| categories: | ||
| - docs | ||
| - develop | ||
| - stack | ||
| - oss | ||
| - rs | ||
| - rc | ||
| - oss | ||
| - kubernetes | ||
| - clients | ||
| command_flags: | ||
| - denyoom | ||
| complexity: O(N*log(N)) where N is the number of fields. | ||
| description: Defines a session-local fieldset that maps a name to a sorted set of | ||
| field names. | ||
| group: hash | ||
| hidden: false | ||
| hints: | ||
| - request_policy:all_shards | ||
| linkTitle: HIMPORT PREPARE | ||
| railroad_diagram: /images/railroad/himport-prepare.svg | ||
| since: 8.10.0 | ||
| summary: Defines a session-local fieldset that maps a name to a sorted set of field | ||
| names. | ||
| syntax_fmt: HIMPORT PREPARE fieldset-name field [field ...] | ||
| title: HIMPORT PREPARE | ||
| --- | ||
| Defines a session-local fieldset that maps a name to an ordered list of field names, to be used by later [`HIMPORT SET`]({{< relref "/commands/himport-set" >}}) commands on the same connection. | ||
|
|
||
| ## Required arguments | ||
|
|
||
| <details open><summary><code>fieldset-name</code></summary> | ||
|
|
||
| The 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. | ||
|
|
||
| </details> | ||
|
|
||
| <details open><summary><code>field [field ...]</code></summary> | ||
|
|
||
| One or more field names to store under the fieldset, in the order you intend to supply their values to [`HIMPORT SET`]({{< relref "/commands/himport-set" >}}). A field name must not appear more than once in the same fieldset. | ||
|
|
||
| </details> | ||
|
|
||
| ## Examples | ||
|
|
||
| ```shell | ||
| > HIMPORT PREPARE u name email age | ||
| OK | ||
| ``` | ||
|
|
||
| ## Details | ||
|
|
||
| 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`]({{< relref "/commands/reset" >}}) command. A connection can prepare several fieldsets, each under its own name. | ||
|
|
||
| The command returns an error if the same field name is given more than once. | ||
|
|
||
| ## Redis Software and Redis Cloud compatibility | ||
|
|
||
| | Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | | ||
| |:----------------------|:-----------------|:------| | ||
| | <span title="Not supported">❌ Standard</span><br /><span title="Not supported"><nobr>❌ Active-Active</nobr></span> | <span title="Not supported">❌ Standard</span><br /><span title="Not supported"><nobr>❌ Active-Active</nobr></span> | | | ||
|
|
||
| ## Return information | ||
|
|
||
| {{< multitabs id="himport-prepare-return-info" | ||
| tab1="RESP2" | ||
| tab2="RESP3" >}} | ||
|
|
||
| [Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK`. | ||
|
|
||
| -tab-sep- | ||
|
|
||
| [Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK`. | ||
|
|
||
| {{< /multitabs >}} | ||
|
|
||
| ## See also | ||
|
|
||
| [`HIMPORT SET`]({{< relref "commands/himport-set/" >}}) | [`HIMPORT DISCARD`]({{< relref "commands/himport-discard/" >}}) | [`HIMPORT DISCARDALL`]({{< relref "commands/himport-discardall/" >}}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| --- | ||
| acl_categories: | ||
| - '@write' | ||
| - '@hash' | ||
| - '@slow' | ||
| arguments: | ||
| - display_text: key | ||
| key_spec_index: 0 | ||
| name: key | ||
| type: key | ||
| - display_text: fieldset-name | ||
| name: fieldset-name | ||
| type: string | ||
| - display_text: value | ||
| multiple: true | ||
| name: value | ||
| type: string | ||
| arity: -5 | ||
| categories: | ||
| - docs | ||
| - develop | ||
| - stack | ||
| - oss | ||
| - rs | ||
| - rc | ||
| - oss | ||
| - kubernetes | ||
| - clients | ||
| command_flags: | ||
| - write | ||
| - denyoom | ||
| complexity: O(N) where N is the number of fields in the fieldset. | ||
| description: Creates a fieldset-based hash from values supplied in the order matching | ||
| a previously prepared fieldset. | ||
| group: hash | ||
| hidden: false | ||
| key_specs: | ||
| - OW: true | ||
| begin_search: | ||
| spec: | ||
| index: 2 | ||
| type: index | ||
| find_keys: | ||
| spec: | ||
| keystep: 1 | ||
| lastkey: 0 | ||
| limit: 0 | ||
| type: range | ||
| update: true | ||
| linkTitle: HIMPORT SET | ||
| railroad_diagram: /images/railroad/himport-set.svg | ||
| since: 8.10.0 | ||
| summary: Creates a fieldset-based hash from values supplied in the order matching | ||
| a previously prepared fieldset. | ||
| syntax_fmt: HIMPORT SET key fieldset-name value [value ...] | ||
| title: HIMPORT SET | ||
| --- | ||
| Creates a hash from a fieldset previously defined with [`HIMPORT PREPARE`]({{< relref "/commands/himport-prepare" >}}), pairing the fieldset's field names with the supplied values by position. | ||
|
|
||
| ## Required arguments | ||
|
|
||
| <details open><summary><code>key</code></summary> | ||
|
|
||
| The key to create. If the key already exists, it is overwritten. | ||
|
|
||
| </details> | ||
|
|
||
| <details open><summary><code>fieldset-name</code></summary> | ||
|
|
||
| The name of a fieldset previously defined with [`HIMPORT PREPARE`]({{< relref "/commands/himport-prepare" >}}) on the same connection. | ||
|
|
||
| </details> | ||
|
|
||
| <details open><summary><code>value [value ...]</code></summary> | ||
|
|
||
| The field values, given in the same order as the field names were declared in the fieldset. The number of values must equal the number of fields in the fieldset. | ||
|
|
||
| </details> | ||
|
|
||
| ## Examples | ||
|
|
||
| ```shell | ||
| > HIMPORT PREPARE u name email age | ||
| OK | ||
| > HIMPORT SET user:1 u alice a@example.com 30 | ||
| OK | ||
| > HIMPORT SET user:2 u bob b@example.com 25 | ||
| OK | ||
| > HGET user:1 name | ||
| "alice" | ||
| > HGET user:1 email | ||
| "a@example.com" | ||
| > HGET user:1 age | ||
| "30" | ||
| ``` | ||
|
|
||
| ## Details | ||
|
|
||
| `HIMPORT SET` creates or overwrites `key` as a hash whose fields are the field names of the prepared fieldset, each paired with the value at the same position. The number of values must match the number of fields in the fieldset. | ||
|
|
||
| The command returns an error if the fieldset has not been prepared on the current connection, or if the number of values does not match the fieldset's field count. | ||
|
|
||
| Keys created this way behave exactly like any other hash and work with all existing hash commands. Because they share a fixed set of field names, Redis can store them with an internal encoding that keeps a single copy of the field names, reducing memory when many keys share the same layout. | ||
|
|
||
| ## Redis Software and Redis Cloud compatibility | ||
|
|
||
| | Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | | ||
| |:----------------------|:-----------------|:------| | ||
| | <span title="Not supported">❌ Standard</span><br /><span title="Not supported"><nobr>❌ Active-Active</nobr></span> | <span title="Not supported">❌ Standard</span><br /><span title="Not supported"><nobr>❌ Active-Active</nobr></span> | | | ||
|
|
||
| ## Return information | ||
|
|
||
| {{< multitabs id="himport-set-return-info" | ||
| tab1="RESP2" | ||
| tab2="RESP3" >}} | ||
|
|
||
| [Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK`. | ||
|
|
||
| -tab-sep- | ||
|
|
||
| [Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK`. | ||
|
|
||
| {{< /multitabs >}} | ||
|
|
||
| ## See also | ||
|
|
||
| [`HIMPORT PREPARE`]({{< relref "commands/himport-prepare/" >}}) | [`HSET`]({{< relref "commands/hset/" >}}) | [`HIMPORT DISCARD`]({{< relref "commands/himport-discard/" >}}) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.