diff --git a/build/generate_version_commands_page.py b/build/generate_version_commands_page.py index f40cea60df..4806386590 100644 --- a/build/generate_version_commands_page.py +++ b/build/generate_version_commands_page.py @@ -20,6 +20,7 @@ ('sorted-set', 'Sorted set commands'), ('stream', 'Stream commands'), ('bitmap', 'Bitmap commands'), + ('array', 'Array commands'), ('hyperloglog', 'HyperLogLog commands'), ('geo', 'Geospatial commands'), ('json', 'JSON commands'), @@ -196,6 +197,7 @@ def generate_page_content(commands_by_group, target_version): 'sorted-set': 'Sorted set commands operate on sets of unique strings ordered by a score.', 'stream': 'Stream commands operate on append-only log data structures.', 'bitmap': 'Bitmap commands operate on strings as arrays of bits.', + 'array': 'Array commands operate on arrays of strings.', 'hyperloglog': 'HyperLogLog commands provide probabilistic cardinality estimation.', 'geo': 'Geospatial commands operate on geographic coordinates.', 'json': 'JSON commands operate on JSON data structures.', diff --git a/content/commands/acl-load.md b/content/commands/acl-load.md index dcafee1883..bec1159a3d 100644 --- a/content/commands/acl-load.md +++ b/content/commands/acl-load.md @@ -38,6 +38,10 @@ sure to have an *all or nothing* behavior, that is: * If every line in the file is valid, all the ACLs are loaded. * If one or more line in the file is not valid, nothing is loaded, and the old ACL rules defined in the server memory continue to be used. +Starting with Redis 8.8, your ACL file is allowed to have comment lines; lines that begin with the `#` character. +Any such comment lines are stripped when the ACL file is loaded and they are not persisted across `ACL LOAD`/`ACL SAVE` commands. +Make sure you save a backup of your ACL file. This is the only way to preserve comments. + ## Examples ``` diff --git a/content/commands/arcount.md b/content/commands/arcount.md new file mode 100644 index 0000000000..e10d13f85a --- /dev/null +++ b/content/commands/arcount.md @@ -0,0 +1,73 @@ +--- +acl_categories: +- '@array' +arguments: +- key_spec_index: 0 + name: key + type: key +arity: 2 +bannerText: Array is a new data type that is currently in preview and may be subject to change. +categories: +- docs +- develop +- oss +- rs +- rc +- kubernetes +- clients +command_flags: +- readonly +- fast +complexity: O(1) +description: Returns the number of non-empty elements in an array. +group: array +hidden: false +key_specs: +- begin_search: + index: + pos: 1 + find_keys: + range: + lastkey: 0 + limit: 0 + step: 1 + flags: + - ro + - access +linkTitle: ARCOUNT +since: 8.8.0 +summary: Returns the number of non-empty elements in an array. +syntax_fmt: ARCOUNT key +title: ARCOUNT +--- +Returns the number of non-empty elements in an array. + +## Required arguments + +
key + +The name of the key that holds the array. + +
+ +## Examples + +{{% redis-cli %}} +ARSET myarray 0 "a" +ARSET myarray 5 "b" +ARCOUNT myarray +{{% /redis-cli %}} + +## Return information + +{{< multitabs id="return-info" + tab1="RESP2" + tab2="RESP3" >}} + +[Integer reply](../../develop/reference/protocol-spec#integers): The number of non-empty elements, or 0 if key does not exist. + +-tab-sep- + +[Integer reply](../../develop/reference/protocol-spec#integers): The number of non-empty elements, or 0 if key does not exist. + +{{< /multitabs >}} diff --git a/content/commands/ardel.md b/content/commands/ardel.md new file mode 100644 index 0000000000..29408d710c --- /dev/null +++ b/content/commands/ardel.md @@ -0,0 +1,92 @@ +--- +acl_categories: +- ARRAY +arguments: +- key_spec_index: 0 + name: key + type: key +- multiple: true + name: index + type: integer +arity: -3 +bannerText: Array is a new data type that is currently in preview and may be subject to change. +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- WRITE +- FAST +complexity: O(N) where N is the number of indices to delete +description: Deletes elements at the specified indices in an array. +function: ardelCommand +group: array +hidden: false +key_specs: +- begin_search: + index: + pos: 1 + find_keys: + range: + lastkey: 0 + limit: 0 + step: 1 + flags: + - RW + - DELETE +linkTitle: ARDEL +reply_schema: + description: Number of elements deleted. + type: integer +since: 8.8.0 +summary: Deletes elements at the specified indices in an array. +syntax_fmt: ARDEL key index [index ...] +title: ARDEL +--- +Deletes elements at the specified indices in an array. + +## Required arguments + +
key + +The name of the key that holds the array. + +
+ +
index + +One or more zero-based integer indices of the elements to delete. Deleting an index that does not exist counts as zero elements deleted and does not modify the array. + +
+ +## Examples + +{{% redis-cli %}} +ARSET myarray 0 "a" +ARSET myarray 1 "b" +ARSET myarray 2 "c" +ARDEL myarray 1 +ARGET myarray 1 +ARDEL myarray 0 2 +ARCOUNT myarray +{{% /redis-cli %}} + +## Return information + +{{< multitabs id="return-info" + tab1="RESP2" + tab2="RESP3" >}} + +[Integer reply](../../develop/reference/protocol-spec#integers): Number of elements deleted. + +-tab-sep- + +[Integer reply](../../develop/reference/protocol-spec#integers): Number of elements deleted. + +{{< /multitabs >}} diff --git a/content/commands/ardelrange.md b/content/commands/ardelrange.md new file mode 100644 index 0000000000..8a889cde35 --- /dev/null +++ b/content/commands/ardelrange.md @@ -0,0 +1,95 @@ +--- +acl_categories: +- ARRAY +arguments: +- key_spec_index: 0 + name: key + type: key +- arguments: + - name: start + type: integer + - name: end + type: integer + multiple: true + name: range + type: block +arity: -4 +bannerText: Array is a new data type that is currently in preview and may be subject to change. +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- WRITE +complexity: Proportional to the number of existing elements / slices touched, not + to the numeric span of the requested ranges +description: Deletes elements in one or more ranges. +function: ardelrangeCommand +group: array +hidden: false +key_specs: +- begin_search: + index: + pos: 1 + find_keys: + range: + lastkey: 0 + limit: 0 + step: 1 + flags: + - RW + - DELETE +linkTitle: ARDELRANGE +reply_schema: + description: Number of elements deleted. + type: integer +since: 8.8.0 +summary: Deletes elements in one or more ranges. +syntax_fmt: ARDELRANGE key start end [start end ...] +title: ARDELRANGE +--- +Deletes elements in one or more ranges. + +## Required arguments + +
key + +The name of the key that holds the array. + +
+ +
range + +One or more `start end` pairs, each defining an inclusive range of indices to delete. If `start` is greater than `end` for a given pair, the range is processed in ascending order regardless. Multiple pairs may overlap; each element is counted at most once. + +
+ +## Examples + +{{% redis-cli %}} +ARMSET myarray 0 "a" 1 "b" 2 "c" 3 "d" 4 "e" +ARDELRANGE myarray 1 3 +ARCOUNT myarray +ARGET myarray 0 +ARGET myarray 4 +{{% /redis-cli %}} + +## Return information + +{{< multitabs id="return-info" + tab1="RESP2" + tab2="RESP3" >}} + +[Integer reply](../../develop/reference/protocol-spec#integers): Number of elements deleted. + +-tab-sep- + +[Integer reply](../../develop/reference/protocol-spec#integers): Number of elements deleted. + +{{< /multitabs >}} diff --git a/content/commands/arget.md b/content/commands/arget.md new file mode 100644 index 0000000000..c5dea9bfbd --- /dev/null +++ b/content/commands/arget.md @@ -0,0 +1,94 @@ +--- +acl_categories: +- ARRAY +arguments: +- key_spec_index: 0 + name: key + type: key +- name: index + type: integer +arity: 3 +bannerText: Array is a new data type that is currently in preview and may be subject to change. +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- READONLY +- FAST +complexity: O(1) +description: Gets the value at an index in an array. +function: argetCommand +group: array +hidden: false +key_specs: +- begin_search: + index: + pos: 1 + find_keys: + range: + lastkey: 0 + limit: 0 + step: 1 + flags: + - RO + - ACCESS +linkTitle: ARGET +reply_schema: + oneOf: + - description: The value at the given index. + type: string + - description: Null reply if key or index does not exist. + type: 'null' +since: 8.8.0 +summary: Gets the value at an index in an array. +syntax_fmt: ARGET key index +title: ARGET +--- +Gets the value at an index in an array. + +## Required arguments + +
key + +The name of the key that holds the array. + +
+ +
index + +The zero-based integer index of the element to retrieve. + +
+ +## Examples + +{{% redis-cli %}} +ARSET myarray 0 "hello" +ARGET myarray 0 +ARGET myarray 1 +{{% /redis-cli %}} + +## Return information + +{{< multitabs id="return-info" + tab1="RESP2" + tab2="RESP3" >}} + +One of the following: +* [Bulk string reply](../../develop/reference/protocol-spec#bulk-strings): The value at the given index. +* [Nil reply](../../develop/reference/protocol-spec#null-bulk-strings): Null reply if key or index does not exist. + +-tab-sep- + +One of the following: +* [Bulk string reply](../../develop/reference/protocol-spec#bulk-strings): The value at the given index. +* [Null reply](../../develop/reference/protocol-spec#nulls): Null reply if key or index does not exist. + +{{< /multitabs >}} diff --git a/content/commands/argetrange.md b/content/commands/argetrange.md new file mode 100644 index 0000000000..272a90016a --- /dev/null +++ b/content/commands/argetrange.md @@ -0,0 +1,97 @@ +--- +acl_categories: +- ARRAY +arguments: +- key_spec_index: 0 + name: key + type: key +- name: start + type: integer +- name: end + type: integer +arity: 4 +bannerText: Array is a new data type that is currently in preview and may be subject to change. +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- READONLY +complexity: O(N) where N is the range length +description: Gets values in a range of indices. +function: argetrangeCommand +group: array +hidden: false +key_specs: +- begin_search: + index: + pos: 1 + find_keys: + range: + lastkey: 0 + limit: 0 + step: 1 + flags: + - RO + - ACCESS +linkTitle: ARGETRANGE +reply_schema: + items: + oneOf: + - type: string + - type: 'null' + type: array +since: 8.8.0 +summary: Gets values in a range of indices. +syntax_fmt: ARGETRANGE key start end +title: ARGETRANGE +--- +Gets values in a range of indices. + +## Required arguments + +
key + +The name of the key that holds the array. + +
+ +
start + +The zero-based integer index of the first element to return. If `start` is greater than `end`, elements are returned in reverse index order. + +
+ +
end + +The zero-based integer index of the last element to return (inclusive). If `end` is less than `start`, elements are returned in reverse index order. + +
+ +## Examples + +{{% redis-cli %}} +ARMSET myarray 0 "a" 1 "b" 3 "d" +ARGETRANGE myarray 0 3 +ARGETRANGE myarray 3 0 +{{% /redis-cli %}} + +## Return information + +{{< multitabs id="return-info" + tab1="RESP2" + tab2="RESP3" >}} + +[Array reply](../../develop/reference/protocol-spec#arrays) + +-tab-sep- + +[Array reply](../../develop/reference/protocol-spec#arrays) + +{{< /multitabs >}} diff --git a/content/commands/argrep.md b/content/commands/argrep.md new file mode 100644 index 0000000000..2ae58f5c08 --- /dev/null +++ b/content/commands/argrep.md @@ -0,0 +1,191 @@ +--- +acl_categories: +- '@array' +arguments: +- key_spec_index: 0 + name: key + type: key +- name: start + type: string +- name: end + type: string +- arguments: + - arguments: + - name: exact + token: EXACT + type: pure-token + - name: string + type: string + name: exact + type: block + - arguments: + - name: match + token: MATCH + type: pure-token + - name: string + type: string + name: match + type: block + - arguments: + - name: glob + token: GLOB + type: pure-token + - name: pattern + type: string + name: glob + type: block + - arguments: + - name: re + token: RE + type: pure-token + - name: pattern + type: string + name: re + type: block + multiple: true + name: predicate + type: oneof +- arguments: + - name: and + token: AND + type: pure-token + - name: or + token: OR + type: pure-token + - name: limit + token: LIMIT + type: integer + - name: withvalues + token: WITHVALUES + type: pure-token + - name: nocase + token: NOCASE + type: pure-token + multiple: true + name: options + optional: true + type: oneof +arity: -6 +bannerText: Array is a new data type that is currently in preview and may be subject to change. +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- readonly +complexity: O(P * C) where P is the number of visited positions in touched slices + and C is the cost of evaluating the predicates on one existing element. +description: Searches array elements in a range using textual predicates. +group: array +hidden: false +key_specs: +- begin_search: + index: + pos: 1 + find_keys: + range: + lastkey: 0 + limit: 0 + step: 1 + flags: + - ro + - access +linkTitle: ARGREP +reply_schema: + description: Array of matching indexes, or flat index-value pairs when WITHVALUES + is used. + items: + oneOf: + - description: Index of a matching element + type: integer + - description: Matching value when WITHVALUES is used + type: string + type: array +since: 8.8.0 +summary: Searches array elements in a range using textual predicates. +syntax_fmt: "ARGREP key start end\n \ + \ \n \ + \ [AND | OR | LIMIT\_limit | WITHVALUES | NOCASE [...]]" +title: ARGREP +--- +Searches array elements in a range using textual predicates and returns the indices of the matching elements. Empty slots in the range are skipped. + +## Required arguments + +
key + +The name of the key that holds the array. + +
+ +
start + +The zero-based integer index at which to begin searching. The special value `-` denotes the first index of the array. If `start` is greater than `end`, matches are returned in reverse index order. + +
+ +
end + +The zero-based integer index at which to stop searching (inclusive). The special value `+` denotes the last index of the array. + +
+ +
predicate + +One or more textual predicates to evaluate against each non-empty element in the range. Each predicate is one of: + +- **`EXACT string`** — Matches elements whose value is exactly equal to `string`. +- **`MATCH string`** — Matches elements whose value contains `string` as a substring. +- **`GLOB pattern`** — Matches elements whose value matches the glob-style `pattern` (with `*`, `?`, and `[...]` wildcards), the same syntax used by [`KEYS`]({{< relref "/commands/keys" >}}) and [`SCAN`]({{< relref "/commands/scan" >}}) `MATCH`. +- **`RE pattern`** — Matches elements whose value matches the regular expression `pattern`. + +When more than one predicate is supplied, use the `AND` or `OR` option to control how they are combined. The default is `OR`. + +
+ +## Optional arguments + +
options + +Zero or more of the following modifiers: + +- **`AND`** — Combine multiple predicates with logical AND. An element matches only if every predicate matches. +- **`OR`** — Combine multiple predicates with logical OR. An element matches if any predicate matches. This is the default. +- **`LIMIT limit`** — Stop after `limit` matches have been collected. `limit` must be a positive integer. When omitted, all matches in the range are returned. +- **`WITHVALUES`** — In addition to each matching index, return the matching value. The reply becomes a flat list of alternating index-value pairs. +- **`NOCASE`** — Perform case-insensitive comparisons for `EXACT`, `MATCH`, `GLOB`, and `RE`. + +
+ +## Examples + +{{% redis-cli %}} +ARMSET log 0 "boot: ok" 1 "warn: disk" 2 "ERROR: cpu" 3 "info: ready" 4 "error: net" +ARGREP log - + MATCH "error" NOCASE +ARGREP log - + MATCH "error" NOCASE WITHVALUES +ARGREP log 0 4 GLOB "warn:*" OR GLOB "error:*" +ARGREP log 0 4 RE "^[A-Za-z]+: (cpu|net)$" NOCASE WITHVALUES +ARGREP log 0 4 EXACT "info: ready" +ARGREP log - + MATCH "error" NOCASE LIMIT 1 +{{% /redis-cli %}} + +## Return information + +{{< multitabs id="return-info" + tab1="RESP2" + tab2="RESP3" >}} + +[Array reply](../../develop/reference/protocol-spec#arrays): Indices of the matching elements, in the same order in which the range is traversed (ascending when `start <= end`, descending when `start > end`). When `WITHVALUES` is given, a flat array of alternating index-value pairs: `[idx1, val1, idx2, val2, ...]`. An empty array is returned when the key does not exist or no element matches. + +-tab-sep- + +[Array reply](../../develop/reference/protocol-spec#arrays): Indices of the matching elements, in the same order in which the range is traversed (ascending when `start <= end`, descending when `start > end`). When `WITHVALUES` is given, a flat array of alternating index-value pairs: `[idx1, val1, idx2, val2, ...]`. An empty array is returned when the key does not exist or no element matches. + +{{< /multitabs >}} + diff --git a/content/commands/arinfo.md b/content/commands/arinfo.md new file mode 100644 index 0000000000..b0e701b459 --- /dev/null +++ b/content/commands/arinfo.md @@ -0,0 +1,127 @@ +--- +acl_categories: +- ARRAY +arguments: +- key_spec_index: 0 + name: key + type: key +- name: full + optional: true + token: FULL + type: pure-token +arity: -2 +bannerText: Array is a new data type that is currently in preview and may be subject to change. +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- READONLY +complexity: O(1), or O(N) with FULL option where N is the number of slices. +description: Returns metadata about an array. +function: arinfoCommand +group: array +hidden: false +key_specs: +- begin_search: + index: + pos: 1 + find_keys: + range: + lastkey: 0 + limit: 0 + step: 1 + flags: + - RO + - ACCESS +linkTitle: ARINFO +reply_schema: + additionalProperties: false + properties: + avg-dense-fill: + description: Average fill rate of dense slices (FULL only). + type: number + avg-dense-size: + description: Average allocation size of dense slices (FULL only). + type: number + avg-sparse-size: + description: Average capacity of sparse slices (FULL only). + type: number + count: + description: Total number of non-empty elements. + type: integer + dense-slices: + description: Number of dense slices (FULL only). + type: integer + directory-size: + description: Directory allocation capacity (flat dir_alloc or superdir sdir_cap). + type: integer + len: + description: Logical length (highest index + 1). + type: integer + next-insert-index: + description: Index the next ARINSERT would use, or 0 if unset/exhausted. + type: integer + slice-size: + description: Configured slice size. + type: integer + slices: + description: Number of allocated slices. + type: integer + sparse-slices: + description: Number of sparse slices (FULL only). + type: integer + super-dir-entries: + description: Number of super-directory entries (0 if not in superdir mode). + type: integer + type: object +since: 8.8.0 +summary: Returns metadata about an array. +syntax_fmt: ARINFO key [FULL] +title: ARINFO +--- +Returns metadata about an array. + +## Required arguments + +
key + +The name of the key that holds the array. + +
+ +## Optional arguments + +
FULL + +When present, includes per-slice statistics in the reply: the number of dense and sparse slices and their average sizes and fill rates. Raises the complexity from O(1) to O(N) where N is the number of slices. + +
+ +## Examples + +{{% redis-cli %}} +ARMSET myarray 0 "a" 1 "b" 100 "c" +ARINSERT myarray "d" +ARINFO myarray +{{% /redis-cli %}} + +## Return information + +{{< multitabs id="return-info" + tab1="RESP2" + tab2="RESP3" >}} + +[Array reply](../../develop/reference/protocol-spec#arrays) + +-tab-sep- + +[Map reply](../../develop/reference/protocol-spec#maps) + +{{< /multitabs >}} diff --git a/content/commands/arinsert.md b/content/commands/arinsert.md new file mode 100644 index 0000000000..2b611bb2ef --- /dev/null +++ b/content/commands/arinsert.md @@ -0,0 +1,91 @@ +--- +acl_categories: +- ARRAY +arguments: +- key_spec_index: 0 + name: key + type: key +- multiple: true + name: value + type: string +arity: -3 +bannerText: Array is a new data type that is currently in preview and may be subject to change. +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- WRITE +- DENYOOM +- FAST +complexity: O(N) where N is the number of values +description: Inserts one or more values at consecutive indices. +function: arinsertCommand +group: array +hidden: false +key_specs: +- begin_search: + index: + pos: 1 + find_keys: + range: + lastkey: 0 + limit: 0 + step: 1 + flags: + - RW + - UPDATE +linkTitle: ARINSERT +reply_schema: + description: The last index where a value was inserted. + type: integer +since: 8.8.0 +summary: Inserts one or more values at consecutive indices. +syntax_fmt: ARINSERT key value [value ...] +title: ARINSERT +--- +Inserts one or more values at consecutive indices. + +## Required arguments + +
key + +The name of the key that holds the array. + +
+ +
value + +One or more string values to insert at consecutive indices, beginning at the current insert cursor position. The cursor advances by one for each value inserted. Use [`ARNEXT`]({{< relref "/commands/arnext" >}}) to inspect the current cursor position and [`ARSEEK`]({{< relref "/commands/arseek" >}}) to reposition it. + +
+ +## Examples + +{{% redis-cli %}} +ARINSERT myarray "alpha" +ARINSERT myarray "beta" +ARINSERT myarray "gamma" +ARGET myarray 1 +ARNEXT myarray +{{% /redis-cli %}} + +## Return information + +{{< multitabs id="return-info" + tab1="RESP2" + tab2="RESP3" >}} + +[Integer reply](../../develop/reference/protocol-spec#integers): The last index where a value was inserted. + +-tab-sep- + +[Integer reply](../../develop/reference/protocol-spec#integers): The last index where a value was inserted. + +{{< /multitabs >}} diff --git a/content/commands/arlastitems.md b/content/commands/arlastitems.md new file mode 100644 index 0000000000..2c2ca668a8 --- /dev/null +++ b/content/commands/arlastitems.md @@ -0,0 +1,103 @@ +--- +acl_categories: +- ARRAY +arguments: +- key_spec_index: 0 + name: key + type: key +- name: count + type: integer +- name: rev + optional: true + token: REV + type: pure-token +arity: -3 +bannerText: Array is a new data type that is currently in preview and may be subject to change. +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- READONLY +complexity: O(N) where N is the count +description: Returns the most recently inserted elements. +function: arlastitemsCommand +group: array +hidden: false +key_specs: +- begin_search: + index: + pos: 1 + find_keys: + range: + lastkey: 0 + limit: 0 + step: 1 + flags: + - RO + - ACCESS +linkTitle: ARLASTITEMS +reply_schema: + items: + oneOf: + - type: string + - type: 'null' + type: array +since: 8.8.0 +summary: Returns the most recently inserted elements. +syntax_fmt: ARLASTITEMS key count [REV] +title: ARLASTITEMS +--- +Returns the most recently inserted elements. + +## Required arguments + +
key + +The name of the key that holds the array. + +
+ +
count + +The maximum number of most recently inserted elements to return. If the array contains fewer elements than `count`, all elements are returned. + +
+ +## Optional arguments + +
REV + +When present, returns elements in reverse chronological order (most recent first) instead of the default oldest-first order. + +
+ +## Examples + +{{% redis-cli %}} +ARINSERT log "first" +ARINSERT log "second" +ARINSERT log "third" +ARLASTITEMS log 2 +ARLASTITEMS log 2 REV +{{% /redis-cli %}} + +## Return information + +{{< multitabs id="return-info" + tab1="RESP2" + tab2="RESP3" >}} + +[Array reply](../../develop/reference/protocol-spec#arrays) + +-tab-sep- + +[Array reply](../../develop/reference/protocol-spec#arrays) + +{{< /multitabs >}} diff --git a/content/commands/arlen.md b/content/commands/arlen.md new file mode 100644 index 0000000000..0c206a408f --- /dev/null +++ b/content/commands/arlen.md @@ -0,0 +1,80 @@ +--- +acl_categories: +- ARRAY +arguments: +- key_spec_index: 0 + name: key + type: key +arity: 2 +bannerText: Array is a new data type that is currently in preview and may be subject to change. +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- READONLY +- FAST +complexity: O(1) +description: Returns the length of an array (max index + 1). +function: arlenCommand +group: array +hidden: false +key_specs: +- begin_search: + index: + pos: 1 + find_keys: + range: + lastkey: 0 + limit: 0 + step: 1 + flags: + - RO + - ACCESS +linkTitle: ARLEN +reply_schema: + description: The length of the array (max index + 1), or 0 if key does not exist. + type: integer +since: 8.8.0 +summary: Returns the length of an array (max index + 1). +syntax_fmt: ARLEN key +title: ARLEN +--- +Returns the length of an array (max index + 1). + +## Required arguments + +
key + +The name of the key that holds the array. + +
+ +## Examples + +{{% redis-cli %}} +ARSET myarray 0 "a" +ARSET myarray 5 "b" +ARLEN myarray +ARCOUNT myarray +{{% /redis-cli %}} + +## Return information + +{{< multitabs id="return-info" + tab1="RESP2" + tab2="RESP3" >}} + +[Integer reply](../../develop/reference/protocol-spec#integers): The length of the array (max index + 1), or 0 if key does not exist. + +-tab-sep- + +[Integer reply](../../develop/reference/protocol-spec#integers): The length of the array (max index + 1), or 0 if key does not exist. + +{{< /multitabs >}} diff --git a/content/commands/armget.md b/content/commands/armget.md new file mode 100644 index 0000000000..8a8ea147be --- /dev/null +++ b/content/commands/armget.md @@ -0,0 +1,90 @@ +--- +acl_categories: +- ARRAY +arguments: +- key_spec_index: 0 + name: key + type: key +- multiple: true + name: index + type: integer +arity: -3 +bannerText: Array is a new data type that is currently in preview and may be subject to change. +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- READONLY +- FAST +complexity: O(N) where N is the number of indices +description: Gets values at multiple indices in an array. +function: armgetCommand +group: array +hidden: false +key_specs: +- begin_search: + index: + pos: 1 + find_keys: + range: + lastkey: 0 + limit: 0 + step: 1 + flags: + - RO + - ACCESS +linkTitle: ARMGET +reply_schema: + items: + oneOf: + - type: string + - type: 'null' + type: array +since: 8.8.0 +summary: Gets values at multiple indices in an array. +syntax_fmt: ARMGET key index [index ...] +title: ARMGET +--- +Gets values at multiple indices in an array. + +## Required arguments + +
key + +The name of the key that holds the array. + +
+ +
index + +One or more zero-based integer indices of the elements to retrieve. The reply preserves the order of the requested indices and returns nil for any index that is not set. + +
+ +## Examples + +{{% redis-cli %}} +ARMSET myarray 0 "a" 1 "b" 5 "c" +ARMGET myarray 0 1 5 3 +{{% /redis-cli %}} + +## Return information + +{{< multitabs id="return-info" + tab1="RESP2" + tab2="RESP3" >}} + +[Array reply](../../develop/reference/protocol-spec#arrays) + +-tab-sep- + +[Array reply](../../develop/reference/protocol-spec#arrays) + +{{< /multitabs >}} diff --git a/content/commands/armset.md b/content/commands/armset.md new file mode 100644 index 0000000000..3dc48c6a93 --- /dev/null +++ b/content/commands/armset.md @@ -0,0 +1,95 @@ +--- +acl_categories: +- ARRAY +arguments: +- key_spec_index: 0 + name: key + type: key +- arguments: + - name: index + type: integer + - name: value + type: string + multiple: true + name: data + type: block +arity: -4 +bannerText: Array is a new data type that is currently in preview and may be subject to change. +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- WRITE +- DENYOOM +- FAST +complexity: O(N) where N is the number of pairs +description: Sets multiple index-value pairs in an array. +function: armsetCommand +group: array +hidden: false +key_specs: +- begin_search: + index: + pos: 1 + find_keys: + range: + lastkey: 0 + limit: 0 + step: 1 + flags: + - RW + - UPDATE +linkTitle: ARMSET +reply_schema: + description: Number of new slots that were set (previously empty). + type: integer +since: 8.8.0 +summary: Sets multiple index-value pairs in an array. +syntax_fmt: ARMSET key index value [index value ...] +title: ARMSET +--- +Sets multiple index-value pairs in an array. + +## Required arguments + +
key + +The name of the key that holds the array. + +
+ +
data + +One or more `index value` pairs. Each `index` is a zero-based integer specifying where to write, and each `value` is the string to store at that position. Pairs may be non-contiguous and in any order. + +
+ +## Examples + +{{% redis-cli %}} +ARMSET myarray 0 "alpha" 5 "beta" 100 "gamma" +ARGET myarray 0 +ARGET myarray 5 +ARGET myarray 100 +{{% /redis-cli %}} + +## Return information + +{{< multitabs id="return-info" + tab1="RESP2" + tab2="RESP3" >}} + +[Integer reply](../../develop/reference/protocol-spec#integers): Number of new slots that were set (previously empty). + +-tab-sep- + +[Integer reply](../../develop/reference/protocol-spec#integers): Number of new slots that were set (previously empty). + +{{< /multitabs >}} diff --git a/content/commands/arnext.md b/content/commands/arnext.md new file mode 100644 index 0000000000..5ae003e256 --- /dev/null +++ b/content/commands/arnext.md @@ -0,0 +1,87 @@ +--- +acl_categories: +- ARRAY +arguments: +- key_spec_index: 0 + name: key + type: key +arity: 2 +bannerText: Array is a new data type that is currently in preview and may be subject to change. +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- READONLY +- FAST +complexity: O(1) +description: Returns the next index ARINSERT would use. +function: arnextCommand +group: array +hidden: false +key_specs: +- begin_search: + index: + pos: 1 + find_keys: + range: + lastkey: 0 + limit: 0 + step: 1 + flags: + - RO + - ACCESS +linkTitle: ARNEXT +reply_schema: + oneOf: + - description: The next index ARINSERT would use. Returns 0 for missing keys or + when no insert happened yet. + type: integer + - description: Null when the insertion cursor is exhausted (next insert would overflow). + type: 'null' +since: 8.8.0 +summary: Returns the next index ARINSERT would use. +syntax_fmt: ARNEXT key +title: ARNEXT +--- +Returns the next index ARINSERT would use. + +## Required arguments + +
key + +The name of the key that holds the array. + +
+ +## Examples + +{{% redis-cli %}} +ARINSERT myarray "a" +ARINSERT myarray "b" +ARNEXT myarray +{{% /redis-cli %}} + +## Return information + +{{< multitabs id="return-info" + tab1="RESP2" + tab2="RESP3" >}} + +One of the following: +* [Integer reply](../../develop/reference/protocol-spec#integers): The next index ARINSERT would use. Returns 0 for missing keys or when no insert happened yet. +* [Nil reply](../../develop/reference/protocol-spec#null-bulk-strings): Null when the insertion cursor is exhausted (next insert would overflow). + +-tab-sep- + +One of the following: +* [Integer reply](../../develop/reference/protocol-spec#integers): The next index ARINSERT would use. Returns 0 for missing keys or when no insert happened yet. +* [Null reply](../../develop/reference/protocol-spec#nulls): Null when the insertion cursor is exhausted (next insert would overflow). + +{{< /multitabs >}} diff --git a/content/commands/arop.md b/content/commands/arop.md new file mode 100644 index 0000000000..cc2e52978f --- /dev/null +++ b/content/commands/arop.md @@ -0,0 +1,163 @@ +--- +acl_categories: +- ARRAY +arguments: +- key_spec_index: 0 + name: key + type: key +- name: start + type: integer +- name: end + type: integer +- arguments: + - name: sum + token: SUM + type: pure-token + - name: min + token: MIN + type: pure-token + - name: max + token: MAX + type: pure-token + - name: and + token: AND + type: pure-token + - name: or + token: OR + type: pure-token + - name: xor + token: XOR + type: pure-token + - arguments: + - name: match + token: MATCH + type: pure-token + - name: value + type: string + name: match + type: block + - name: used + token: USED + type: pure-token + name: operation + type: oneof +arity: -5 +bannerText: Array is a new data type that is currently in preview and may be subject to change. +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- READONLY +complexity: O(P) where P is visited positions in touched slices (dense scanned slots + + sparse entries), with worst-case O(|end-start|+1) and typical case close to O(N), + where N is the number of existing elements in range. +description: Performs aggregate operations on array elements in a range. +function: aropCommand +group: array +hidden: false +key_specs: +- begin_search: + index: + pos: 1 + find_keys: + range: + lastkey: 0 + limit: 0 + step: 1 + flags: + - RO + - ACCESS +linkTitle: AROP +reply_schema: + oneOf: + - description: Result of the operation. + type: string + - description: Integer result for MATCH, USED, AND, OR, XOR. + type: integer + - description: Null if no elements match the operation. + type: 'null' +since: 8.8.0 +summary: Performs aggregate operations on array elements in a range. +syntax_fmt: "AROP key start end " +title: AROP +--- +Performs aggregate operations on array elements in a range. + +## Required arguments + +
key + +The name of the key that holds the array. + +
+ +
start + +The zero-based integer index of the first element in the range to aggregate. + +
+ +
end + +The zero-based integer index of the last element in the range to aggregate (inclusive). The command always scans from the lower to the higher index regardless of argument order. + +
+ +
operation + +The aggregate function to apply to all non-empty elements in `[start, end]`. One of: + +- **`SUM`** — Returns the sum of all numeric values as a bulk string. +- **`MIN`** — Returns the minimum numeric value as a bulk string. +- **`MAX`** — Returns the maximum numeric value as a bulk string. +- **`AND`** — Returns the bitwise AND of all values, treating each as an integer (floats are truncated toward zero). +- **`OR`** — Returns the bitwise OR of all values, treating each as an integer (floats are truncated toward zero). +- **`XOR`** — Returns the bitwise XOR of all values, treating each as an integer (floats are truncated toward zero). +- **`MATCH value`** — Returns the count of elements whose value equals `value` as an integer reply. +- **`USED`** — Returns the count of non-empty elements in the range as an integer reply. + +`SUM`, `MIN`, and `MAX` return nil when no numeric elements are present in the range. `AND`, `OR`, and `XOR` return nil when the range is empty. + +
+ +## Examples + +{{% redis-cli %}} +ARMSET myarray 0 "10" 1 "20" 2 "30" +AROP myarray 0 2 SUM +AROP myarray 0 2 MIN +AROP myarray 0 2 MAX +AROP myarray 0 2 MATCH "10" +AROP myarray 0 2 USED +ARMSET flags 0 "255" 1 "15" 2 "240" +AROP flags 0 2 AND +AROP flags 0 2 OR +{{% /redis-cli %}} + +## Return information + +{{< multitabs id="return-info" + tab1="RESP2" + tab2="RESP3" >}} + +One of the following: +* [Bulk string reply](../../develop/reference/protocol-spec#bulk-strings): Result of the operation. +* [Integer reply](../../develop/reference/protocol-spec#integers): Integer result for MATCH, USED, AND, OR, XOR. +* [Nil reply](../../develop/reference/protocol-spec#null-bulk-strings): Null if no elements match the operation. + +-tab-sep- + +One of the following: +* [Bulk string reply](../../develop/reference/protocol-spec#bulk-strings): Result of the operation. +* [Integer reply](../../develop/reference/protocol-spec#integers): Integer result for MATCH, USED, AND, OR, XOR. +* [Null reply](../../develop/reference/protocol-spec#nulls): Null if no elements match the operation. + +{{< /multitabs >}} diff --git a/content/commands/arring.md b/content/commands/arring.md new file mode 100644 index 0000000000..c3c92040e7 --- /dev/null +++ b/content/commands/arring.md @@ -0,0 +1,103 @@ +--- +acl_categories: +- ARRAY +arguments: +- key_spec_index: 0 + name: key + type: key +- name: size + type: integer +- multiple: true + name: value + type: string +arity: -4 +bannerText: Array is a new data type that is currently in preview and may be subject to change. +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- WRITE +- DENYOOM +complexity: O(M) normally, O(N+M) on ring resize, where N is the maximum of the old + and new ring size and M is the number of inserted values +description: Inserts values into a ring buffer of specified size, wrapping and truncating + as needed. +function: arringCommand +group: array +hidden: false +key_specs: +- begin_search: + index: + pos: 1 + find_keys: + range: + lastkey: 0 + limit: 0 + step: 1 + flags: + - RW + - UPDATE +linkTitle: ARRING +reply_schema: + description: The last index where a value was inserted. + type: integer +since: 8.8.0 +summary: Inserts values into a ring buffer of specified size, wrapping and truncating + as needed. +syntax_fmt: ARRING key size value [value ...] +title: ARRING +--- +Inserts values into a ring buffer of specified size, wrapping and truncating as needed. + +## Required arguments + +
key + +The name of the key that holds the array. + +
+ +
size + +The size of the ring buffer window. Each value is inserted at `insert_idx % size`, wrapping back to index `0` when the end of the window is reached. When the buffer is full, newer values overwrite older ones. If `size` is smaller than the current window, the array is truncated to fit. + +
+ +
value + +One or more string values to insert into the ring buffer. Each value is placed at the next position in the ring and the cursor advances accordingly. + +
+ +## Examples + +{{% redis-cli %}} +ARRING readings 3 "v0" +ARRING readings 3 "v1" +ARRING readings 3 "v2" +ARRING readings 3 "v3" +ARGET readings 0 +ARCOUNT readings +ARLASTITEMS readings 3 +{{% /redis-cli %}} + +## Return information + +{{< multitabs id="return-info" + tab1="RESP2" + tab2="RESP3" >}} + +[Integer reply](../../develop/reference/protocol-spec#integers): The last index where a value was inserted. + +-tab-sep- + +[Integer reply](../../develop/reference/protocol-spec#integers): The last index where a value was inserted. + +{{< /multitabs >}} diff --git a/content/commands/arscan.md b/content/commands/arscan.md new file mode 100644 index 0000000000..58179ad5d6 --- /dev/null +++ b/content/commands/arscan.md @@ -0,0 +1,116 @@ +--- +acl_categories: +- ARRAY +arguments: +- key_spec_index: 0 + name: key + type: key +- name: start + type: integer +- name: end + type: integer +- name: limit + optional: true + token: LIMIT + type: integer +arity: -4 +bannerText: Array is a new data type that is currently in preview and may be subject to change. +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- READONLY +complexity: O(P) where P is visited positions in touched slices (dense scanned slots + + sparse entries), with worst-case O(|end-start|+1) and typical case close to O(N), + where N is the number of existing elements in range. +description: Iterates existing elements in a range, returning index-value pairs. +function: arscanCommand +group: array +hidden: false +key_specs: +- begin_search: + index: + pos: 1 + find_keys: + range: + lastkey: 0 + limit: 0 + step: 1 + flags: + - RO + - ACCESS +linkTitle: ARSCAN +reply_schema: + description: 'Flat array of index-value pairs: [idx1, val1, idx2, val2, ...]' + items: + oneOf: + - description: Index of existing element + type: integer + - description: Value at that index + type: string + type: array +since: 8.8.0 +summary: Iterates existing elements in a range, returning index-value pairs. +syntax_fmt: "ARSCAN key start end [LIMIT\_limit]" +title: ARSCAN +--- +Iterates existing elements in a range, returning index-value pairs. + +## Required arguments + +
key + +The name of the key that holds the array. + +
+ +
start + +The zero-based integer index at which to begin scanning. If `start` is greater than `end`, elements are returned in reverse index order. + +
+ +
end + +The zero-based integer index at which to stop scanning (inclusive). + +
+ +## Optional arguments + +
LIMIT + +The maximum number of index-value pairs to return. When omitted, all elements in the range are returned. Unlike `ARGETRANGE`, empty slots are not included in the output, so `LIMIT` caps the number of existing elements returned. + +
+ +## Examples + +{{% redis-cli %}} +ARSET myarray 0 "a" +ARSET myarray 5 "b" +ARSET myarray 9 "c" +ARSCAN myarray 0 10 +ARSCAN myarray 0 10 LIMIT 2 +{{% /redis-cli %}} + +## Return information + +{{< multitabs id="return-info" + tab1="RESP2" + tab2="RESP3" >}} + +[Array reply](../../develop/reference/protocol-spec#arrays): Flat array of index-value pairs: [idx1, val1, idx2, val2, ...] + +-tab-sep- + +[Array reply](../../develop/reference/protocol-spec#arrays): Flat array of index-value pairs: [idx1, val1, idx2, val2, ...] + +{{< /multitabs >}} diff --git a/content/commands/arseek.md b/content/commands/arseek.md new file mode 100644 index 0000000000..634ee548a3 --- /dev/null +++ b/content/commands/arseek.md @@ -0,0 +1,90 @@ +--- +acl_categories: +- ARRAY +arguments: +- key_spec_index: 0 + name: key + type: key +- name: index + type: integer +arity: 3 +bannerText: Array is a new data type that is currently in preview and may be subject to change. +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- WRITE +- FAST +complexity: O(1) +description: Sets the ARINSERT / ARRING cursor to a specific index. +function: arseekCommand +group: array +hidden: false +key_specs: +- begin_search: + index: + pos: 1 + find_keys: + range: + lastkey: 0 + limit: 0 + step: 1 + flags: + - RW + - UPDATE +linkTitle: ARSEEK +reply_schema: + description: 1 if the cursor was set, 0 if the key does not exist. + type: integer +since: 8.8.0 +summary: Sets the ARINSERT / ARRING cursor to a specific index. +syntax_fmt: ARSEEK key index +title: ARSEEK +--- +Sets the ARINSERT / ARRING cursor to a specific index. + +## Required arguments + +
key + +The name of the key that holds the array. + +
+ +
index + +The zero-based integer index to set as the new insert cursor position for subsequent [`ARINSERT`]({{< relref "/commands/arinsert" >}}) calls. + +
+ +## Examples + +{{% redis-cli %}} +ARINSERT myarray "a" +ARINSERT myarray "b" +ARNEXT myarray +ARSEEK myarray 10 +ARINSERT myarray "c" +ARNEXT myarray +{{% /redis-cli %}} + +## Return information + +{{< multitabs id="return-info" + tab1="RESP2" + tab2="RESP3" >}} + +[Integer reply](../../develop/reference/protocol-spec#integers): 1 if the cursor was set, 0 if the key does not exist. + +-tab-sep- + +[Integer reply](../../develop/reference/protocol-spec#integers): 1 if the cursor was set, 0 if the key does not exist. + +{{< /multitabs >}} diff --git a/content/commands/arset.md b/content/commands/arset.md new file mode 100644 index 0000000000..e84493c553 --- /dev/null +++ b/content/commands/arset.md @@ -0,0 +1,99 @@ +--- +acl_categories: +- ARRAY +arguments: +- key_spec_index: 0 + name: key + type: key +- name: index + type: integer +- multiple: true + name: value + type: string +arity: -4 +bannerText: Array is a new data type that is currently in preview and may be subject to change. +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- WRITE +- DENYOOM +- FAST +complexity: O(N) where N is the number of values +description: Sets one or more contiguous values starting at an index in an array. +function: arsetCommand +group: array +hidden: false +key_specs: +- begin_search: + index: + pos: 1 + find_keys: + range: + lastkey: 0 + limit: 0 + step: 1 + flags: + - RW + - UPDATE +linkTitle: ARSET +reply_schema: + description: Number of new slots that were set (previously empty). + type: integer +since: 8.8.0 +summary: Sets one or more contiguous values starting at an index in an array. +syntax_fmt: ARSET key index value [value ...] +title: ARSET +--- +Sets one or more contiguous values starting at an index in an array. + +## Required arguments + +
key + +The name of the key that holds the array. + +
+ +
index + +The zero-based integer index at which to start writing. When multiple values are provided, they are stored at consecutive indices starting from `index`. + +
+ +
value + +One or more string values to store at consecutive indices beginning at `index`. The number of new (previously empty) slots filled is returned. + +
+ +## Examples + +{{% redis-cli %}} +ARSET myarray 0 "hello" +ARGET myarray 0 +ARSET myarray 2 "a" "b" "c" +ARGET myarray 2 +ARGET myarray 4 +{{% /redis-cli %}} + +## Return information + +{{< multitabs id="return-info" + tab1="RESP2" + tab2="RESP3" >}} + +[Integer reply](../../develop/reference/protocol-spec#integers): Number of new slots that were set (previously empty). + +-tab-sep- + +[Integer reply](../../develop/reference/protocol-spec#integers): Number of new slots that were set (previously empty). + +{{< /multitabs >}} diff --git a/content/commands/client-list.md b/content/commands/client-list.md index 7fb08198ea..c57380c587 100644 --- a/content/commands/client-list.md +++ b/content/commands/client-list.md @@ -124,10 +124,13 @@ Here is the meaning of the fields: * `rbs`: current size of the client's read buffer in bytes. Added in Redis 7.0. * `lib-name` - the name of the client library that is being used. * `lib-ver` - the version of the client library. -* `io-thread`: id of I/O thread assigned to the client. Added in Redis 8.0 +* `io-thread`: id of I/O thread assigned to the client. Added in Redis 8.0. * `tot-net-in`: total network input bytes read from this client. * `tot-net-out`: total network output bytes sent to this client. * `tot-cmds`: total count of commands this client executed. +* `read-events`: number of read events for this client. Added in Redis 8.8 +* `parse-batch-cmd-sum`: cumulative number of commands parsed across all parsing batches for this client. Added in Redis 8.8 +* `parse-batch-cnt`: total number of parsing batches for this client. Divide `parse-batch-cmd-sum` by this value to get the client’s average commands per batch. Added in Redis 8.8 The client flags can be a combination of: diff --git a/content/commands/ft.aggregate.md b/content/commands/ft.aggregate.md index b05552eec1..07c87c7d8a 100644 --- a/content/commands/ft.aggregate.md +++ b/content/commands/ft.aggregate.md @@ -5,11 +5,14 @@ acl_categories: - '@fast' arguments: - name: index + summary: Specifies the name of the index. The index must be created using `FT.CREATE`. type: string - name: query + summary: Specifies the query to profile and analyze performance. type: string - name: verbatim optional: true + summary: Searches using the exact query terms without stemming or synonym expansion. token: VERBATIM type: pure-token - arguments: @@ -18,12 +21,14 @@ arguments: type: string - multiple: true name: field + summary: Specifies a field in the index schema with its properties. type: string name: load optional: true type: block - name: timeout optional: true + summary: Sets a time limit for query execution, specified in milliseconds. token: TIMEOUT type: integer - name: loadall @@ -38,9 +43,111 @@ arguments: name: property type: string - arguments: - - name: function + - name: reduce token: REDUCE - type: string + type: pure-token + - arguments: + - name: count + token: COUNT + type: pure-token + - name: count_distinct + token: COUNT_DISTINCT + type: pure-token + - name: count_distinctish + token: COUNT_DISTINCTISH + type: pure-token + - name: sum + token: SUM + type: pure-token + - name: min + token: MIN + type: pure-token + - name: max + token: MAX + type: pure-token + - name: avg + token: AVG + type: pure-token + - name: stddev + token: STDDEV + type: pure-token + - name: quantile + token: QUANTILE + type: pure-token + - name: tolist + token: TOLIST + type: pure-token + - name: first_value + token: FIRST_VALUE + type: pure-token + - name: random_sample + token: RANDOM_SAMPLE + type: pure-token + - arguments: + - name: collect_token + token: COLLECT + type: pure-token + - arguments: + - name: fields_token + token: FIELDS + type: pure-token + - arguments: + - name: all + token: '*' + type: pure-token + - arguments: + - name: num_fields + type: integer + - multiple: true + name: field + type: string + name: explicit + type: block + name: fields_spec + type: oneof + name: fields + type: block + - arguments: + - name: sortby_token + token: SORTBY + type: pure-token + - name: nargs + type: integer + - arguments: + - name: field + type: string + - arguments: + - name: asc + token: ASC + type: pure-token + - name: desc + token: DESC + type: pure-token + name: order + optional: true + type: oneof + multiple: true + name: key + type: block + name: sortby + optional: true + type: block + - arguments: + - name: limit_token + token: LIMIT + type: pure-token + - name: offset + type: integer + - name: count + type: integer + name: limit + optional: true + type: block + name: collect + since: 8.8.0 + type: block + name: function + type: oneof - name: nargs type: integer - multiple: true @@ -53,10 +160,12 @@ arguments: multiple: true name: reduce optional: true + summary: Applies a reducer function, like `SUM` or `COUNT`, on grouped results. type: block multiple: true name: groupby optional: true + summary: Groups results by specified fields, often used for aggregations. type: block - arguments: - name: nargs @@ -86,9 +195,203 @@ arguments: optional: true type: block - arguments: - - name: expression + - arguments: + - arguments: + - token: s + name: exists + summary: Checks whether a field exists in a document. + token: exists + type: function + - arguments: + - token: x + name: log + summary: Return the logarithm of a number, property or subexpression + token: log + type: function + - arguments: + - token: x + name: abs + summary: Return the absolute value of a numeric expression + token: abs + type: function + - arguments: + - token: x + name: ceil + summary: Round to the smallest integer not less than x + token: ceil + type: function + - arguments: + - token: x + name: floor + summary: Round to largest integer not greater than x + token: floor + type: function + - arguments: + - token: x + name: log2 + summary: Return the logarithm of x to base 2 + token: log2 + type: function + - arguments: + - token: x + name: exp + summary: Return the exponent of x, e.g., e^x + token: exp + type: function + - arguments: + - token: x + name: sqrt + summary: Return the square root of x + token: sqrt + type: function + - arguments: + - token: s + name: upper + summary: Return the uppercase conversion of s + token: upper + type: function + - arguments: + - token: s + name: lower + summary: Return the lowercase conversion of s + token: lower + type: function + - arguments: + - token: s1 + - token: s2 + name: startswith + summary: Return 1 if s2 is the prefix of s1, 0 otherwise. + token: startswith + type: function + - arguments: + - token: s1 + - token: s2 + name: contains + summary: Return the number of occurrences of s2 in s1, 0 otherwise. If s2 is + an empty string, return length(s1) + 1. + token: contains + type: function + - arguments: + - token: s + name: strlen + summary: Return the length of s + token: strlen + type: function + - arguments: + - token: s + - token: offset + - token: count + name: substr + summary: Return the substring of s, starting at offset and having count characters. + If offset is negative, it represents the distance from the end of the string. + If count is -1, it means "the rest of the string starting at offset". + token: substr + type: function + - arguments: + - token: fmt + name: format + summary: Use the arguments following fmt to format a string. Currently the only + format argument supported is %s and it applies to all types of arguments. + token: format + type: function + - arguments: + - optional: true + token: max_terms=100 + name: matched_terms + summary: Return the query terms that matched for each record (up to 100), as + a list. If a limit is specified, Redis will return the first N matches found, + based on query order. + token: matched_terms + type: function + - arguments: + - token: s + name: split + summary: Split a string by any character in the string sep, and strip any characters + in strip. If only s is specified, it is split by commas and spaces are stripped. + The output is an array. + token: split + type: function + - arguments: + - token: x + - optional: true + token: fmt + name: timefmt + summary: Return a formatted time string based on a numeric timestamp value x. + token: timefmt + type: function + - arguments: + - token: timesharing + - optional: true + token: fmt + name: parsetime + summary: The opposite of timefmt() - parse a time format using a given format + string + token: parsetime + type: function + - arguments: + - token: timestamp + name: day + summary: Round a Unix timestamp to midnight (00:00) start of the current day. + token: day + type: function + - arguments: + - token: timestamp + name: hour + summary: Round a Unix timestamp to the beginning of the current hour. + token: hour + type: function + - arguments: + - token: timestamp + name: minute + summary: Round a Unix timestamp to the beginning of the current minute. + token: minute + type: function + - arguments: + - token: timestamp + name: month + summary: Round a unix timestamp to the beginning of the current month. + token: month + type: function + - arguments: + - token: timestamp + name: dayofweek + summary: Convert a Unix timestamp to the day number (Sunday = 0). + token: dayofweek + type: function + - arguments: + - token: timestamp + name: dayofmonth + summary: Convert a Unix timestamp to the day of month number (1 .. 31). + token: dayofmonth + type: function + - arguments: + - token: timestamp + name: dayofyear + summary: Convert a Unix timestamp to the day of year number (0 .. 365). + token: dayofyear + type: function + - arguments: + - token: timestamp + name: year + summary: Convert a Unix timestamp to the current year (e.g. 2018). + token: year + type: function + - arguments: + - token: timestamp + name: monthofyear + summary: Convert a Unix timestamp to the current month (0 .. 11). + token: monthofyear + type: function + - arguments: + - token: '' + name: geodistance + summary: Return distance in meters. + token: geodistance + type: function + expression: true + name: expression token: APPLY - type: string + type: block - name: name token: AS type: string @@ -107,8 +410,11 @@ arguments: name: limit optional: true type: block -- name: filter +- expression: true + name: filter optional: true + summary: Applies a numeric range filter to restrict results to documents with field + values within the specified range. token: FILTER type: string - arguments: @@ -146,6 +452,7 @@ arguments: - name: dialect optional: true since: 2.4.3 + summary: Sets the query dialect version to be used. token: DIALECT type: integer categories: @@ -174,22 +481,12 @@ summary: Run a search query on an index and perform aggregate transformations on results syntax: "FT.AGGREGATE index query \n [VERBATIM] \n [LOAD count field [field ...]]\ \ \n [TIMEOUT timeout] \n [GROUPBY nargs property [property ...] [REDUCE function\ - \ nargs arg [arg ...] [AS name] [REDUCE function nargs arg [arg ...] [AS name]\ - \ ...]] ...]] \n [SORTBY nargs [property ASC | DESC [property ASC | DESC ...]]\ - \ [MAX num] [WITHCOUNT | WITHOUTCOUNT]] \n [APPLY expression AS name [APPLY expression AS name\ - \ ...]] \n [LIMIT offset num] \n [FILTER filter] \n [WITHCURSOR [COUNT read_size]\ - \ [MAXIDLE idle_time]] \n [PARAMS nargs name value [name value ...]] \n [SCORER scorer]\n - \ [ADDSCORES] \n [DIALECT\ - \ dialect]\n" -syntax_fmt: "FT.AGGREGATE index query [VERBATIM] [LOAD\_count field [field ...]]\n\ - \ [TIMEOUT\_timeout] [LOAD *] [GROUPBY\_nargs property [property ...]\n [REDUCE\_\ - function nargs arg [arg ...] [AS\_name] [REDUCE\_function\n nargs arg [arg ...]\ - \ [AS\_name] ...]] [GROUPBY\_nargs property\n [property ...] [REDUCE\_function\ - \ nargs arg [arg ...] [AS\_name]\n [REDUCE\_function nargs arg [arg ...] [AS\_\ - name] ...]] ...]]\n [SORTBY\_nargs [property [property \ - \ ...]]\n [MAX\_num]] [APPLY\_expression AS\_name [APPLY\_expression AS\_name\n\ - \ ...]] [LIMIT offset num] [FILTER\_filter] [WITHCURSOR\n [COUNT\_read_size] [MAXIDLE\_\ - idle_time]] [PARAMS nargs name value\n [name value ...]] [DIALECT\_dialect]" + \ nargs arg [arg ...] [AS name] [REDUCE function nargs arg [arg ...] [AS name] ...]]\ + \ ...]] \n [SORTBY nargs [property ASC | DESC [property ASC | DESC ...]] [MAX num]\ + \ [WITHCOUNT | WITHOUTCOUNT]] \n [APPLY expression AS name [APPLY expression AS\ + \ name ...]] \n [LIMIT offset num] \n [FILTER filter] \n [WITHCURSOR [COUNT read_size]\ + \ [MAXIDLE idle_time]] \n [PARAMS nargs name value [name value ...]] \n [SCORER\ + \ scorer]\n [ADDSCORES] \n [DIALECT dialect]\n" title: FT.AGGREGATE --- @@ -238,13 +535,14 @@ Attributes needed for aggregations should be stored as `SORTABLE`, where they ar groups the results in the pipeline based on one or more properties. Each group should have at least one _reducer_, a function that handles the group entries, either counting them, or performing multiple aggregate operations (see below). +
REDUCE {func} {nargs} {arg} … [AS {name}] reduces the matching results in each group into a single record, using a reduction function. For example, `COUNT` counts the number of records in the group. The reducers can have their own property names using the `AS {name}` optional argument. If a name is not given, the resulting name will be the name of the reduce function and the group properties. For example, if a name is not given to `COUNT_DISTINCT` by property `@foo`, the resulting name will be `count_distinct(@foo)`. -See [Supported GROUPBY reducers]({{< relref "develop/ai/search-and-query/advanced-concepts/aggregations#supported-groupby-reducers" >}}) for more details. +See [Supported GROUPBY reducers]({{< relref "develop/ai/search-and-query/advanced-concepts/aggregations#supported-groupby-reducers" >}}) for more details.
@@ -491,6 +789,28 @@ APPLY case(@is_pending == 0 && @priority == "high", 3,4) AS status_completed
+
+Collect top documents per group + +Group movies by genre and collect the top 5 movies per group, sorted by rating in descending order. Return the top 50 groups. + +{{< highlight bash >}} +FT.AGGREGATE idx:movies "*" + LOAD 4 @genre @title @rating @year + GROUPBY 1 @genre + REDUCE COLLECT 12 FIELDS 3 @title @rating @year SORTBY 2 @rating DESC LIMIT 0 5 AS top_movies + SORTBY 1 @genre LIMIT 0 50 +{{< /highlight >}} + +In this example: +- `LOAD` brings `@genre`, `@title`, `@rating`, and `@year` into the pipeline. `COLLECT` projects from fields already available in the pipeline; it does not trigger an implicit document load. Using `FIELDS *` in place of the explicit field list would return only the fields the pipeline already has, as controlled by `LOAD` and any field-generating operations such as `APPLY`. +- `FIELDS 3 @title @rating @year` projects those three fields into each collected entry. +- Duplicates are retained (default behavior, no `DISTINCT` flag). +- Documents within each group are sorted by `@rating` descending. +- Only the top 5 documents per group are returned. +- Only the top 50 groups are returned. +
+ ## Redis Software and Redis Cloud compatibility | Redis
Software | Redis Cloud
Flexible & Annual | Redis Cloud
Free & Fixed | Notes | @@ -529,3 +849,4 @@ One of the following: - [Aggregations]({{< relref "/develop/ai/search-and-query/advanced-concepts/aggregations" >}}) - [Key and field expiration behavior]({{< relref "/develop/ai/search-and-query/advanced-concepts/expiration" >}}) - [RediSearch]({{< relref "/develop/ai/search-and-query" >}}) +- [Search commands in MULTI/EXEC transactions and Lua scripts]({{< relref "/develop/ai/search-and-query/advanced-concepts/transactions" >}}) diff --git a/content/commands/ft.cursor-read.md b/content/commands/ft.cursor-read.md index 0036bf5dcb..32f55944b4 100644 --- a/content/commands/ft.cursor-read.md +++ b/content/commands/ft.cursor-read.md @@ -101,4 +101,5 @@ One of the following: ## Related topics -[RediSearch]({{< relref "/develop/ai/search-and-query/" >}}) +- [RediSearch]({{< relref "/develop/ai/search-and-query/" >}}) +- [Search commands in MULTI/EXEC transactions and Lua scripts]({{< relref "/develop/ai/search-and-query/advanced-concepts/transactions" >}}) diff --git a/content/commands/ft.hybrid.md b/content/commands/ft.hybrid.md index 7526fd03f4..f5c405710e 100644 --- a/content/commands/ft.hybrid.md +++ b/content/commands/ft.hybrid.md @@ -504,7 +504,7 @@ railroad_diagram: /images/railroad/ft.hybrid.svg since: 8.4.0 summary: Performs hybrid search combining text search and vector similarity search syntax_fmt: "FT.HYBRID index\n SEARCH query\n [SCORER scorer]\n [YIELD_SCORE_AS\ - \ name]\n VSIM vector_field $vector_param\n [KNN count K k [EF_RUNTIME ef_runtime]]\n\ + \ name]\n VSIM vector_field $vector_param\n [KNN count K k [EF_RUNTIME ef_runtime]] [SHARD_K_RATIO shard_k_ratio]]\n\ \ [RANGE count RADIUS radius [EPSILON epsilon]]\n [YIELD_SCORE_AS name]\n\ \ [FILTER filter]\n [COMBINE RRF count [CONSTANT constant] [WINDOW window]\ \ [YIELD_SCORE_AS name]]\n [COMBINE LINEAR count [[ALPHA alpha] [BETA beta]] [WINDOW\ @@ -566,9 +566,9 @@ assigns an alias to the search score for use in post-processing operations like
-KNN count K top-k [EF_RUNTIME ef-value] [YIELD_SCORE_AS name] +KNN count K top-k [EF_RUNTIME ef-value] [SHARD_K_RATIO shard-k-ratio] [YIELD_SCORE_AS name] -configures K-nearest neighbors search for vector similarity. The `count` parameter indicates the number of following parameters. `K` specifies the number of nearest neighbors to find. `EF_RUNTIME` controls the search accuracy vs. speed tradeoff. `YIELD_SCORE_AS` assigns an alias to the score value. +configures K-nearest neighbors search for vector similarity. The `count` parameter indicates the number of following parameters. `K` specifies the number of nearest neighbors to find. `EF_RUNTIME` controls the search accuracy vs. speed tradeoff. `SHARD_K_RATIO` controls the number of results each shard retrieves relative to the requested `top_k` in cluster setups. `YIELD_SCORE_AS` assigns an alias to the score value. See the [vector search]({{< relref "/develop/ai/search-and-query/vectors#cluster-optimization-examples" >}}) documentation for more information about `SHARD_K_RATIO`.
@@ -823,3 +823,4 @@ One of the following: - [Vector search concepts]({{< relref "/develop/ai/search-and-query/vectors" >}}) - [Combined search]({{< relref "/develop/ai/search-and-query/query/combined/" >}}) +- [Search commands in MULTI/EXEC transactions and Lua scripts]({{< relref "/develop/ai/search-and-query/advanced-concepts/transactions" >}}) diff --git a/content/commands/ft.profile.md b/content/commands/ft.profile.md index a8d84b5e7f..f7bcf6cf02 100644 --- a/content/commands/ft.profile.md +++ b/content/commands/ft.profile.md @@ -45,13 +45,13 @@ module: Search railroad_diagram: /images/railroad/ft.profile.svg since: 2.2.0 stack_path: docs/interact/search-and-query -summary: Performs a `FT.SEARCH` or `FT.AGGREGATE` command and collects performance +summary: Performs a `FT.SEARCH`, `FT.HYBRID`, or `FT.AGGREGATE` command and collects performance information -syntax_fmt: FT.PROFILE index [LIMITED] QUERY query +syntax_fmt: FT.PROFILE index [LIMITED] QUERY query title: FT.PROFILE --- -Apply [`FT.SEARCH`]({{< relref "commands/ft.search/" >}}) or [`FT.AGGREGATE`]({{< relref "commands/ft.aggregate/" >}}) command to collect performance details. For usage, see [Examples](#examples). +Apply [`FT.SEARCH`]({{< relref "commands/ft.search/" >}}), [`FT.HYBRID`]({{< relref "commands/ft.hybrid/" >}}), or [`FT.AGGREGATE`]({{< relref "commands/ft.aggregate/" >}}) command to collect performance details. For usage, see [Examples](#examples). ## Required arguments @@ -62,9 +62,9 @@ is the name of an index created using [`FT.CREATE`]({{< relref "commands/ft.crea
-SEARCH | AGGREGATE +SEARCH | HYBRID | AGGREGATE -represents the profile type, either [`FT.SEARCH`]({{< relref "commands/ft.search/" >}}) or [`FT.AGGREGATE`]({{< relref "commands/ft.aggregate/" >}}). +represents the profile type, either [`FT.SEARCH`]({{< relref "commands/ft.search/" >}}), [`FT.HYBRID`]({{< relref "commands/ft.hybrid/" >}}), or [`FT.AGGREGATE`]({{< relref "commands/ft.aggregate/" >}}).
@@ -76,7 +76,7 @@ removes details of any `reader` iterators.
QUERY {query} -is the query string, sent to `FT.SEARCH` or `FT.AGGREGATE`. +is the query string, sent to `FT.SEARCH`, `FT.HYBRID`, or `FT.AGGREGATE`.
Note: To reduce the size of the output, use `NOCONTENT` or `LIMIT 0 0` to reduce the number of reply results, or `LIMITED` to not reply with details of `reader iterators` inside built-in unions, such as `fuzzy` or `prefix` iterators. @@ -88,7 +88,7 @@ This page contains the up-to-date profile output as of RediSearch v2.8.33, v2.10 The output format itself may differ between RediSearch versions, and RESP protocol versions. {{< /note >}} -`FT.PROFILE` returns a two-element array reply. The first element contains the results of the provided `FT.SEARCH` or `FT.AGGREGATE` command. +`FT.PROFILE` returns a two-element array reply. The first element contains the results of the provided `FT.SEARCH`, `FT.HYBRID`, or `FT.AGGREGATE` command. The second element contains information about query creation, iterator profiles, and result processor profiles. Details of the second element follow in the sections below. @@ -103,7 +103,7 @@ If there's only one shard, the label will be omitted. | `Shard ID` | String containing the unique shard ID. In Redis Open Source, this identifier is denoted as the node ID, and is received from the `RedisModule_GetMyClusterID()` API. (Available as of RediSearch v8.4.3) | | `Total` `profile` `time` | The total run time (ms) of the query. Normally just a few ms. | | `Parsing` `time` | The time (ms) spent parsing the query and its parameters into a query plan. Normally just a few ms. | -| `Pipeline` `creation` `time` | The creation time (ms) of the execution plan, including iterators, result processors, and reducers creation. Normally just a few ms for `FT.SEARCH` queries, but expect a larger number for `FT.AGGREGATE` queries. | +| `Pipeline` `creation` `time` | The creation time (ms) of the execution plan, including iterators, result processors, and reducers creation. Normally just a few ms for `FT.SEARCH` or `FT.HYBRID` queries, but expect a larger number for `FT.AGGREGATE` queries. | | `Total` `GIL` `time` | In multi-threaded deployments, the total time (ms) the query spent holding and waiting for the Redis Global Lock (referred to as GIL) during execution. Note: this value is only valid in the shards profile section. | | `Warning` | Errors that occurred during query execution. | | `Internal` `cursor` `reads` | The number of times the coordinator fetched result batches from a given shard during a distributed `AGGREGATE` query in cluster mode. Includes the initial request plus any subsequent batch fetches. | @@ -460,9 +460,10 @@ One of the following: ## See also -[`FT.SEARCH`]({{< relref "commands/ft.search/" >}}) | [`FT.AGGREGATE`]({{< relref "commands/ft.aggregate/" >}}) +[`FT.SEARCH`]({{< relref "commands/ft.search/" >}}) | [`FT.HYBRID`]({{< relref "commands/ft.hybrid/" >}}) | [`FT.AGGREGATE`]({{< relref "commands/ft.aggregate/" >}}) ## Related topics -[RediSearch]({{< relref "/develop/ai/search-and-query/" >}}) +- [RediSearch]({{< relref "/develop/ai/search-and-query/" >}}) +- [Search commands in MULTI/EXEC transactions and Lua scripts]({{< relref "/develop/ai/search-and-query/advanced-concepts/transactions" >}}) diff --git a/content/commands/ft.search.md b/content/commands/ft.search.md index 90a6a57739..88454b52f3 100644 --- a/content/commands/ft.search.md +++ b/content/commands/ft.search.md @@ -883,3 +883,4 @@ One of the following: - [Key and field expiration behavior]({{< relref "/develop/ai/search-and-query/advanced-concepts/expiration" >}}) - [Query syntax]({{< relref "/develop/ai/search-and-query/query/" >}}) - [RediSearch]({{< relref "/develop/ai/search-and-query/" >}}) +- [Search commands in MULTI/EXEC transactions and Lua scripts]({{< relref "/develop/ai/search-and-query/advanced-concepts/transactions" >}}) diff --git a/content/commands/increx.md b/content/commands/increx.md new file mode 100644 index 0000000000..9c941a918f --- /dev/null +++ b/content/commands/increx.md @@ -0,0 +1,287 @@ +--- +acl_categories: +- '@fast' +- '@string' +- '@write' +arguments: +- key_spec_index: 0 + name: key + type: key +- arguments: + - name: float + token: BYFLOAT + type: double + - name: integer + token: BYINT + type: integer + name: increment + optional: true + type: oneof +- name: saturate + optional: true + summary: Saturate the result to LBOUND/UBOUND (or the type limits when no explicit + bound is given) when out of bounds. Without this option, out-of-bounds operations + are rejected and reply [current_value, 0]. + token: SATURATE + type: pure-token +- name: lowerbound + optional: true + summary: Integer when used with BYINT, floating-point when used with BYFLOAT. + token: LBOUND + type: string +- name: upperbound + optional: true + summary: Integer when used with BYINT, floating-point when used with BYFLOAT. + token: UBOUND + type: string +- arguments: + - name: seconds + token: EX + type: integer + - name: milliseconds + token: PX + type: integer + - name: unix-time-seconds + token: EXAT + type: unix-time + - name: unix-time-milliseconds + token: PXAT + type: unix-time + - name: persist + token: PERSIST + type: pure-token + name: expiration + optional: true + type: oneof +- name: enx + optional: true + summary: Only set the expiration if the key currently has no TTL. Requires one of + EX/PX/EXAT/PXAT; cannot be combined with PERSIST. + token: ENX + type: pure-token +arity: -2 +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- write +- denyoom +- fast +complexity: O(1) +description: Increments the numeric value of a key by a number and sets its expiration + time. Uses 0 as initial value if the key doesn't exist. +group: string +hidden: false +key_specs: +- begin_search: + index: + pos: 1 + find_keys: + range: + lastkey: 0 + limit: 0 + step: 1 + flags: + - rw + - access + - update +linkTitle: INCREX +railroad_diagram: /images/railroad/increx.svg +reply_schema: + items: + - description: the value of the key after the increment + type: number + - description: the actual increment + type: number + maxItems: 2 + minItems: 2 + type: array +since: 8.8.0 +summary: Increments the numeric value of a key by a number and sets its expiration + time. Uses 0 as initial value if the key doesn't exist. +syntax_fmt: "INCREX key [BYFLOAT\_increment | BYINT\_increment]\n\ + \ [LBOUND\_lowerbound] [UBOUND\_upperbound] [SATURATE]\n\ + \ [EX\_seconds | PX\_milliseconds | EXAT\_unix-time-seconds| PXAT\_unix-time-milliseconds | PERSIST] [ENX]" +title: INCREX +--- +Increments or decrements the numeric value stored at `key` by the specified amount, with optional upper/lower bounds and expiration control, in a single atomic operation. +If the key does not exist, it is set to `0` before performing the operation. +An error is returned if the key contains a value of the wrong type or a string that cannot be interpreted as a number. + +Unlike [`INCR`]({{< relref "/commands/incr" >}}) and [`INCRBY`]({{< relref "/commands/incrby" >}}), `INCREX` returns an array of two elements: the new value of the key after the increment, and the increment that was actually applied. When the computed result would fall outside an explicit `LBOUND`/`UBOUND` or the type limits, the default is to skip the operation and reply with `[current_value, 0]`, leaving the key and its TTL untouched. The `SATURATE` flag changes this behavior so the result is capped at the bound instead. + +## Required arguments + +
key + +The name of the key to increment. + +
+ +## Optional arguments + +
BYFLOAT increment | BYINT increment + +Specifies the increment amount and type: + +* `BYFLOAT increment`: increment the value by the given long-double float. The key's existing value may be either an integer or a float, since integers can be promoted to floats losslessly. Results that would produce NaN or Infinity are rejected. +* `BYINT increment`: increment the value by the given 64-bit signed integer. The increment may be negative to decrement the value. `BYINT` requires the key's existing value to be integer-typed; a stored float such as `"1.5"` cannot be parsed back as an integer. This is consistent with [`INCR`]({{< relref "/commands/incr" >}})/[`INCRBY`]({{< relref "/commands/incrby" >}}) (integer-only) and [`INCRBYFLOAT`]({{< relref "/commands/incrbyfloat" >}}) (accepts both). + +If neither `BYFLOAT` nor `BYINT` is specified, the key is incremented by `1` in integer mode. `BYFLOAT` and `BYINT` are mutually exclusive. + +
+ +
LBOUND lowerbound + +Sets a lower bound for the resulting value. If the computed result would fall below `lowerbound`, the operation is skipped and the reply is `[current_value, 0]` (or use the `SATURATE` flag to floor the result at `lowerbound` instead). When omitted, the bound is `LLONG_MIN` in integer mode or `-LDBL_MAX` in `BYFLOAT` mode. `LBOUND` must be less than or equal to `UBOUND` when both are specified. + +
+ +
UBOUND upperbound + +Sets an upper bound for the resulting value. If the computed result would exceed `upperbound`, the operation is skipped and the reply is `[current_value, 0]` (or use the `SATURATE` flag to cap the result at `upperbound` instead). When omitted, the bound is `LLONG_MAX` in integer mode or `LDBL_MAX` in `BYFLOAT` mode. `UBOUND` must be greater than or equal to `LBOUND` when both are specified. + +
+ +
SATURATE + +When specified, an out-of-bounds result is capped at `UBOUND` or floored at `LBOUND` (or saturated to the type limits when no explicit bound is given). The second element of the reply reflects the saturated delta. An error is returned if the delta cannot be represented as a 64-bit signed integer in integer mode, or would produce Infinity in `BYFLOAT` mode. Any expiration option is still applied as specified. + +A bound violation includes both exceeding an explicit `LBOUND`/`UBOUND` and overflowing the type limits when no explicit bound is given. + +
+ +
expiration flags + +The `INCREX` command supports a set of options that modify its expiration behavior: + +* `EX seconds`: set the specified expiration time in seconds (a positive integer). +* `PX milliseconds`: set the specified expiration time in milliseconds (a positive integer). +* `EXAT unix-time-seconds`: set the specified Unix time in seconds (a positive integer) at which the key will expire. +* `PXAT unix-time-milliseconds`: set the specified Unix time in milliseconds (a positive integer) at which the key will expire. +* `PERSIST`: remove the expiration associated with the key. + +When no expiration option is given, the key's existing TTL (if any) is preserved. + +
+ +
ENX + +Only sets the TTL/expiration if the key currently has no TTL/expiration. If the key already has a TTL, the increment is still applied but the TTL is left unchanged. `ENX` can ensure that a window counter rate limiter's TTL is set only when it is created, and not reset on subsequent token requests.`ENX` must be combined with `EX`, `PX`, `EXAT`, or `PXAT` and is incompatible with `PERSIST`. + +
+ +## Examples + +Default increment (by 1), starting from 0 if the key does not exist: + +{{% redis-cli %}} +DEL mykey +INCREX mykey +INCREX mykey +{{% /redis-cli %}} + +Increment by a specific integer using `BYINT`, including a negative increment to decrement: + +{{% redis-cli %}} +SET mykey 100 +INCREX mykey BYINT 5 +INCREX mykey BYINT -10 +{{% /redis-cli %}} + +Increment by a floating-point number using `BYFLOAT`: + +{{% redis-cli %}} +SET mykey 1.5 +INCREX mykey BYFLOAT 0.25 +{{% /redis-cli %}} + +Set an expiration on every increment with `EX`: + +{{% redis-cli %}} +DEL mykey +INCREX mykey BYINT 1 EX 100 +TTL mykey +{{% /redis-cli %}} + +Use `ENX` to set an expiration only when the key has no existing TTL. The increment is always applied regardless: + +{{% redis-cli %}} +SET mykey 10 +INCREX mykey BYINT 1 EX 100 ENX +TTL mykey +SET mykey 10 EX 500 +INCREX mykey BYINT 1 EX 10 ENX +TTL mykey +{{% /redis-cli %}} + +Use `PERSIST` to remove the key's expiration while incrementing: + +{{% redis-cli %}} +SET mykey 5 EX 1000 +TTL mykey +INCREX mykey BYINT 1 PERSIST +TTL mykey +{{% /redis-cli %}} + +Compare the default out-of-bounds behavior with `SATURATE` when the result would exceed `UBOUND`. By default the key is left untouched and the reply reports a zero delta; with `SATURATE` the result is capped at the bound and the reply reflects the saturated delta: + +{{% redis-cli %}} +SET mykey 99 +INCREX mykey BYINT 5 UBOUND 100 +SET mykey 99 +INCREX mykey BYINT 5 UBOUND 100 SATURATE +{{% /redis-cli %}} + +## Pattern: window counter rate limiter + +A common rate-limiting pattern requires atomically incrementing a counter and setting its expiration. With plain [`INCR`]({{< relref "/commands/incr" >}}) and [`EXPIRE`]({{< relref "/commands/expire" >}}), this typically requires a Lua script to be atomic. + +`INCREX` requires a single native command. `UBOUND` enforces the rate cap — by default, once the cap is reached the operation is skipped — and `ENX` ensures that a new window with the correct duration is created if the previous one has expired; if a window already exists, it won't be extended. When the counter has already reached the cap, `actual_increment` is `0`, giving the caller immediate feedback without extra reads or error handling: + +```python +new_val, actual_incr = redis.execute_command( + "INCREX", f"ratelimit:{user_id}", + "BYINT", 1, "UBOUND", 100, + "EX", 60, "ENX", +) +if actual_incr == 0: + reject_request() # rate limit exceeded +``` + +## Redis Software and Redis Cloud compatibility + +| Redis
Software | Redis
Cloud | Notes | +|:----------------------|:-----------------|:------| +| ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | + +## Return information + +{{< multitabs id="return-info" + tab1="RESP2" + tab2="RESP3" >}} + +[Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}): a two-element array: + +1. **New value** — the value of the key after the increment, or the unchanged current value when an out-of-bounds result caused the operation to be skipped. +2. **Actual increment** — the increment that was actually applied. May differ from the requested increment when `SATURATE` caps the result at a bound, and is always `0` when an out-of-bounds result caused the operation to be skipped. + +Both elements are [Integer replies]({{< relref "/develop/reference/protocol-spec#integers" >}}) in integer mode (default or `BYINT`), or [Bulk string replies]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) representing the float values in `BYFLOAT` mode. + +-tab-sep- + +[Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}): a two-element array: + +1. **New value** — the value of the key after the increment, or the unchanged current value when an out-of-bounds result caused the operation to be skipped. +2. **Actual increment** — the increment that was actually applied. May differ from the requested increment when `SATURATE` caps the result at a bound, and is always `0` when an out-of-bounds result caused the operation to be skipped. + +Both elements are [Integer replies]({{< relref "/develop/reference/protocol-spec#integers" >}}) in integer mode (default or `BYINT`), or [Double replies]({{< relref "/develop/reference/protocol-spec#doubles" >}}) in `BYFLOAT` mode. + +{{< /multitabs >}} diff --git a/content/commands/info.md b/content/commands/info.md index a479dd20af..66d58c46be 100644 --- a/content/commands/info.md +++ b/content/commands/info.md @@ -393,6 +393,16 @@ Here is the meaning of all fields in the **stats** section: * `acl_access_denied_channel`: Number of commands rejected because of access denied to a channel * `acl_access_denied_tls_cert`: Number of failed TLS certificate–based authentication attempts * `cluster_incompatible_ops`: Number of cluster-incompatible commands. This metric appears only if the `cluster-compatibility-sample-ratio` configuration parameter is not 0. Added in Redis 8.0. +* `slowlog_commands_count`: commands written to slowlog [1](#list-note-1) +* `slowlog_commands_time_ms_sum`: sum of execution times of commands from the slowlog [1](#list-note-1) +* `slowlog_commands_time_ms_max`: maximum execution time of a command from the slowlog [1](#list-note-1) +* `total_client_processing_events`: attempts to process client input buffers; does not guarantee any command was actually parsed [1](#list-note-1) +* `eventloop_cycles_with_clients_processing`: event loop cycles where client input buffers were processed [1](#list-note-1) +* `commands_per_parse_batch_sum`: cumulative number of commands parsed across all parsing batches for all clients [1](#list-note-1) +* `commands_per_parse_batch_cnt`: number of parsing batches across all clients. A batch is counted each time at least one command is parsed from a client's query buffer [1](#list-note-1) +* `commands_per_parse_batch_avg`: average commands parsed per batch (sum/cnt). Approximates pipelining depth [1](#list-note-1) + +1. Added in Redis 8.8 Here is the meaning of all fields in the **replication** section: @@ -464,16 +474,24 @@ Here is the meaning of all fields in the **cpu** section: * `used_cpu_sys_main_thread`: System CPU consumed by the Redis server main thread * `used_cpu_user_main_thread`: User CPU consumed by the Redis server main thread -The **commandstats** section provides statistics based on the command type, - including the number of calls that reached command execution (not rejected), - the total CPU time consumed by these commands, the average CPU consumed - per command execution, the number of rejected calls - (errors prior command execution), and the number of failed calls - (errors within the command execution). +The **commandstats** section provides statistics based on the command type: + +- `calls` - the number of calls that reached command execution +- `usec` - the total CPU time consumed by these commands +- `usec_per_call` - the average CPU consumed per command execution +- `rejected_calls` - the number of rejected calls +- `failed_calls` - the number of failed calls + + For commands that are logged to the slowlog, the following statistics are also reported (added in Redis 8.8): + +- `slowlog_count` - number of times the command was written in the slowlog +- `slowlog_time_ms_sum` - sum of execution time of the command (only from the slowlog) +- `slowlog_time_ms_max` - maximum execution time of the command (only from the slowlog) For each command type, the following line is added: -* `cmdstat_XXX`: `calls=XXX,usec=XXX,usec_per_call=XXX,rejected_calls=XXX,failed_calls=XXX` +* `cmdstat_XXX`:`calls=XXX,usec=XXX,usec_per_call=XXX,rejected_calls=XXX,failed_calls=XXX,` + `slowlog_count=XXX,slowlog_time_ms_sum=XXX,slowlog_time_ms_max=XXX` The **latencystats** section provides latency percentile distribution statistics based on the command type. diff --git a/content/commands/json.set.md b/content/commands/json.set.md index 14e00c5ab7..9c75fd930b 100644 --- a/content/commands/json.set.md +++ b/content/commands/json.set.md @@ -20,6 +20,25 @@ arguments: name: condition optional: true type: oneof +- arguments: + - arguments: + - name: FP16 + token: FP16 + type: pure-token + - name: BF16 + token: BF16 + type: pure-token + - name: FP32 + token: FP32 + type: pure-token + - name: FP64 + token: FP64 + type: pure-token + name: fpha-type + type: oneof + name: fpha + optional: true + type: block categories: - docs - develop @@ -43,7 +62,7 @@ railroad_diagram: /images/railroad/json.set.svg since: 1.0.0 stack_path: docs/data-types/json summary: Sets or updates the JSON value at a path -syntax_fmt: JSON.SET key path value [NX | XX] +syntax_fmt: JSON.SET key path value [NX | XX] [FPHA ] title: JSON.SET --- @@ -93,6 +112,18 @@ Sets the value only if `path` has no matches. Sets the value only if `path` has one or more matches.
+
FPHA + +Force floating point homogeneous arrays (FPHAs) to use a specified FP type. Added in Redis 8.8. + +The available types offer a trade-off between precision and memory footprint. FP64 (64-bit) and FP32 (32-bit) provide higher precision for scientific and general computing workloads. BF16 and FP16 (both 16-bit) use half the memory of FP32 and require less memory, making them well suited for AI training and inference. A common strategy is to store and compute in BF16/FP16 for speed while accumulating results in FP32 to maintain accuracy. + +Since JSON's numeric representation is textual, Redis cannot always infer the best FP type to use for FPHAs (for example, for vector embeddings). If your JSON was generated from an array of FP values with a given FP type, you should pass this type here. + +If at least one of the specified values within the given FPHA doesn’t fit into the type specified (an overflow situation), the command will issue +a "`value out of range`" error. +
+ ## Examples
@@ -121,6 +152,17 @@ redis> JSON.GET doc $ {{< / highlight >}}
+
+Add a new value with FPHA + +{{< highlight bash >}} +redis> JSON.SET doc $ '[[1,2,3,4e3],[5,6.0,7,8]]' FPHA FP16 +OK +redis> JSON.GET doc $ +"[[[1.0,2.0,3.0,4000.0],[5.0,6.0,7.0,8.0]]]" +{{< / highlight >}} +
+
Update multiple matches @@ -185,6 +227,7 @@ One of the following: * [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}): `(error) ERR new objects must be created at the root` - if `key` does not exist and `path` is not root (`$` or `.`). * [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}): `(error) ERR wrong static path` - if a dynamic path expression has no matching locations. * [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}): `(error) ERR index out of bounds` - if the path refers to an array index outside the array bounds. +* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}): `(error) value out of range for ...` - if one or more values of a FP array are out of range for the given type. -tab-sep- @@ -196,6 +239,8 @@ One of the following: * [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}): `(error) ERR new objects must be created at the root` - if `key` does not exist and `path` is not root (`$` or `.`). * [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}): `(error) ERR wrong static path` - if a dynamic path expression has no matching locations. * [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}): `(error) ERR index out of bounds` - if the path refers to an array index outside the array bounds. +* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}): `(error) value out of range for ...` - if one or more values of a FP array are out of range for the given type. + {{< /multitabs >}} ## See also diff --git a/content/commands/redis-8-8-commands.md b/content/commands/redis-8-8-commands.md new file mode 100644 index 0000000000..ad06963646 --- /dev/null +++ b/content/commands/redis-8-8-commands.md @@ -0,0 +1,6477 @@ +--- +title: Redis 8.8 Commands Reference +linkTitle: Redis 8.8 Commands +description: Complete list of all Redis commands available in version 8.8, organized by functional group +summary: Complete list of all Redis commands available in version 8.8, organized by functional group +layout: single +type: develop +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- kubernetes +- clients +weight: -20 +--- + +This page provides a comprehensive reference of all Redis commands available in Redis 8.8, organized by functional group. Each command includes its description and syntax in a collapsible section for easy navigation. + +{{< note >}} +Redis 8.8 includes all commands from previous versions plus new commands introduced in 8.8. Commands marked with **⭐ New in 8.8** were added in this release. +{{< /note >}} + +## Quick Navigation + +- [String commands](#string-commands) +- [Hash commands](#hash-commands) +- [List commands](#list-commands) +- [Set commands](#set-commands) +- [Sorted set commands](#sorted-set-commands) +- [Stream commands](#stream-commands) +- [Bitmap commands](#bitmap-commands) +- [Array commands](#array-commands) +- [HyperLogLog commands](#hyperloglog-commands) +- [Geospatial commands](#geospatial-commands) +- [JSON commands](#json-commands) +- [Search commands](#search-commands) +- [Time series commands](#time-series-commands) +- [Vector set commands](#vector-set-commands) +- [Pub/Sub commands](#pubsub-commands) +- [Transaction commands](#transaction-commands) +- [Scripting commands](#scripting-commands) +- [Connection commands](#connection-commands) +- [Server commands](#server-commands) +- [Cluster commands](#cluster-commands) +- [Generic commands](#generic-commands) + +--- + +## String commands + +String commands operate on string values, the most basic Redis data type. + +
+APPEND - Appends a string to the value of a key. Creates the key if it doesn't exist. + +**Syntax:** `APPEND key value` + +**Description:** Appends a string to the value of a key. Creates the key if it doesn't exist. + +**Complexity:** O(1). The amortized time complexity is O(1) assuming the appended value is small and the already present value is of any size, since the dynamic string library used by Redis will double the free space available on every reallocation. + +**Since:** 2.0.0 + +
+ +
+DECR - Decrements the integer value of a key by one. Uses 0 as initial value if the key doesn't exist. + +**Syntax:** `DECR key` + +**Description:** Decrements the integer value of a key by one. Uses 0 as initial value if the key doesn't exist. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+DECRBY - Decrements a number from the integer value of a key. Uses 0 as initial value if the key doesn't exist. + +**Syntax:** `DECRBY key decrement` + +**Description:** Decrements a number from the integer value of a key. Uses 0 as initial value if the key doesn't exist. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+DELEX - Conditionally removes the specified key based on value or hash digest comparison. + +**Syntax:** `DELEX key [IFEQ ifeq-value | IFNE ifne-value | IFDEQ ifdeq-digest | + IFDNE ifdne-digest]` + +**Description:** Conditionally removes the specified key based on value or hash digest comparison. + +**Complexity:** O(1) for IFEQ/IFNE, O(N) for IFDEQ/IFDNE where N is the length of the string value. + +**Since:** 8.4.0 + +
+ +
+DIGEST - Returns the hash digest of a string value as a hexadecimal string. + +**Syntax:** `DIGEST key` + +**Description:** Returns the hash digest of a string value as a hexadecimal string. + +**Complexity:** O(N) where N is the length of the string value. + +**Since:** 8.4.0 + +
+ +
+GET - Returns the string value of a key. + +**Syntax:** `GET key` + +**Description:** Returns the string value of a key. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+GETDEL - Returns the string value of a key after deleting the key. + +**Syntax:** `GETDEL key` + +**Description:** Returns the string value of a key after deleting the key. + +**Complexity:** O(1) + +**Since:** 6.2.0 + +
+ +
+GETEX - Returns the string value of a key after setting its expiration time. + +**Syntax:** `GETEX key [EX seconds | PX milliseconds | EXAT unix-time-seconds | + PXAT unix-time-milliseconds | PERSIST]` + +**Description:** Returns the string value of a key after setting its expiration time. + +**Complexity:** O(1) + +**Since:** 6.2.0 + +
+ +
+GETRANGE - Returns a substring of the string stored at a key. + +**Syntax:** `GETRANGE key start end` + +**Description:** Returns a substring of the string stored at a key. + +**Complexity:** O(N) where N is the length of the returned string. The complexity is ultimately determined by the returned length, but because creating a substring from an existing string is very cheap, it can be considered O(1) for small strings. + +**Since:** 2.4.0 + +
+ +
+GETSET - Returns the previous string value of a key after setting it to a new value. + +**Syntax:** `GETSET key value` + +**Description:** Returns the previous string value of a key after setting it to a new value. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+INCR - Increments the integer value of a key by one. Uses 0 as initial value if the key doesn't exist. + +**Syntax:** `INCR key` + +**Description:** Increments the integer value of a key by one. Uses 0 as initial value if the key doesn't exist. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+INCRBY - Increments the integer value of a key by a number. Uses 0 as initial value if the key doesn't exist. + +**Syntax:** `INCRBY key increment` + +**Description:** Increments the integer value of a key by a number. Uses 0 as initial value if the key doesn't exist. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+INCRBYFLOAT - Increment the floating point value of a key by a number. Uses 0 as initial value if the key doesn't exist. + +**Syntax:** `INCRBYFLOAT key increment` + +**Description:** Increment the floating point value of a key by a number. Uses 0 as initial value if the key doesn't exist. + +**Complexity:** O(1) + +**Since:** 2.6.0 + +
+ +
+INCREX - Increments the numeric value of a key by a number and sets its expiration time. Uses 0 as initial value if the key doesn't exist. ⭐ New in 8.8 + +**Syntax:** `INCREX key [BYFLOAT float | BYINT integer] + [LBOUND lowerbound] [UBOUND upperbound] [OVERFLOW ] + [EX seconds | PX milliseconds| EXAT unix-time-seconds | PXAT unix-time-milliseconds | PERSIST] + [ENX]` + +**Description:** Increments the numeric value of a key by a number and sets its expiration time. Uses 0 as initial value if the key doesn't exist. + +**Complexity:** O(1) + +**Since:** 8.8.0 + +
+ +
+LCS - Finds the longest common substring. + +**Syntax:** `LCS key1 key2 [LEN] [IDX] [MINMATCHLEN min-match-len] [WITHMATCHLEN]` + +**Description:** Finds the longest common substring. + +**Complexity:** O(N*M) where N and M are the lengths of s1 and s2, respectively + +**Since:** 7.0.0 + +
+ +
+MGET - Atomically returns the string values of one or more keys. + +**Syntax:** `MGET key [key ...]` + +**Description:** Atomically returns the string values of one or more keys. + +**Complexity:** O(N) where N is the number of keys to retrieve. + +**Since:** 1.0.0 + +
+ +
+MSET - Atomically creates or modifies the string values of one or more keys. + +**Syntax:** `MSET key value [key value ...]` + +**Description:** Atomically creates or modifies the string values of one or more keys. + +**Complexity:** O(N) where N is the number of keys to set. + +**Since:** 1.0.1 + +
+ +
+MSETEX - Atomically sets multiple string keys with a shared expiration in a single operation. + +**Syntax:** `MSETEX numkeys key value [key value ...] [NX | XX] [EX seconds | + PX milliseconds | EXAT unix-time-seconds | + PXAT unix-time-milliseconds | KEEPTTL]` + +**Description:** Atomically sets multiple string keys with a shared expiration in a single operation. + +**Complexity:** O(N) where N is the number of keys to set. + +**Since:** 8.4.0 + +
+ +
+MSETNX - Atomically modifies the string values of one or more keys only when all keys don't exist. + +**Syntax:** `MSETNX key value [key value ...]` + +**Description:** Atomically modifies the string values of one or more keys only when all keys don't exist. + +**Complexity:** O(N) where N is the number of keys to set. + +**Since:** 1.0.1 + +
+ +
+PSETEX - Sets both string value and expiration time in milliseconds of a key. The key is created if it doesn't exist. + +**Syntax:** `PSETEX key milliseconds value` + +**Description:** Sets both string value and expiration time in milliseconds of a key. The key is created if it doesn't exist. + +**Complexity:** O(1) + +**Since:** 2.6.0 + +
+ +
+SET - Sets the string value of a key, ignoring its type. The key is created if it doesn't exist. + +**Syntax:** `SET key value [NX | XX | IFEQ ifeq-value | IFNE ifne-value | + IFDEQ ifdeq-digest | IFDNE ifdne-digest] [GET] [EX seconds | + PX milliseconds | EXAT unix-time-seconds | + PXAT unix-time-milliseconds | KEEPTTL]` + +**Description:** Sets the string value of a key, ignoring its type. The key is created if it doesn't exist. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+SETEX - Sets the string value and expiration time of a key. Creates the key if it doesn't exist. + +**Syntax:** `SETEX key seconds value` + +**Description:** Sets the string value and expiration time of a key. Creates the key if it doesn't exist. + +**Complexity:** O(1) + +**Since:** 2.0.0 + +
+ +
+SETNX - Set the string value of a key only when the key doesn't exist. + +**Syntax:** `SETNX key value` + +**Description:** Set the string value of a key only when the key doesn't exist. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+SETRANGE - Overwrites a part of a string value with another by an offset. Creates the key if it doesn't exist. + +**Syntax:** `SETRANGE key offset value` + +**Description:** Overwrites a part of a string value with another by an offset. Creates the key if it doesn't exist. + +**Complexity:** O(1), not counting the time taken to copy the new string in place. Usually, this string is very small so the amortized complexity is O(1). Otherwise, complexity is O(M) with M being the length of the value argument. + +**Since:** 2.2.0 + +
+ +
+STRLEN - Returns the length of a string value. + +**Syntax:** `STRLEN key` + +**Description:** Returns the length of a string value. + +**Complexity:** O(1) + +**Since:** 2.2.0 + +
+ +
+SUBSTR - Returns a substring from a string value. + +**Syntax:** `SUBSTR key start end` + +**Description:** Returns a substring from a string value. + +**Complexity:** O(N) where N is the length of the returned string. The complexity is ultimately determined by the returned length, but because creating a substring from an existing string is very cheap, it can be considered O(1) for small strings. + +**Since:** 1.0.0 + +
+ + +## Hash commands + +Hash commands operate on hash data structures, which map string fields to string values. + +
+HDEL - Deletes one or more fields and their values from a hash. Deletes the hash if no fields remain. + +**Syntax:** `HDEL key field [field ...]` + +**Description:** Deletes one or more fields and their values from a hash. Deletes the hash if no fields remain. + +**Complexity:** O(N) where N is the number of fields to be removed. + +**Since:** 2.0.0 + +
+ +
+HEXISTS - Determines whether a field exists in a hash. + +**Syntax:** `HEXISTS key field` + +**Description:** Determines whether a field exists in a hash. + +**Complexity:** O(1) + +**Since:** 2.0.0 + +
+ +
+HEXPIRE - Set expiry for hash field using relative time to expire (seconds) + +**Syntax:** `HEXPIRE key seconds [NX | XX | GT | LT] FIELDS numfields field + [field ...]` + +**Description:** Set expiry for hash field using relative time to expire (seconds) + +**Complexity:** O(N) where N is the number of specified fields + +**Since:** 7.4.0 + +
+ +
+HEXPIREAT - Set expiry for hash field using an absolute Unix timestamp (seconds) + +**Syntax:** `HEXPIREAT key unix-time-seconds [NX | XX | GT | LT] FIELDS numfields + field [field ...]` + +**Description:** Set expiry for hash field using an absolute Unix timestamp (seconds) + +**Complexity:** O(N) where N is the number of specified fields + +**Since:** 7.4.0 + +
+ +
+HEXPIRETIME - Returns the expiration time of a hash field as a Unix timestamp, in seconds. + +**Syntax:** `HEXPIRETIME key FIELDS numfields field [field ...]` + +**Description:** Returns the expiration time of a hash field as a Unix timestamp, in seconds. + +**Complexity:** O(N) where N is the number of specified fields + +**Since:** 7.4.0 + +
+ +
+HGET - Returns the value of a field in a hash. + +**Syntax:** `HGET key field` + +**Description:** Returns the value of a field in a hash. + +**Complexity:** O(1) + +**Since:** 2.0.0 + +
+ +
+HGETALL - Returns all fields and values in a hash. + +**Syntax:** `HGETALL key` + +**Description:** Returns all fields and values in a hash. + +**Complexity:** O(N) where N is the size of the hash. + +**Since:** 2.0.0 + +
+ +
+HGETDEL - Returns the value of a field and deletes it from the hash. + +**Syntax:** `HGETDEL key FIELDS numfields field [field ...]` + +**Description:** Returns the value of a field and deletes it from the hash. + +**Complexity:** O(N) where N is the number of specified fields + +**Since:** 8.0.0 + +
+ +
+HGETEX - Get the value of one or more fields of a given hash key, and optionally set their expiration. + +**Syntax:** `HGETEX key [EX seconds | PX milliseconds | EXAT unix-time-seconds | + PXAT unix-time-milliseconds | PERSIST] FIELDS numfields field + [field ...]` + +**Description:** Get the value of one or more fields of a given hash key, and optionally set their expiration. + +**Complexity:** O(N) where N is the number of specified fields + +**Since:** 8.0.0 + +
+ +
+HINCRBY - Increments the integer value of a field in a hash by a number. Uses 0 as initial value if the field doesn't exist. + +**Syntax:** `HINCRBY key field increment` + +**Description:** Increments the integer value of a field in a hash by a number. Uses 0 as initial value if the field doesn't exist. + +**Complexity:** O(1) + +**Since:** 2.0.0 + +
+ +
+HINCRBYFLOAT - Increments the floating point value of a field by a number. Uses 0 as initial value if the field doesn't exist. + +**Syntax:** `HINCRBYFLOAT key field increment` + +**Description:** Increments the floating point value of a field by a number. Uses 0 as initial value if the field doesn't exist. + +**Complexity:** O(1) + +**Since:** 2.6.0 + +
+ +
+HKEYS - Returns all fields in a hash. + +**Syntax:** `HKEYS key` + +**Description:** Returns all fields in a hash. + +**Complexity:** O(N) where N is the size of the hash. + +**Since:** 2.0.0 + +
+ +
+HLEN - Returns the number of fields in a hash. + +**Syntax:** `HLEN key` + +**Description:** Returns the number of fields in a hash. + +**Complexity:** O(1) + +**Since:** 2.0.0 + +
+ +
+HMGET - Returns the values of all fields in a hash. + +**Syntax:** `HMGET key field [field ...]` + +**Description:** Returns the values of all fields in a hash. + +**Complexity:** O(N) where N is the number of fields being requested. + +**Since:** 2.0.0 + +
+ +
+HMSET - Sets the values of multiple fields. + +**Syntax:** `HMSET key field value [field value ...]` + +**Description:** Sets the values of multiple fields. + +**Complexity:** O(N) where N is the number of fields being set. + +**Since:** 2.0.0 + +
+ +
+HPERSIST - Removes the expiration time for each specified field + +**Syntax:** `HPERSIST key FIELDS numfields field [field ...]` + +**Description:** Removes the expiration time for each specified field + +**Complexity:** O(N) where N is the number of specified fields + +**Since:** 7.4.0 + +
+ +
+HPEXPIRE - Set expiry for hash field using relative time to expire (milliseconds) + +**Syntax:** `HPEXPIRE key milliseconds [NX | XX | GT | LT] FIELDS numfields field + [field ...]` + +**Description:** Set expiry for hash field using relative time to expire (milliseconds) + +**Complexity:** O(N) where N is the number of specified fields + +**Since:** 7.4.0 + +
+ +
+HPEXPIREAT - Set expiry for hash field using an absolute Unix timestamp (milliseconds) + +**Syntax:** `HPEXPIREAT key unix-time-milliseconds [NX | XX | GT | LT] + FIELDS numfields field [field ...]` + +**Description:** Set expiry for hash field using an absolute Unix timestamp (milliseconds) + +**Complexity:** O(N) where N is the number of specified fields + +**Since:** 7.4.0 + +
+ +
+HPEXPIRETIME - Returns the expiration time of a hash field as a Unix timestamp, in msec. + +**Syntax:** `HPEXPIRETIME key FIELDS numfields field [field ...]` + +**Description:** Returns the expiration time of a hash field as a Unix timestamp, in msec. + +**Complexity:** O(N) where N is the number of specified fields + +**Since:** 7.4.0 + +
+ +
+HPTTL - Returns the TTL in milliseconds of a hash field. + +**Syntax:** `HPTTL key FIELDS numfields field [field ...]` + +**Description:** Returns the TTL in milliseconds of a hash field. + +**Complexity:** O(N) where N is the number of specified fields + +**Since:** 7.4.0 + +
+ +
+HRANDFIELD - Returns one or more random fields from a hash. + +**Syntax:** `HRANDFIELD key [count [WITHVALUES]]` + +**Description:** Returns one or more random fields from a hash. + +**Complexity:** O(N) where N is the number of fields returned + +**Since:** 6.2.0 + +
+ +
+HSCAN - Iterates over fields and values of a hash. + +**Syntax:** `HSCAN key cursor [MATCH pattern] [COUNT count] [NOVALUES]` + +**Description:** Iterates over fields and values of a hash. + +**Complexity:** O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection. + +**Since:** 2.8.0 + +
+ +
+HSET - Creates or modifies the value of a field in a hash. + +**Syntax:** `HSET key field value [field value ...]` + +**Description:** Creates or modifies the value of a field in a hash. + +**Complexity:** O(1) for each field/value pair added, so O(N) to add N field/value pairs when the command is called with multiple field/value pairs. + +**Since:** 2.0.0 + +
+ +
+HSETEX - Set the value of one or more fields of a given hash key, and optionally set their expiration. + +**Syntax:** `HSETEX key [FNX | FXX] [EX seconds | PX milliseconds | + EXAT unix-time-seconds | PXAT unix-time-milliseconds | KEEPTTL] + FIELDS numfields field value [field value ...]` + +**Description:** Set the value of one or more fields of a given hash key, and optionally set their expiration. + +**Complexity:** O(N) where N is the number of fields being set. + +**Since:** 8.0.0 + +
+ +
+HSETNX - Sets the value of a field in a hash only when the field doesn't exist. + +**Syntax:** `HSETNX key field value` + +**Description:** Sets the value of a field in a hash only when the field doesn't exist. + +**Complexity:** O(1) + +**Since:** 2.0.0 + +
+ +
+HSTRLEN - Returns the length of the value of a field. + +**Syntax:** `HSTRLEN key field` + +**Description:** Returns the length of the value of a field. + +**Complexity:** O(1) + +**Since:** 3.2.0 + +
+ +
+HTTL - Returns the TTL in seconds of a hash field. + +**Syntax:** `HTTL key FIELDS numfields field [field ...]` + +**Description:** Returns the TTL in seconds of a hash field. + +**Complexity:** O(N) where N is the number of specified fields + +**Since:** 7.4.0 + +
+ +
+HVALS - Returns all values in a hash. + +**Syntax:** `HVALS key` + +**Description:** Returns all values in a hash. + +**Complexity:** O(N) where N is the size of the hash. + +**Since:** 2.0.0 + +
+ + +## List commands + +List commands operate on lists of strings, ordered by insertion order. + +
+BLMOVE - Pops an element from a list, pushes it to another list and returns it. Blocks until an element is available otherwise. Deletes the list if the last element was moved. + +**Syntax:** `BLMOVE source destination timeout` + +**Description:** Pops an element from a list, pushes it to another list and returns it. Blocks until an element is available otherwise. Deletes the list if the last element was moved. + +**Complexity:** O(1) + +**Since:** 6.2.0 + +
+ +
+BLMPOP - Pops the first element from one of multiple lists. Blocks until an element is available otherwise. Deletes the list if the last element was popped. + +**Syntax:** `BLMPOP timeout numkeys key [key ...] [COUNT count]` + +**Description:** Pops the first element from one of multiple lists. Blocks until an element is available otherwise. Deletes the list if the last element was popped. + +**Complexity:** O(N+M) where N is the number of provided keys and M is the number of elements returned. + +**Since:** 7.0.0 + +
+ +
+BLPOP - Removes and returns the first element in a list. Blocks until an element is available otherwise. Deletes the list if the last element was popped. + +**Syntax:** `BLPOP key [key ...] timeout` + +**Description:** Removes and returns the first element in a list. Blocks until an element is available otherwise. Deletes the list if the last element was popped. + +**Complexity:** O(N) where N is the number of provided keys. + +**Since:** 2.0.0 + +
+ +
+BRPOP - Removes and returns the last element in a list. Blocks until an element is available otherwise. Deletes the list if the last element was popped. + +**Syntax:** `BRPOP key [key ...] timeout` + +**Description:** Removes and returns the last element in a list. Blocks until an element is available otherwise. Deletes the list if the last element was popped. + +**Complexity:** O(N) where N is the number of provided keys. + +**Since:** 2.0.0 + +
+ +
+BRPOPLPUSH - Pops an element from a list, pushes it to another list and returns it. Block until an element is available otherwise. Deletes the list if the last element was popped. + +**Syntax:** `BRPOPLPUSH source destination timeout` + +**Description:** Pops an element from a list, pushes it to another list and returns it. Block until an element is available otherwise. Deletes the list if the last element was popped. + +**Complexity:** O(1) + +**Since:** 2.2.0 + +
+ +
+LINDEX - Returns an element from a list by its index. + +**Syntax:** `LINDEX key index` + +**Description:** Returns an element from a list by its index. + +**Complexity:** O(N) where N is the number of elements to traverse to get to the element at index. This makes asking for the first or the last element of the list O(1). + +**Since:** 1.0.0 + +
+ +
+LINSERT - Inserts an element before or after another element in a list. + +**Syntax:** `LINSERT key pivot element` + +**Description:** Inserts an element before or after another element in a list. + +**Complexity:** O(N) where N is the number of elements to traverse before seeing the value pivot. This means that inserting somewhere on the left end on the list (head) can be considered O(1) and inserting somewhere on the right end (tail) is O(N). + +**Since:** 2.2.0 + +
+ +
+LLEN - Returns the length of a list. + +**Syntax:** `LLEN key` + +**Description:** Returns the length of a list. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+LMOVE - Returns an element after popping it from one list and pushing it to another. Deletes the list if the last element was moved. + +**Syntax:** `LMOVE source destination ` + +**Description:** Returns an element after popping it from one list and pushing it to another. Deletes the list if the last element was moved. + +**Complexity:** O(1) + +**Since:** 6.2.0 + +
+ +
+LMPOP - Returns multiple elements from a list after removing them. Deletes the list if the last element was popped. + +**Syntax:** `LMPOP numkeys key [key ...] [COUNT count]` + +**Description:** Returns multiple elements from a list after removing them. Deletes the list if the last element was popped. + +**Complexity:** O(N+M) where N is the number of provided keys and M is the number of elements returned. + +**Since:** 7.0.0 + +
+ +
+LPOP - Returns the first elements in a list after removing it. Deletes the list if the last element was popped. + +**Syntax:** `LPOP key [count]` + +**Description:** Returns the first elements in a list after removing it. Deletes the list if the last element was popped. + +**Complexity:** O(N) where N is the number of elements returned + +**Since:** 1.0.0 + +
+ +
+LPOS - Returns the index of matching elements in a list. + +**Syntax:** `LPOS key element [RANK rank] [COUNT num-matches] [MAXLEN len]` + +**Description:** Returns the index of matching elements in a list. + +**Complexity:** O(N) where N is the number of elements in the list, for the average case. When searching for elements near the head or the tail of the list, or when the MAXLEN option is provided, the command may run in constant time. + +**Since:** 6.0.6 + +
+ +
+LPUSH - Prepends one or more elements to a list. Creates the key if it doesn't exist. + +**Syntax:** `LPUSH key element [element ...]` + +**Description:** Prepends one or more elements to a list. Creates the key if it doesn't exist. + +**Complexity:** O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments. + +**Since:** 1.0.0 + +
+ +
+LPUSHX - Prepends one or more elements to a list only when the list exists. + +**Syntax:** `LPUSHX key element [element ...]` + +**Description:** Prepends one or more elements to a list only when the list exists. + +**Complexity:** O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments. + +**Since:** 2.2.0 + +
+ +
+LRANGE - Returns a range of elements from a list. + +**Syntax:** `LRANGE key start stop` + +**Description:** Returns a range of elements from a list. + +**Complexity:** O(S+N) where S is the distance of start offset from HEAD for small lists, from nearest end (HEAD or TAIL) for large lists; and N is the number of elements in the specified range. + +**Since:** 1.0.0 + +
+ +
+LREM - Removes elements from a list. Deletes the list if the last element was removed. + +**Syntax:** `LREM key count element` + +**Description:** Removes elements from a list. Deletes the list if the last element was removed. + +**Complexity:** O(N+M) where N is the length of the list and M is the number of elements removed. + +**Since:** 1.0.0 + +
+ +
+LSET - Sets the value of an element in a list by its index. + +**Syntax:** `LSET key index element` + +**Description:** Sets the value of an element in a list by its index. + +**Complexity:** O(N) where N is the length of the list. Setting either the first or the last element of the list is O(1). + +**Since:** 1.0.0 + +
+ +
+LTRIM - Removes elements from both ends a list. Deletes the list if all elements were trimmed. + +**Syntax:** `LTRIM key start stop` + +**Description:** Removes elements from both ends a list. Deletes the list if all elements were trimmed. + +**Complexity:** O(N) where N is the number of elements to be removed by the operation. + +**Since:** 1.0.0 + +
+ +
+RPOP - Returns and removes the last elements of a list. Deletes the list if the last element was popped. + +**Syntax:** `RPOP key [count]` + +**Description:** Returns and removes the last elements of a list. Deletes the list if the last element was popped. + +**Complexity:** O(N) where N is the number of elements returned + +**Since:** 1.0.0 + +
+ +
+RPOPLPUSH - Returns the last element of a list after removing and pushing it to another list. Deletes the list if the last element was popped. + +**Syntax:** `RPOPLPUSH source destination` + +**Description:** Returns the last element of a list after removing and pushing it to another list. Deletes the list if the last element was popped. + +**Complexity:** O(1) + +**Since:** 1.2.0 + +
+ +
+RPUSH - Appends one or more elements to a list. Creates the key if it doesn't exist. + +**Syntax:** `RPUSH key element [element ...]` + +**Description:** Appends one or more elements to a list. Creates the key if it doesn't exist. + +**Complexity:** O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments. + +**Since:** 1.0.0 + +
+ +
+RPUSHX - Appends an element to a list only when the list exists. + +**Syntax:** `RPUSHX key element [element ...]` + +**Description:** Appends an element to a list only when the list exists. + +**Complexity:** O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments. + +**Since:** 2.2.0 + +
+ + +## Set commands + +Set commands operate on unordered collections of unique strings. + +
+SADD - Adds one or more members to a set. Creates the key if it doesn't exist. + +**Syntax:** `SADD key member [member ...]` + +**Description:** Adds one or more members to a set. Creates the key if it doesn't exist. + +**Complexity:** O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments. + +**Since:** 1.0.0 + +
+ +
+SCARD - Returns the number of members in a set. + +**Syntax:** `SCARD key` + +**Description:** Returns the number of members in a set. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+SDIFF - Returns the difference of multiple sets. + +**Syntax:** `SDIFF key [key ...]` + +**Description:** Returns the difference of multiple sets. + +**Complexity:** O(N) where N is the total number of elements in all given sets. + +**Since:** 1.0.0 + +
+ +
+SDIFFSTORE - Stores the difference of multiple sets in a key. + +**Syntax:** `SDIFFSTORE destination key [key ...]` + +**Description:** Stores the difference of multiple sets in a key. + +**Complexity:** O(N) where N is the total number of elements in all given sets. + +**Since:** 1.0.0 + +
+ +
+SINTER - Returns the intersect of multiple sets. + +**Syntax:** `SINTER key [key ...]` + +**Description:** Returns the intersect of multiple sets. + +**Complexity:** O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets. + +**Since:** 1.0.0 + +
+ +
+SINTERCARD - Returns the number of members of the intersect of multiple sets. + +**Syntax:** `SINTERCARD numkeys key [key ...] [LIMIT limit]` + +**Description:** Returns the number of members of the intersect of multiple sets. + +**Complexity:** O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets. + +**Since:** 7.0.0 + +
+ +
+SINTERSTORE - Stores the intersect of multiple sets in a key. + +**Syntax:** `SINTERSTORE destination key [key ...]` + +**Description:** Stores the intersect of multiple sets in a key. + +**Complexity:** O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets. + +**Since:** 1.0.0 + +
+ +
+SISMEMBER - Determines whether a member belongs to a set. + +**Syntax:** `SISMEMBER key member` + +**Description:** Determines whether a member belongs to a set. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+SMEMBERS - Returns all members of a set. + +**Syntax:** `SMEMBERS key` + +**Description:** Returns all members of a set. + +**Complexity:** O(N) where N is the set cardinality. + +**Since:** 1.0.0 + +
+ +
+SMISMEMBER - Determines whether multiple members belong to a set. + +**Syntax:** `SMISMEMBER key member [member ...]` + +**Description:** Determines whether multiple members belong to a set. + +**Complexity:** O(N) where N is the number of elements being checked for membership + +**Since:** 6.2.0 + +
+ +
+SMOVE - Moves a member from one set to another. + +**Syntax:** `SMOVE source destination member` + +**Description:** Moves a member from one set to another. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+SPOP - Returns one or more random members from a set after removing them. Deletes the set if the last member was popped. + +**Syntax:** `SPOP key [count]` + +**Description:** Returns one or more random members from a set after removing them. Deletes the set if the last member was popped. + +**Complexity:** Without the count argument O(1), otherwise O(N) where N is the value of the passed count. + +**Since:** 1.0.0 + +
+ +
+SRANDMEMBER - Get one or multiple random members from a set + +**Syntax:** `SRANDMEMBER key [count]` + +**Description:** Get one or multiple random members from a set + +**Complexity:** Without the count argument O(1), otherwise O(N) where N is the absolute value of the passed count. + +**Since:** 1.0.0 + +
+ +
+SREM - Removes one or more members from a set. Deletes the set if the last member was removed. + +**Syntax:** `SREM key member [member ...]` + +**Description:** Removes one or more members from a set. Deletes the set if the last member was removed. + +**Complexity:** O(N) where N is the number of members to be removed. + +**Since:** 1.0.0 + +
+ +
+SSCAN - Iterates over members of a set. + +**Syntax:** `SSCAN key cursor [MATCH pattern] [COUNT count]` + +**Description:** Iterates over members of a set. + +**Complexity:** O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection. + +**Since:** 2.8.0 + +
+ +
+SUNION - Returns the union of multiple sets. + +**Syntax:** `SUNION key [key ...]` + +**Description:** Returns the union of multiple sets. + +**Complexity:** O(N) where N is the total number of elements in all given sets. + +**Since:** 1.0.0 + +
+ +
+SUNIONSTORE - Stores the union of multiple sets in a key. + +**Syntax:** `SUNIONSTORE destination key [key ...]` + +**Description:** Stores the union of multiple sets in a key. + +**Complexity:** O(N) where N is the total number of elements in all given sets. + +**Since:** 1.0.0 + +
+ + +## Sorted set commands + +Sorted set commands operate on sets of unique strings ordered by a score. + +
+BZMPOP - Removes and returns a member by score from one or more sorted sets. Blocks until a member is available otherwise. Deletes the sorted set if the last element was popped. + +**Syntax:** `BZMPOP timeout numkeys key [key ...] [COUNT count]` + +**Description:** Removes and returns a member by score from one or more sorted sets. Blocks until a member is available otherwise. Deletes the sorted set if the last element was popped. + +**Complexity:** O(K) + O(M*log(N)) where K is the number of provided keys, N being the number of elements in the sorted set, and M being the number of elements popped. + +**Since:** 7.0.0 + +
+ +
+BZPOPMAX - Removes and returns the member with the highest score from one or more sorted sets. Blocks until a member available otherwise. Deletes the sorted set if the last element was popped. + +**Syntax:** `BZPOPMAX key [key ...] timeout` + +**Description:** Removes and returns the member with the highest score from one or more sorted sets. Blocks until a member available otherwise. Deletes the sorted set if the last element was popped. + +**Complexity:** O(log(N)) with N being the number of elements in the sorted set. + +**Since:** 5.0.0 + +
+ +
+BZPOPMIN - Removes and returns the member with the lowest score from one or more sorted sets. Blocks until a member is available otherwise. Deletes the sorted set if the last element was popped. + +**Syntax:** `BZPOPMIN key [key ...] timeout` + +**Description:** Removes and returns the member with the lowest score from one or more sorted sets. Blocks until a member is available otherwise. Deletes the sorted set if the last element was popped. + +**Complexity:** O(log(N)) with N being the number of elements in the sorted set. + +**Since:** 5.0.0 + +
+ +
+ZADD - Adds one or more members to a sorted set, or updates their scores. Creates the key if it doesn't exist. + +**Syntax:** `ZADD key [NX | XX] [GT | LT] [CH] [INCR] score member [score member + ...]` + +**Description:** Adds one or more members to a sorted set, or updates their scores. Creates the key if it doesn't exist. + +**Complexity:** O(log(N)) for each item added, where N is the number of elements in the sorted set. + +**Since:** 1.2.0 + +
+ +
+ZCARD - Returns the number of members in a sorted set. + +**Syntax:** `ZCARD key` + +**Description:** Returns the number of members in a sorted set. + +**Complexity:** O(1) + +**Since:** 1.2.0 + +
+ +
+ZCOUNT - Returns the count of members in a sorted set that have scores within a range. + +**Syntax:** `ZCOUNT key min max` + +**Description:** Returns the count of members in a sorted set that have scores within a range. + +**Complexity:** O(log(N)) with N being the number of elements in the sorted set. + +**Since:** 2.0.0 + +
+ +
+ZDIFF - Returns the difference between multiple sorted sets. + +**Syntax:** `ZDIFF numkeys key [key ...] [WITHSCORES]` + +**Description:** Returns the difference between multiple sorted sets. + +**Complexity:** O(L + (N-K)log(N)) worst case where L is the total number of elements in all the sets, N is the size of the first set, and K is the size of the result set. + +**Since:** 6.2.0 + +
+ +
+ZDIFFSTORE - Stores the difference of multiple sorted sets in a key. + +**Syntax:** `ZDIFFSTORE destination numkeys key [key ...]` + +**Description:** Stores the difference of multiple sorted sets in a key. + +**Complexity:** O(L + (N-K)log(N)) worst case where L is the total number of elements in all the sets, N is the size of the first set, and K is the size of the result set. + +**Since:** 6.2.0 + +
+ +
+ZINCRBY - Increments the score of a member in a sorted set. + +**Syntax:** `ZINCRBY key increment member` + +**Description:** Increments the score of a member in a sorted set. + +**Complexity:** O(log(N)) where N is the number of elements in the sorted set. + +**Since:** 1.2.0 + +
+ +
+ZINTER - Returns the intersect of multiple sorted sets. + +**Syntax:** `ZINTER numkeys key [key ...] [WEIGHTS weight [weight ...]] + [AGGREGATE ] [WITHSCORES]` + +**Description:** Returns the intersect of multiple sorted sets. + +**Complexity:** O(N*K)+O(M*log(M)) worst case with N being the smallest input sorted set, K being the number of input sorted sets and M being the number of elements in the resulting sorted set. + +**Since:** 6.2.0 + +
+ +
+ZINTERCARD - Returns the number of members of the intersect of multiple sorted sets. + +**Syntax:** `ZINTERCARD numkeys key [key ...] [LIMIT limit]` + +**Description:** Returns the number of members of the intersect of multiple sorted sets. + +**Complexity:** O(N*K) worst case with N being the smallest input sorted set, K being the number of input sorted sets. + +**Since:** 7.0.0 + +
+ +
+ZINTERSTORE - Stores the intersect of multiple sorted sets in a key. + +**Syntax:** `ZINTERSTORE destination numkeys key [key ...] [WEIGHTS weight + [weight ...]] [AGGREGATE ]` + +**Description:** Stores the intersect of multiple sorted sets in a key. + +**Complexity:** O(N*K)+O(M*log(M)) worst case with N being the smallest input sorted set, K being the number of input sorted sets and M being the number of elements in the resulting sorted set. + +**Since:** 2.0.0 + +
+ +
+ZLEXCOUNT - Returns the number of members in a sorted set within a lexicographical range. + +**Syntax:** `ZLEXCOUNT key min max` + +**Description:** Returns the number of members in a sorted set within a lexicographical range. + +**Complexity:** O(log(N)) with N being the number of elements in the sorted set. + +**Since:** 2.8.9 + +
+ +
+ZMPOP - Returns the highest- or lowest-scoring members from one or more sorted sets after removing them. Deletes the sorted set if the last member was popped. + +**Syntax:** `ZMPOP numkeys key [key ...] [COUNT count]` + +**Description:** Returns the highest- or lowest-scoring members from one or more sorted sets after removing them. Deletes the sorted set if the last member was popped. + +**Complexity:** O(K) + O(M*log(N)) where K is the number of provided keys, N being the number of elements in the sorted set, and M being the number of elements popped. + +**Since:** 7.0.0 + +
+ +
+ZMSCORE - Returns the score of one or more members in a sorted set. + +**Syntax:** `ZMSCORE key member [member ...]` + +**Description:** Returns the score of one or more members in a sorted set. + +**Complexity:** O(N) where N is the number of members being requested. + +**Since:** 6.2.0 + +
+ +
+ZPOPMAX - Returns the highest-scoring members from a sorted set after removing them. Deletes the sorted set if the last member was popped. + +**Syntax:** `ZPOPMAX key [count]` + +**Description:** Returns the highest-scoring members from a sorted set after removing them. Deletes the sorted set if the last member was popped. + +**Complexity:** O(log(N)*M) with N being the number of elements in the sorted set, and M being the number of elements popped. + +**Since:** 5.0.0 + +
+ +
+ZPOPMIN - Returns the lowest-scoring members from a sorted set after removing them. Deletes the sorted set if the last member was popped. + +**Syntax:** `ZPOPMIN key [count]` + +**Description:** Returns the lowest-scoring members from a sorted set after removing them. Deletes the sorted set if the last member was popped. + +**Complexity:** O(log(N)*M) with N being the number of elements in the sorted set, and M being the number of elements popped. + +**Since:** 5.0.0 + +
+ +
+ZRANDMEMBER - Returns one or more random members from a sorted set. + +**Syntax:** `ZRANDMEMBER key [count [WITHSCORES]]` + +**Description:** Returns one or more random members from a sorted set. + +**Complexity:** O(N) where N is the number of members returned + +**Since:** 6.2.0 + +
+ +
+ZRANGE - Returns members in a sorted set within a range of indexes. + +**Syntax:** `ZRANGE key start stop [BYSCORE | BYLEX] [REV] [LIMIT offset count] + [WITHSCORES]` + +**Description:** Returns members in a sorted set within a range of indexes. + +**Complexity:** O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements returned. + +**Since:** 1.2.0 + +
+ +
+ZRANGEBYLEX - Returns members in a sorted set within a lexicographical range. + +**Syntax:** `ZRANGEBYLEX key min max [LIMIT offset count]` + +**Description:** Returns members in a sorted set within a lexicographical range. + +**Complexity:** O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)). + +**Since:** 2.8.9 + +
+ +
+ZRANGEBYSCORE - Returns members in a sorted set within a range of scores. + +**Syntax:** `ZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count]` + +**Description:** Returns members in a sorted set within a range of scores. + +**Complexity:** O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)). + +**Since:** 1.0.5 + +
+ +
+ZRANGESTORE - Stores a range of members from sorted set in a key. + +**Syntax:** `ZRANGESTORE dst src min max [BYSCORE | BYLEX] [REV] [LIMIT offset + count]` + +**Description:** Stores a range of members from sorted set in a key. + +**Complexity:** O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements stored into the destination key. + +**Since:** 6.2.0 + +
+ +
+ZRANK - Returns the index of a member in a sorted set ordered by ascending scores. + +**Syntax:** `ZRANK key member [WITHSCORE]` + +**Description:** Returns the index of a member in a sorted set ordered by ascending scores. + +**Complexity:** O(log(N)) + +**Since:** 2.0.0 + +
+ +
+ZREM - Removes one or more members from a sorted set. Deletes the sorted set if all members were removed. + +**Syntax:** `ZREM key member [member ...]` + +**Description:** Removes one or more members from a sorted set. Deletes the sorted set if all members were removed. + +**Complexity:** O(M*log(N)) with N being the number of elements in the sorted set and M the number of elements to be removed. + +**Since:** 1.2.0 + +
+ +
+ZREMRANGEBYLEX - Removes members in a sorted set within a lexicographical range. Deletes the sorted set if all members were removed. + +**Syntax:** `ZREMRANGEBYLEX key min max` + +**Description:** Removes members in a sorted set within a lexicographical range. Deletes the sorted set if all members were removed. + +**Complexity:** O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements removed by the operation. + +**Since:** 2.8.9 + +
+ +
+ZREMRANGEBYRANK - Removes members in a sorted set within a range of indexes. Deletes the sorted set if all members were removed. + +**Syntax:** `ZREMRANGEBYRANK key start stop` + +**Description:** Removes members in a sorted set within a range of indexes. Deletes the sorted set if all members were removed. + +**Complexity:** O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements removed by the operation. + +**Since:** 2.0.0 + +
+ +
+ZREMRANGEBYSCORE - Removes members in a sorted set within a range of scores. Deletes the sorted set if all members were removed. + +**Syntax:** `ZREMRANGEBYSCORE key min max` + +**Description:** Removes members in a sorted set within a range of scores. Deletes the sorted set if all members were removed. + +**Complexity:** O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements removed by the operation. + +**Since:** 1.2.0 + +
+ +
+ZREVRANGE - Returns members in a sorted set within a range of indexes in reverse order. + +**Syntax:** `ZREVRANGE key start stop [WITHSCORES]` + +**Description:** Returns members in a sorted set within a range of indexes in reverse order. + +**Complexity:** O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements returned. + +**Since:** 1.2.0 + +
+ +
+ZREVRANGEBYLEX - Returns members in a sorted set within a lexicographical range in reverse order. + +**Syntax:** `ZREVRANGEBYLEX key max min [LIMIT offset count]` + +**Description:** Returns members in a sorted set within a lexicographical range in reverse order. + +**Complexity:** O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)). + +**Since:** 2.8.9 + +
+ +
+ZREVRANGEBYSCORE - Returns members in a sorted set within a range of scores in reverse order. + +**Syntax:** `ZREVRANGEBYSCORE key max min [WITHSCORES] [LIMIT offset count]` + +**Description:** Returns members in a sorted set within a range of scores in reverse order. + +**Complexity:** O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)). + +**Since:** 2.2.0 + +
+ +
+ZREVRANK - Returns the index of a member in a sorted set ordered by descending scores. + +**Syntax:** `ZREVRANK key member [WITHSCORE]` + +**Description:** Returns the index of a member in a sorted set ordered by descending scores. + +**Complexity:** O(log(N)) + +**Since:** 2.0.0 + +
+ +
+ZSCAN - Iterates over members and scores of a sorted set. + +**Syntax:** `ZSCAN key cursor [MATCH pattern] [COUNT count]` + +**Description:** Iterates over members and scores of a sorted set. + +**Complexity:** O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection. + +**Since:** 2.8.0 + +
+ +
+ZSCORE - Returns the score of a member in a sorted set. + +**Syntax:** `ZSCORE key member` + +**Description:** Returns the score of a member in a sorted set. + +**Complexity:** O(1) + +**Since:** 1.2.0 + +
+ +
+ZUNION - Returns the union of multiple sorted sets. + +**Syntax:** `ZUNION numkeys key [key ...] [WEIGHTS weight [weight ...]] + [AGGREGATE ] [WITHSCORES]` + +**Description:** Returns the union of multiple sorted sets. + +**Complexity:** O(N)+O(M*log(M)) with N being the sum of the sizes of the input sorted sets, and M being the number of elements in the resulting sorted set. + +**Since:** 6.2.0 + +
+ +
+ZUNIONSTORE - Stores the union of multiple sorted sets in a key. + +**Syntax:** `ZUNIONSTORE destination numkeys key [key ...] [WEIGHTS weight + [weight ...]] [AGGREGATE ]` + +**Description:** Stores the union of multiple sorted sets in a key. + +**Complexity:** O(N)+O(M log(M)) with N being the sum of the sizes of the input sorted sets, and M being the number of elements in the resulting sorted set. + +**Since:** 2.0.0 + +
+ + +## Stream commands + +Stream commands operate on append-only log data structures. + +
+XACK - Returns the number of messages that were successfully acknowledged by the consumer group member of a stream. + +**Syntax:** `XACK key group id [id ...]` + +**Description:** Returns the number of messages that were successfully acknowledged by the consumer group member of a stream. + +**Complexity:** O(1) for each message ID processed. + +**Since:** 5.0.0 + +
+ +
+XACKDEL - Acknowledges and conditionally deletes one or multiple entries for a stream consumer group. + +**Syntax:** `XACKDEL key group [KEEPREF | DELREF | ACKED] IDS numids id [id ...]` + +**Description:** Acknowledges and conditionally deletes one or multiple entries for a stream consumer group. + +**Complexity:** O(1) for each entry ID processed. + +**Since:** 8.2.0 + +
+ +
+XADD - Appends a new message to a stream. Creates the key if it doesn't exist. + +**Syntax:** `XADD key [NOMKSTREAM] [KEEPREF | DELREF | ACKED] + [IDMPAUTO producer-id | IDMP producer-id idempotent-id] + [ [= | ~] threshold [LIMIT count]] <* | id> + field value [field value ...]` + +**Description:** Appends a new message to a stream. Creates the key if it doesn't exist. + +**Complexity:** O(1) when adding a new entry, O(N) when trimming where N being the number of entries evicted. + +**Since:** 5.0.0 + +
+ +
+XAUTOCLAIM - Changes, or acquires, ownership of messages in a consumer group, as if the messages were delivered to as consumer group member. + +**Syntax:** `XAUTOCLAIM key group consumer min-idle-time start [COUNT count] + [JUSTID]` + +**Description:** Changes, or acquires, ownership of messages in a consumer group, as if the messages were delivered to as consumer group member. + +**Complexity:** O(1) if COUNT is small. + +**Since:** 6.2.0 + +
+ +
+XCFGSET - Sets the IDMP configuration parameters for a stream. + +**Syntax:** `XCFGSET key [IDMP-DURATION idmp-duration] + [IDMP-MAXSIZE idmp-maxsize]` + +**Description:** Sets the IDMP configuration parameters for a stream. + +**Complexity:** O(1) + +**Since:** 8.6.0 + +
+ +
+XCLAIM - Changes, or acquires, ownership of a message in a consumer group, as if the message was delivered a consumer group member. + +**Syntax:** `XCLAIM key group consumer min-idle-time id [id ...] [IDLE ms] + [TIME unix-time-milliseconds] [RETRYCOUNT count] [FORCE] [JUSTID] + [LASTID lastid]` + +**Description:** Changes, or acquires, ownership of a message in a consumer group, as if the message was delivered a consumer group member. + +**Complexity:** O(log N) with N being the number of messages in the PEL of the consumer group. + +**Since:** 5.0.0 + +
+ +
+XDEL - Returns the number of messages after removing them from a stream. + +**Syntax:** `XDEL key id [id ...]` + +**Description:** Returns the number of messages after removing them from a stream. + +**Complexity:** O(1) for each single item to delete in the stream, regardless of the stream size. + +**Since:** 5.0.0 + +
+ +
+XDELEX - Deletes one or multiple entries from the stream. + +**Syntax:** `XDELEX key [KEEPREF | DELREF | ACKED] IDS numids id [id ...]` + +**Description:** Deletes one or multiple entries from the stream. + +**Complexity:** O(1) for each single item to delete in the stream, regardless of the stream size. + +**Since:** 8.2.0 + +
+ +
+XGROUP CREATE - Creates a consumer group. + +**Syntax:** `XGROUP CREATE key group [MKSTREAM] + [ENTRIESREAD entries-read]` + +**Description:** Creates a consumer group. + +**Complexity:** O(1) + +**Since:** 5.0.0 + +
+ +
+XGROUP CREATECONSUMER - Creates a consumer in a consumer group. + +**Syntax:** `XGROUP CREATECONSUMER key group consumer` + +**Description:** Creates a consumer in a consumer group. + +**Complexity:** O(1) + +**Since:** 6.2.0 + +
+ +
+XGROUP DELCONSUMER - Deletes a consumer from a consumer group. + +**Syntax:** `XGROUP DELCONSUMER key group consumer` + +**Description:** Deletes a consumer from a consumer group. + +**Complexity:** O(1) + +**Since:** 5.0.0 + +
+ +
+XGROUP DESTROY - Destroys a consumer group. + +**Syntax:** `XGROUP DESTROY key group` + +**Description:** Destroys a consumer group. + +**Complexity:** O(N) where N is the number of entries in the group's pending entries list (PEL). + +**Since:** 5.0.0 + +
+ +
+XGROUP SETID - Sets the last-delivered ID of a consumer group. + +**Syntax:** `XGROUP SETID key group [ENTRIESREAD entries-read]` + +**Description:** Sets the last-delivered ID of a consumer group. + +**Complexity:** O(1) + +**Since:** 5.0.0 + +
+ +
+XIDMPRECORD - An internal command for setting IDMP metadata on an existing stream message. ⭐ New in 8.8 + +**Syntax:** `XIDMPRECORD key pid iid stream-id` + +**Description:** An internal command for setting IDMP metadata on an existing stream message. + +**Complexity:** O(1) + +**Since:** 8.8.0 + +
+ +
+XINFO CONSUMERS - Returns a list of the consumers in a consumer group. + +**Syntax:** `XINFO CONSUMERS key group` + +**Description:** Returns a list of the consumers in a consumer group. + +**Complexity:** O(1) + +**Since:** 5.0.0 + +
+ +
+XINFO GROUPS - Returns a list of the consumer groups of a stream. + +**Syntax:** `XINFO GROUPS key` + +**Description:** Returns a list of the consumer groups of a stream. + +**Complexity:** O(1) + +**Since:** 5.0.0 + +
+ +
+XINFO STREAM - Returns information about a stream. + +**Syntax:** `XINFO STREAM key [FULL [COUNT count]]` + +**Description:** Returns information about a stream. + +**Complexity:** O(1) + +**Since:** 5.0.0 + +
+ +
+XLEN - Return the number of messages in a stream. + +**Syntax:** `XLEN key` + +**Description:** Return the number of messages in a stream. + +**Complexity:** O(1) + +**Since:** 5.0.0 + +
+ +
+XNACK - Releases pending messages back to the group's PEL without acknowledging them, making them available for re-delivery. ⭐ New in 8.8 + +**Syntax:** `XNACK key group IDS numids id [id ...] + [RETRYCOUNT count] [FORCE]` + +**Description:** Releases pending messages back to the group's PEL without acknowledging them, making them available for re-delivery. + +**Complexity:** O(1) for each message ID processed. + +**Since:** 8.8.0 + +
+ +
+XPENDING - Returns the information and entries from a stream consumer group's pending entries list. + +**Syntax:** `XPENDING key group [[IDLE min-idle-time] start end count [consumer]]` + +**Description:** Returns the information and entries from a stream consumer group's pending entries list. + +**Complexity:** O(N) with N being the number of elements returned, so asking for a small fixed number of entries per call is O(1). O(M), where M is the total number of entries scanned when used with the IDLE filter. When the command returns just the summary and the list of consumers is small, it runs in O(1) time; otherwise, an additional O(N) time for iterating every consumer. + +**Since:** 5.0.0 + +
+ +
+XRANGE - Returns the messages from a stream within a range of IDs. + +**Syntax:** `XRANGE key start end [COUNT count]` + +**Description:** Returns the messages from a stream within a range of IDs. + +**Complexity:** O(N) with N being the number of elements being returned. If N is constant (e.g. always asking for the first 10 elements with COUNT), you can consider it O(1). + +**Since:** 5.0.0 + +
+ +
+XREAD - Returns messages from multiple streams with IDs greater than the ones requested. Blocks until a message is available otherwise. + +**Syntax:** `XREAD [COUNT count] [BLOCK milliseconds] STREAMS key [key ...] id + [id ...]` + +**Description:** Returns messages from multiple streams with IDs greater than the ones requested. Blocks until a message is available otherwise. + +**Complexity:** For each stream mentioned: O(M) with M being the number of elements returned. If M is constant (for example, always asking for the first 10 elements with COUNT), you can consider it O(1). On the other side when XREADGROUP blocks, XADD will pay the O(N) time in order to serve the N clients blocked on the stream getting new data. + +**Since:** 5.0.0 + +
+ +
+XREADGROUP - Returns new or historical messages from a stream for a consumer in a group. Blocks until a message is available otherwise. + +**Syntax:** `XREADGROUP GROUP group consumer [COUNT count] [BLOCK milliseconds] + [CLAIM min-idle-time] [NOACK] STREAMS key [key ...] id [id ...]` + +**Description:** Returns new or historical messages from a stream for a consumer in a group. Blocks until a message is available otherwise. + +**Complexity:** For each stream mentioned: O(M) with M being the number of elements returned. If M is constant (e.g. always asking for the first 10 elements with COUNT), you can consider it O(1). On the other side when XREADGROUP blocks, XADD will pay the O(N) time in order to serve the N clients blocked on the stream getting new data. + +**Since:** 5.0.0 + +
+ +
+XREVRANGE - Returns the messages from a stream within a range of IDs in reverse order. + +**Syntax:** `XREVRANGE key end start [COUNT count]` + +**Description:** Returns the messages from a stream within a range of IDs in reverse order. + +**Complexity:** O(N) with N being the number of elements returned. If N is constant (e.g. always asking for the first 10 elements with COUNT), you can consider it O(1). + +**Since:** 5.0.0 + +
+ +
+XSETID - An internal command for replicating stream values. + +**Syntax:** `XSETID key last-id [ENTRIESADDED entries-added] + [MAXDELETEDID max-deleted-id]` + +**Description:** An internal command for replicating stream values. + +**Complexity:** O(1) + +**Since:** 5.0.0 + +
+ +
+XTRIM - Deletes messages from the beginning of a stream. + +**Syntax:** `XTRIM key [= | ~] threshold [LIMIT count] [KEEPREF | DELREF | ACKED]` + +**Description:** Deletes messages from the beginning of a stream. + +**Complexity:** O(N), with N being the number of evicted entries. Constant times are very small however, since entries are organized in macro nodes containing multiple entries that can be released with a single deallocation. + +**Since:** 5.0.0 + +
+ + +## Bitmap commands + +Bitmap commands operate on strings as arrays of bits. + +
+BITCOUNT - Counts the number of set bits (population counting) in a string. + +**Syntax:** `BITCOUNT key [start end [BYTE | BIT]]` + +**Description:** Counts the number of set bits (population counting) in a string. + +**Complexity:** O(N) + +**Since:** 2.6.0 + +
+ +
+BITFIELD - Performs arbitrary bitfield integer operations on strings. + +**Syntax:** `BITFIELD key [GET encoding offset | [OVERFLOW ] + + [GET encoding offset | [OVERFLOW ] + + ...]]` + +**Description:** Performs arbitrary bitfield integer operations on strings. + +**Complexity:** O(1) for each subcommand specified + +**Since:** 3.2.0 + +
+ +
+BITFIELD_RO - Performs arbitrary read-only bitfield integer operations on strings. + +**Syntax:** `BITFIELD RO key [GET encoding offset [GET encoding offset ...]]` + +**Description:** Performs arbitrary read-only bitfield integer operations on strings. + +**Complexity:** O(1) for each subcommand specified + +**Since:** 6.0.0 + +
+ +
+BITOP - Performs bitwise operations on multiple strings, and stores the result. + +**Syntax:** `BITOP destkey key [key ...]` + +**Description:** Performs bitwise operations on multiple strings, and stores the result. + +**Complexity:** O(N) + +**Since:** 2.6.0 + +
+ +
+BITPOS - Finds the first set (1) or clear (0) bit in a string. + +**Syntax:** `BITPOS key bit [start [end [BYTE | BIT]]]` + +**Description:** Finds the first set (1) or clear (0) bit in a string. + +**Complexity:** O(N) + +**Since:** 2.8.7 + +
+ +
+GETBIT - Returns a bit value by offset. + +**Syntax:** `GETBIT key offset` + +**Description:** Returns a bit value by offset. + +**Complexity:** O(1) + +**Since:** 2.2.0 + +
+ +
+SETBIT - Sets or clears the bit at offset of the string value. Creates the key if it doesn't exist. + +**Syntax:** `SETBIT key offset value` + +**Description:** Sets or clears the bit at offset of the string value. Creates the key if it doesn't exist. + +**Complexity:** O(1) + +**Since:** 2.2.0 + +
+ + +## Array commands + +Array commands operate on arrays of strings. + +
+ARCOUNT - Returns the number of non-empty elements in an array. ⭐ New in 8.8 + +**Syntax:** `ARCOUNT key` + +**Description:** Returns the number of non-empty elements in an array. + +**Complexity:** O(1) + +**Since:** 8.8.0 + +
+ +
+ARDEL - Deletes elements at the specified indices in an array. ⭐ New in 8.8 + +**Syntax:** `ARDEL key index [index ...]` + +**Description:** Deletes elements at the specified indices in an array. + +**Complexity:** O(N) where N is the number of indices to delete + +**Since:** 8.8.0 + +
+ +
+ARDELRANGE - Deletes elements in one or more ranges. ⭐ New in 8.8 + +**Syntax:** `ARDELRANGE key start end [start end ...]` + +**Description:** Deletes elements in one or more ranges. + +**Complexity:** Proportional to the number of existing elements / slices touched, not to the numeric span of the requested ranges + +**Since:** 8.8.0 + +
+ +
+ARGET - Gets the value at an index in an array. ⭐ New in 8.8 + +**Syntax:** `ARGET key index` + +**Description:** Gets the value at an index in an array. + +**Complexity:** O(1) + +**Since:** 8.8.0 + +
+ +
+ARGETRANGE - Gets values in a range of indices. ⭐ New in 8.8 + +**Syntax:** `ARGETRANGE key start end` + +**Description:** Gets values in a range of indices. + +**Complexity:** O(N) where N is the range length + +**Since:** 8.8.0 + +
+ +
+ARGREP - Searches array elements in a range using textual predicates. ⭐ New in 8.8 + +**Syntax:** `ARGREP key start end + + [AND | OR | LIMIT limit | WITHVALUES | NOCASE [...]]` + +**Description:** Searches array elements in a range using textual predicates. + +**Complexity:** O(P * C) where P is the number of visited positions in touched slices and C is the cost of evaluating the predicates on one existing element. + +**Since:** 8.8.0 + +
+ +
+ARINFO - Returns metadata about an array. ⭐ New in 8.8 + +**Syntax:** `ARINFO key [FULL]` + +**Description:** Returns metadata about an array. + +**Complexity:** O(1), or O(N) with FULL option where N is the number of slices. + +**Since:** 8.8.0 + +
+ +
+ARINSERT - Inserts one or more values at consecutive indices. ⭐ New in 8.8 + +**Syntax:** `ARINSERT key value [value ...]` + +**Description:** Inserts one or more values at consecutive indices. + +**Complexity:** O(N) where N is the number of values + +**Since:** 8.8.0 + +
+ +
+ARLASTITEMS - Returns the most recently inserted elements. ⭐ New in 8.8 + +**Syntax:** `ARLASTITEMS key count [REV]` + +**Description:** Returns the most recently inserted elements. + +**Complexity:** O(N) where N is the count + +**Since:** 8.8.0 + +
+ +
+ARLEN - Returns the length of an array (max index + 1). ⭐ New in 8.8 + +**Syntax:** `ARLEN key` + +**Description:** Returns the length of an array (max index + 1). + +**Complexity:** O(1) + +**Since:** 8.8.0 + +
+ +
+ARMGET - Gets values at multiple indices in an array. ⭐ New in 8.8 + +**Syntax:** `ARMGET key index [index ...]` + +**Description:** Gets values at multiple indices in an array. + +**Complexity:** O(N) where N is the number of indices + +**Since:** 8.8.0 + +
+ +
+ARMSET - Sets multiple index-value pairs in an array. ⭐ New in 8.8 + +**Syntax:** `ARMSET key index value [index value ...]` + +**Description:** Sets multiple index-value pairs in an array. + +**Complexity:** O(N) where N is the number of pairs + +**Since:** 8.8.0 + +
+ +
+ARNEXT - Returns the next index ARINSERT would use. ⭐ New in 8.8 + +**Syntax:** `ARNEXT key` + +**Description:** Returns the next index ARINSERT would use. + +**Complexity:** O(1) + +**Since:** 8.8.0 + +
+ +
+AROP - Performs aggregate operations on array elements in a range. ⭐ New in 8.8 + +**Syntax:** `AROP key start end ` + +**Description:** Performs aggregate operations on array elements in a range. + +**Complexity:** O(P) where P is visited positions in touched slices (dense scanned slots + sparse entries), with worst-case O(|end-start|+1) and typical case close to O(N), where N is the number of existing elements in range. + +**Since:** 8.8.0 + +
+ +
+ARRING - Inserts values into a ring buffer of specified size, wrapping and truncating as needed. ⭐ New in 8.8 + +**Syntax:** `ARRING key size value [value ...]` + +**Description:** Inserts values into a ring buffer of specified size, wrapping and truncating as needed. + +**Complexity:** O(M) normally, O(N+M) on ring resize, where N is the maximum of the old and new ring size and M is the number of inserted values + +**Since:** 8.8.0 + +
+ +
+ARSCAN - Iterates existing elements in a range, returning index-value pairs. ⭐ New in 8.8 + +**Syntax:** `ARSCAN key start end [LIMIT limit]` + +**Description:** Iterates existing elements in a range, returning index-value pairs. + +**Complexity:** O(P) where P is visited positions in touched slices (dense scanned slots + sparse entries), with worst-case O(|end-start|+1) and typical case close to O(N), where N is the number of existing elements in range. + +**Since:** 8.8.0 + +
+ +
+ARSEEK - Sets the ARINSERT / ARRING cursor to a specific index. ⭐ New in 8.8 + +**Syntax:** `ARSEEK key index` + +**Description:** Sets the ARINSERT / ARRING cursor to a specific index. + +**Complexity:** O(1) + +**Since:** 8.8.0 + +
+ +
+ARSET - Sets one or more contiguous values starting at an index in an array. ⭐ New in 8.8 + +**Syntax:** `ARSET key index value [value ...]` + +**Description:** Sets one or more contiguous values starting at an index in an array. + +**Complexity:** O(N) where N is the number of values + +**Since:** 8.8.0 + +
+ + +## HyperLogLog commands + +HyperLogLog commands provide probabilistic cardinality estimation. + +
+PFADD - Adds elements to a HyperLogLog key. Creates the key if it doesn't exist. + +**Syntax:** `PFADD key [element [element ...]]` + +**Description:** Adds elements to a HyperLogLog key. Creates the key if it doesn't exist. + +**Complexity:** O(1) to add every element. + +**Since:** 2.8.9 + +
+ +
+PFCOUNT - Returns the approximated cardinality of the set(s) observed by the HyperLogLog key(s). + +**Syntax:** `PFCOUNT key [key ...]` + +**Description:** Returns the approximated cardinality of the set(s) observed by the HyperLogLog key(s). + +**Complexity:** O(1) with a very small average constant time when called with a single key. O(N) with N being the number of keys, and much bigger constant times, when called with multiple keys. + +**Since:** 2.8.9 + +
+ +
+PFDEBUG - Internal commands for debugging HyperLogLog values. + +**Syntax:** `PFDEBUG subcommand key` + +**Description:** Internal commands for debugging HyperLogLog values. + +**Complexity:** N/A + +**Since:** 2.8.9 + +
+ +
+PFMERGE - Merges one or more HyperLogLog values into a single key. + +**Syntax:** `PFMERGE destkey [sourcekey [sourcekey ...]]` + +**Description:** Merges one or more HyperLogLog values into a single key. + +**Complexity:** O(N) to merge N HyperLogLogs, but with high constant times. + +**Since:** 2.8.9 + +
+ +
+PFSELFTEST - An internal command for testing HyperLogLog values. + +**Syntax:** `PFSELFTEST` + +**Description:** An internal command for testing HyperLogLog values. + +**Complexity:** N/A + +**Since:** 2.8.9 + +
+ + +## Geospatial commands + +Geospatial commands operate on geographic coordinates. + +
+GEOADD - Adds one or more members to a geospatial index. The key is created if it doesn't exist. + +**Syntax:** `GEOADD key [NX | XX] [CH] longitude latitude member [longitude + latitude member ...]` + +**Description:** Adds one or more members to a geospatial index. The key is created if it doesn't exist. + +**Complexity:** O(log(N)) for each item added, where N is the number of elements in the sorted set. + +**Since:** 3.2.0 + +
+ +
+GEODIST - Returns the distance between two members of a geospatial index. + +**Syntax:** `GEODIST key member1 member2 [M | KM | FT | MI]` + +**Description:** Returns the distance between two members of a geospatial index. + +**Complexity:** O(1) + +**Since:** 3.2.0 + +
+ +
+GEOHASH - Returns members from a geospatial index as geohash strings. + +**Syntax:** `GEOHASH key [member [member ...]]` + +**Description:** Returns members from a geospatial index as geohash strings. + +**Complexity:** O(1) for each member requested. + +**Since:** 3.2.0 + +
+ +
+GEOPOS - Returns the longitude and latitude of members from a geospatial index. + +**Syntax:** `GEOPOS key [member [member ...]]` + +**Description:** Returns the longitude and latitude of members from a geospatial index. + +**Complexity:** O(1) for each member requested. + +**Since:** 3.2.0 + +
+ +
+GEORADIUS - Queries a geospatial index for members within a distance from a coordinate, optionally stores the result. + +**Syntax:** `GEORADIUS key longitude latitude radius + [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count [ANY]] [ASC | DESC] + [STORE key | STOREDIST key]` + +**Description:** Queries a geospatial index for members within a distance from a coordinate, optionally stores the result. + +**Complexity:** O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index. + +**Since:** 3.2.0 + +
+ +
+GEORADIUSBYMEMBER - Queries a geospatial index for members within a distance from a member, optionally stores the result. + +**Syntax:** `GEORADIUSBYMEMBER key member radius [WITHCOORD] + [WITHDIST] [WITHHASH] [COUNT count [ANY]] [ASC | DESC] [STORE key + | STOREDIST key]` + +**Description:** Queries a geospatial index for members within a distance from a member, optionally stores the result. + +**Complexity:** O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index. + +**Since:** 3.2.0 + +
+ +
+GEORADIUSBYMEMBER_RO - Returns members from a geospatial index that are within a distance from a member. + +**Syntax:** `GEORADIUSBYMEMBER RO key member radius + [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count [ANY]] [ASC | DESC]` + +**Description:** Returns members from a geospatial index that are within a distance from a member. + +**Complexity:** O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index. + +**Since:** 3.2.10 + +
+ +
+GEORADIUS_RO - Returns members from a geospatial index that are within a distance from a coordinate. + +**Syntax:** `GEORADIUS RO key longitude latitude radius + [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count [ANY]] [ASC | DESC]` + +**Description:** Returns members from a geospatial index that are within a distance from a coordinate. + +**Complexity:** O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index. + +**Since:** 3.2.10 + +
+ +
+GEOSEARCH - Queries a geospatial index for members inside an area of a box or a circle. + +**Syntax:** `GEOSEARCH key + | BYBOX width height > [ASC | DESC] [COUNT count [ANY]] [WITHCOORD] [WITHDIST] + [WITHHASH]` + +**Description:** Queries a geospatial index for members inside an area of a box or a circle. + +**Complexity:** O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape + +**Since:** 6.2.0 + +
+ +
+GEOSEARCHSTORE - Queries a geospatial index for members inside an area of a box or a circle, optionally stores the result. + +**Syntax:** `GEOSEARCHSTORE destination source + | BYBOX width height > [ASC | DESC] [COUNT count + [ANY]] [STOREDIST]` + +**Description:** Queries a geospatial index for members inside an area of a box or a circle, optionally stores the result. + +**Complexity:** O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape + +**Since:** 6.2.0 + +
+ + +## JSON commands + +JSON commands operate on JSON data structures. + +
+JSON.ARRAPPEND - Append one or more json values into the array at path after the last element in it. + +**Syntax:** `JSON.ARRAPPEND key path value [value ...]` + +**Description:** Append one or more json values into the array at path after the last element in it. + +**Complexity:** O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key + +**Since:** 1.0.0 + +
+ +
+JSON.ARRINDEX - Returns the index of the first occurrence of a JSON scalar value in the array at path + +**Syntax:** `JSON.ARRINDEX key path value [start [stop]]` + +**Description:** Returns the index of the first occurrence of a JSON scalar value in the array at path + +**Complexity:** O(N) when path is evaluated to a single value where N is the size of the array, O(N) when path is evaluated to multiple values, where N is the size of the key + +**Since:** 1.0.0 + +
+ +
+JSON.ARRINSERT - Inserts the JSON scalar(s) value at the specified index in the array at path + +**Syntax:** `JSON.ARRINSERT key path index value [value ...]` + +**Description:** Inserts the JSON scalar(s) value at the specified index in the array at path + +**Complexity:** O(N) when path is evaluated to a single value where N is the size of the array, O(N) when path is evaluated to multiple values, where N is the size of the key + +**Since:** 1.0.0 + +
+ +
+JSON.ARRLEN - Returns the length of the array at path + +**Syntax:** `JSON.ARRLEN key [path]` + +**Description:** Returns the length of the array at path + +**Complexity:** O(1) where path is evaluated to a single value, O(N) where path is evaluated to multiple values, where N is the size of the key + +**Since:** 1.0.0 + +
+ +
+JSON.ARRPOP - Removes and returns the element at the specified index in the array at path + +**Syntax:** `JSON.ARRPOP key [path [index]]` + +**Description:** Removes and returns the element at the specified index in the array at path + +**Complexity:** O(N) when path is evaluated to a single value where N is the size of the array and the specified index is not the last element, O(1) when path is evaluated to a single value and the specified index is the last element, or O(N) when path is evaluated to multiple values, where N is the size of the key + +**Since:** 1.0.0 + +
+ +
+JSON.ARRTRIM - Trims the array at path to contain only the specified inclusive range of indices from start to stop + +**Syntax:** `JSON.ARRTRIM key path start stop` + +**Description:** Trims the array at path to contain only the specified inclusive range of indices from start to stop + +**Complexity:** O(N) when path is evaluated to a single value where N is the size of the array, O(N) when path is evaluated to multiple values, where N is the size of the key + +**Since:** 1.0.0 + +
+ +
+JSON.CLEAR - Clears all values from an array or an object and sets numeric values to `0` + +**Syntax:** `JSON.CLEAR key [path]` + +**Description:** Clears all values from an array or an object and sets numeric values to `0` + +**Complexity:** O(N) when path is evaluated to a single value where N is the size of the values, O(N) when path is evaluated to multiple values, where N is the size of the key + +**Since:** 2.0.0 + +
+ +
+JSON.DEBUG - Debugging container command + +**Syntax:** `JSON.DEBUG` + +**Description:** Debugging container command + +**Complexity:** N/A + +**Since:** 1.0.0 + +
+ +
+JSON.DEBUG MEMORY - Reports the size in bytes of a key + +**Syntax:** `JSON.DEBUG MEMORY key [path]` + +**Description:** Reports the size in bytes of a key + +**Complexity:** O(N) when path is evaluated to a single value, where N is the size of the value, O(N) when path is evaluated to multiple values, where N is the size of the key + +**Since:** 1.0.0 + +
+ +
+JSON.DEL - Deletes a value + +**Syntax:** `JSON.DEL key [path]` + +**Description:** Deletes a value + +**Complexity:** O(N) when path is evaluated to a single value where N is the size of the deleted value, O(N) when path is evaluated to multiple values, where N is the size of the key + +**Since:** 1.0.0 + +
+ +
+JSON.FORGET - Deletes a value + +**Syntax:** `JSON.FORGET key [path]` + +**Description:** Deletes a value + +**Complexity:** O(N) when path is evaluated to a single value where N is the size of the deleted value, O(N) when path is evaluated to multiple values, where N is the size of the key + +**Since:** 1.0.0 + +
+ +
+JSON.GET - Gets the value at one or more paths in JSON serialized form + +**Syntax:** `JSON.GET key [INDENT indent] [NEWLINE newline] [SPACE space] [path + [path ...]]` + +**Description:** Gets the value at one or more paths in JSON serialized form + +**Complexity:** O(N) when path is evaluated to a single value where N is the size of the value, O(N) when path is evaluated to multiple values, where N is the size of the key + +**Since:** 1.0.0 + +
+ +
+JSON.MERGE - Merges a given JSON value into matching paths. Consequently, JSON values at matching paths are updated, deleted, or expanded with new children + +**Syntax:** `JSON.MERGE key path value` + +**Description:** Merges a given JSON value into matching paths. Consequently, JSON values at matching paths are updated, deleted, or expanded with new children + +**Complexity:** O(M+N) when path is evaluated to a single value where M is the size of the original value (if it exists) and N is the size of the new value, O(M+N) when path is evaluated to multiple values where M is the size of the key and N is the size of the new value * the number of original values in the key + +**Since:** 2.6.0 + +
+ +
+JSON.MGET - Returns the values at a path from one or more keys + +**Syntax:** `JSON.MGET key [key ...] path` + +**Description:** Returns the values at a path from one or more keys + +**Complexity:** O(M*N) when path is evaluated to a single value where M is the number of keys and N is the size of the value, O(N1+N2+...+Nm) when path is evaluated to multiple values where m is the number of keys and Ni is the size of the i-th key + +**Since:** 1.0.0 + +
+ +
+JSON.MSET - Sets or updates the JSON value of one or more keys + +**Syntax:** `JSON.MSET key path value [key path value ...]` + +**Description:** Sets or updates the JSON value of one or more keys + +**Complexity:** O(K*(M+N)) where k is the number of keys in the command, when path is evaluated to a single value where M is the size of the original value (if it exists) and N is the size of the new value, or O(K*(M+N)) when path is evaluated to multiple values where M is the size of the key and N is the size of the new value * the number of original values in the key + +**Since:** 2.6.0 + +
+ +
+JSON.NUMINCRBY - Increments the numeric value at path by a value + +**Syntax:** `JSON.NUMINCRBY key path value` + +**Description:** Increments the numeric value at path by a value + +**Complexity:** O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key + +**Since:** 1.0.0 + +
+ +
+JSON.NUMMULTBY - Multiplies the numeric value at path by a value + +**Syntax:** `JSON.NUMMULTBY key path value` + +**Description:** Multiplies the numeric value at path by a value + +**Complexity:** O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key + +**Since:** 1.0.0 + +
+ +
+JSON.OBJKEYS - Returns the key names of JSON objects at the paths matching a given path expression + +**Syntax:** `JSON.OBJKEYS key [path]` + +**Description:** Returns the key names of JSON objects at the paths matching a given path expression + +**Complexity:** O(N) when path is evaluated to a single value, where N is the number of keys in the object, O(N) when path is evaluated to multiple values, where N is the size of the key + +**Since:** 1.0.0 + +
+ +
+JSON.OBJLEN - Returns the number of keys in JSON objects at the paths matching a given path expression + +**Syntax:** `JSON.OBJLEN key [path]` + +**Description:** Returns the number of keys in JSON objects at the paths matching a given path expression + +**Complexity:** O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key + +**Since:** 1.0.0 + +
+ +
+JSON.RESP - Returns the JSON value at path in Redis Serialization Protocol (RESP) + +**Syntax:** `JSON.RESP key [path]` + +**Description:** Returns the JSON value at path in Redis Serialization Protocol (RESP) + +**Complexity:** O(N) when path is evaluated to a single value, where N is the size of the value, O(N) when path is evaluated to multiple values, where N is the size of the key + +**Since:** 1.0.0 + +
+ +
+JSON.SET - Sets or updates the JSON value at a path + +**Syntax:** `JSON.SET key path value [NX | XX] [FPHA ]` + +**Description:** Sets or updates the JSON value at a path + +**Complexity:** O(M+N) when path is evaluated to a single value where M is the size of the original value (if it exists) and N is the size of the new value, O(M+N) when path is evaluated to multiple values where M is the size of the key and N is the size of the new value * the number of original values in the key + +**Since:** 1.0.0 + +
+ +
+JSON.STRAPPEND - Appends a string to JSON strings at the paths matching a given path expression + +**Syntax:** `JSON.STRAPPEND key [path] value` + +**Description:** Appends a string to JSON strings at the paths matching a given path expression + +**Complexity:** O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key + +**Since:** 1.0.0 + +
+ +
+JSON.STRLEN - Returns the length of JSON strings at the paths matching a given path expression + +**Syntax:** `JSON.STRLEN key [path]` + +**Description:** Returns the length of JSON strings at the paths matching a given path expression + +**Complexity:** O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key + +**Since:** 1.0.0 + +
+ +
+JSON.TOGGLE - Toggles a boolean value + +**Syntax:** `JSON.TOGGLE key path` + +**Description:** Toggles a boolean value + +**Complexity:** O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key + +**Since:** 2.0.0 + +
+ +
+JSON.TYPE - Returns the type of the JSON value at path + +**Syntax:** `JSON.TYPE key [path]` + +**Description:** Returns the type of the JSON value at path + +**Complexity:** O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key + +**Since:** 1.0.0 + +
+ + +## Search commands + +Search commands provide full-text search and secondary indexing. + +
+FT.AGGREGATE - Run a search query on an index and perform aggregate transformations on the results + +**Syntax:** `FT.AGGREGATE index query [VERBATIM] [LOAD count field [field ...]] + [TIMEOUT timeout] [LOAD *] [GROUPBY nargs property [property ...] + [REDUCE function nargs arg [arg ...] [AS name] [REDUCE function + nargs arg [arg ...] [AS name] ...]] [GROUPBY nargs property + [property ...] [REDUCE function nargs arg [arg ...] [AS name] + [REDUCE function nargs arg [arg ...] [AS name] ...]] ...]] + [SORTBY nargs [property [property ...]] + [MAX num]] [APPLY expression AS name [APPLY expression AS name + ...]] [LIMIT offset num] [FILTER filter] [WITHCURSOR + [COUNT read size] [MAXIDLE idle time]] [PARAMS nargs name value + [name value ...]] [DIALECT dialect]` + +**Description:** Run a search query on an index and perform aggregate transformations on the results + +**Complexity:** O(1) + +**Since:** 1.1.0 + +
+ +
+FT.ALIASADD - Adds an alias to the index + +**Syntax:** `FT.ALIASADD alias index` + +**Description:** Adds an alias to the index + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+FT.ALIASDEL - Deletes an alias from the index + +**Syntax:** `FT.ALIASDEL alias` + +**Description:** Deletes an alias from the index + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+FT.ALIASUPDATE - Adds or updates an alias to the index + +**Syntax:** `FT.ALIASUPDATE alias index` + +**Description:** Adds or updates an alias to the index + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+FT.ALTER - Adds a new field to the index + +**Syntax:** `FT.ALTER index [SKIPINITIALSCAN] SCHEMA ADD field options` + +**Description:** Adds a new field to the index + +**Complexity:** O(N) where N is the number of keys in the keyspace + +**Since:** 1.0.0 + +
+ +
+FT.CONFIG GET - Retrieves runtime configuration options + +**Syntax:** `FT.CONFIG GET option` + +**Description:** Retrieves runtime configuration options + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+FT.CONFIG SET - Sets runtime configuration options + +**Syntax:** `FT.CONFIG SET option value` + +**Description:** Sets runtime configuration options + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+FT.CREATE - Creates an index with the given spec + +**Syntax:** `FT.CREATE index [ON ] [PREFIX count prefix [prefix + ...]] [FILTER filter] [LANGUAGE default lang] + [LANGUAGE FIELD lang attribute] [SCORE default score] + [SCORE FIELD score attribute] [PAYLOAD FIELD payload attribute] + [MAXTEXTFIELDS] [TEMPORARY seconds] [NOOFFSETS] [NOHL] [NOFIELDS] + [NOFREQS] [STOPWORDS count [stopword [stopword ...]]] + [SKIPINITIALSCAN] [INDEXALL ] SCHEMA field name [AS alias] [WITHSUFFIXTRIE] [INDEXEMPTY] + [INDEXMISSING] [SORTABLE [UNF]] [NOINDEX] [field name [AS alias] + [WITHSUFFIXTRIE] + [INDEXEMPTY] [INDEXMISSING] [SORTABLE [UNF]] [NOINDEX] ...]` + +**Description:** Creates an index with the given spec + +**Complexity:** O(K) at creation where K is the number of fields, O(N) if scanning the keyspace is triggered, where N is the number of keys in the keyspace + +**Since:** 1.0.0 + +
+ +
+FT.CURSOR DEL - Deletes a cursor + +**Syntax:** `FT.CURSOR DEL index cursor id` + +**Description:** Deletes a cursor + +**Complexity:** O(1) + +**Since:** 1.1.0 + +
+ +
+FT.CURSOR READ - Reads from a cursor + +**Syntax:** `FT.CURSOR READ index cursor id [COUNT read size]` + +**Description:** Reads from a cursor + +**Complexity:** O(1) + +**Since:** 1.1.0 + +
+ +
+FT.DICTADD - Adds terms to a dictionary + +**Syntax:** `FT.DICTADD dict term [term ...]` + +**Description:** Adds terms to a dictionary + +**Complexity:** O(1) + +**Since:** 1.4.0 + +
+ +
+FT.DICTDEL - Deletes terms from a dictionary + +**Syntax:** `FT.DICTDEL dict term [term ...]` + +**Description:** Deletes terms from a dictionary + +**Complexity:** O(1) + +**Since:** 1.4.0 + +
+ +
+FT.DICTDUMP - Dumps all terms in the given dictionary + +**Syntax:** `FT.DICTDUMP dict` + +**Description:** Dumps all terms in the given dictionary + +**Complexity:** O(N), where N is the size of the dictionary + +**Since:** 1.4.0 + +
+ +
+FT.DROPINDEX - Deletes the index + +**Syntax:** `FT.DROPINDEX index [DD]` + +**Description:** Deletes the index + +**Complexity:** O(1) or O(N) if documents are deleted, where N is the number of keys in the keyspace + +**Since:** 2.0.0 + +
+ +
+FT.EXPLAIN - Returns the execution plan for a complex query + +**Syntax:** `FT.EXPLAIN index query [DIALECT dialect]` + +**Description:** Returns the execution plan for a complex query + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+FT.EXPLAINCLI - Returns the execution plan for a complex query + +**Syntax:** `FT.EXPLAINCLI index query [DIALECT dialect]` + +**Description:** Returns the execution plan for a complex query + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+FT.HYBRID - Performs hybrid search combining text search and vector similarity search + +**Syntax:** `FT.HYBRID index + SEARCH query + [SCORER scorer] + [YIELD SCORE AS name] + VSIM vector field $vector param + [KNN count K k [EF RUNTIME ef runtime]] + [RANGE count RADIUS radius [EPSILON epsilon]] + [YIELD SCORE AS name] + [FILTER filter] + [COMBINE RRF count [CONSTANT constant] [WINDOW window] [YIELD SCORE AS name]] + [COMBINE LINEAR count [[ALPHA alpha] [BETA beta]] [WINDOW window] [YIELD SCORE AS name]] + [LIMIT offset num] + [SORTBY count sortby [ASC | DESC]] + [NOSORT] + [LOAD count field [field ...]] + [LOAD *] + [GROUPBY nargs property [property ...] + [GROUPBY nargs property [property ...] + [REDUCE function nargs arg [arg ...] [AS name] + [REDUCE function nargs arg [arg ...] [AS name] ...]] ...]] + [APPLY expression AS name [APPLY expression AS name ...]] + [FILTER filter] + PARAMS nargs vector param vector blob [name value ...] + [TIMEOUT timeout]` + +**Description:** Performs hybrid search combining text search and vector similarity search + +**Complexity:** O(N+M) where N is the complexity of the text search and M is the complexity of the vector search + +**Since:** 8.4.0 + +
+ +
+FT.INFO - Returns information and statistics on the index + +**Syntax:** `FT.INFO index` + +**Description:** Returns information and statistics on the index + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+FT.PROFILE - Performs a `FT.SEARCH` or `FT.AGGREGATE` command and collects performance information + +**Syntax:** `FT.PROFILE index [LIMITED] QUERY query` + +**Description:** Performs a `FT.SEARCH` or `FT.AGGREGATE` command and collects performance information + +**Complexity:** O(N) + +**Since:** 2.2.0 + +
+ +
+FT.SEARCH - Searches the index with a textual query, returning either documents or just ids + +**Syntax:** `FT.SEARCH index query [NOCONTENT] [VERBATIM] [NOSTOPWORDS] + [WITHSCORES] [WITHPAYLOADS] [WITHSORTKEYS] [FILTER numeric field + min max [FILTER numeric field min max ...]] [GEOFILTER geo field + lon lat radius [GEOFILTER geo field lon lat + radius ...]] [INKEYS count key [key ...]] + [INFIELDS count field [field ...]] [RETURN count identifier + [AS property] [identifier [AS property] ...]] [SUMMARIZE + [FIELDS count field [field ...]] [FRAGS num] [LEN fragsize] + [SEPARATOR separator]] [HIGHLIGHT [FIELDS count field [field ...]] + [TAGS open close]] [SLOP slop] [TIMEOUT timeout] [INORDER] + [LANGUAGE language] [EXPANDER expander] [SCORER scorer] + [EXPLAINSCORE] [PAYLOAD payload] [SORTBY sortby [ASC | DESC]] + [LIMIT offset num] [PARAMS nargs name value [name value ...]] + [DIALECT dialect]` + +**Description:** Searches the index with a textual query, returning either documents or just ids + +**Complexity:** O(N) + +**Since:** 1.0.0 + +
+ +
+FT.SPELLCHECK - Performs spelling correction on a query, returning suggestions for misspelled terms + +**Syntax:** `FT.SPELLCHECK index query [DISTANCE distance] [TERMS  dictionary [terms [terms ...]]] [DIALECT dialect]` + +**Description:** Performs spelling correction on a query, returning suggestions for misspelled terms + +**Complexity:** O(1) + +**Since:** 1.4.0 + +
+ +
+FT.SYNDUMP - Dumps the contents of a synonym group + +**Syntax:** `FT.SYNDUMP index` + +**Description:** Dumps the contents of a synonym group + +**Complexity:** O(1) + +**Since:** 1.2.0 + +
+ +
+FT.SYNUPDATE - Creates or updates a synonym group with additional terms + +**Syntax:** `FT.SYNUPDATE index synonym group id [SKIPINITIALSCAN] term [term + ...]` + +**Description:** Creates or updates a synonym group with additional terms + +**Complexity:** O(1) + +**Since:** 1.2.0 + +
+ +
+FT.TAGVALS - Returns the distinct tags indexed in a Tag field + +**Syntax:** `FT.TAGVALS index field name` + +**Description:** Returns the distinct tags indexed in a Tag field + +**Complexity:** O(N) + +**Since:** 1.0.0 + +
+ +
+FT._LIST - Returns a list of all existing indexes + +**Syntax:** `FT. LIST` + +**Description:** Returns a list of all existing indexes + +**Complexity:** O(1) + +**Since:** 2.0.0 + +
+ + +## Time series commands + +Time series commands operate on time-series data. + +
+TS.ADD - Append a sample to a time series + +**Syntax:** `TS.ADD key timestamp value [RETENTION retentionPeriod] + [ENCODING ] [CHUNK SIZE size] + [ON DUPLICATE ] + [LABELS label value [label value ...]]` + +**Description:** Append a sample to a time series + +**Complexity:** O(M) when M is the amount of compaction rules or O(1) with no compaction + +**Since:** 1.0.0 + +
+ +
+TS.ALTER - Update the retention, chunk size, duplicate policy, and labels of an existing time series + +**Syntax:** `TS.ALTER key [RETENTION retentionPeriod] [CHUNK SIZE size] + [DUPLICATE POLICY ] [LABELS label value + [label value ...]]` + +**Description:** Update the retention, chunk size, duplicate policy, and labels of an existing time series + +**Complexity:** O(N) where N is the number of labels requested to update + +**Since:** 1.0.0 + +
+ +
+TS.CREATE - Create a new time series + +**Syntax:** `TS.CREATE key [RETENTION retentionPeriod] [ENCODING ] [CHUNK SIZE size] [DUPLICATE POLICY ] [LABELS label value [label value ...]]` + +**Description:** Create a new time series + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+TS.CREATERULE - Create a compaction rule + +**Syntax:** `TS.CREATERULE sourceKey destKey AGGREGATION  bucketDuration [alignTimestamp]` + +**Description:** Create a compaction rule + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+TS.DECRBY - Decrease the value of the sample with the maximum existing timestamp, or create a new sample with a value equal to the value of the sample with the maximum existing timestamp with a given decrement + +**Syntax:** `TS.DECRBY key value [TIMESTAMP timestamp] + [RETENTION retentionPeriod] [UNCOMPRESSED] [CHUNK SIZE size] + [LABELS label value [label value ...]]` + +**Description:** Decrease the value of the sample with the maximum existing timestamp, or create a new sample with a value equal to the value of the sample with the maximum existing timestamp with a given decrement + +**Complexity:** O(M) when M is the amount of compaction rules or O(1) with no compaction + +**Since:** 1.0.0 + +
+ +
+TS.DEL - Delete all samples between two timestamps for a given time series + +**Syntax:** `TS.DEL key from timestamp to timestamp` + +**Description:** Delete all samples between two timestamps for a given time series + +**Complexity:** O(N) where N is the number of data points that will be removed + +**Since:** 1.6.0 + +
+ +
+TS.DELETERULE - Delete a compaction rule + +**Syntax:** `TS.DELETERULE sourceKey destKey` + +**Description:** Delete a compaction rule + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+TS.GET - Get the sample with the highest timestamp from a given time series + +**Syntax:** `TS.GET key [LATEST]` + +**Description:** Get the sample with the highest timestamp from a given time series + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+TS.INCRBY - Increase the value of the sample with the maximum existing timestamp, or create a new sample with a value equal to the value of the sample with the maximum existing timestamp with a given increment + +**Syntax:** `TS.INCRBY key value [TIMESTAMP timestamp] + [RETENTION retentionPeriod] [UNCOMPRESSED] [CHUNK SIZE size] + [LABELS label value [label value ...]]` + +**Description:** Increase the value of the sample with the maximum existing timestamp, or create a new sample with a value equal to the value of the sample with the maximum existing timestamp with a given increment + +**Complexity:** O(M) when M is the amount of compaction rules or O(1) with no compaction + +**Since:** 1.0.0 + +
+ +
+TS.INFO - Returns information and statistics for a time series + +**Syntax:** `TS.INFO key [DEBUG]` + +**Description:** Returns information and statistics for a time series + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+TS.MADD - Append new samples to one or more time series + +**Syntax:** `TS.MADD key timestamp value [key timestamp value ...]` + +**Description:** Append new samples to one or more time series + +**Complexity:** O(N*M) when N is the amount of series updated and M is the amount of compaction rules or O(N) with no compaction + +**Since:** 1.0.0 + +
+ +
+TS.MGET - Get the sample with the highest timestamp from each time series matching a specific filter + +**Syntax:** `TS.MGET [LATEST] [WITHLABELS | SELECTED LABELS label1 [label1 ...]] + FILTER ` + +**Description:** Get the sample with the highest timestamp from each time series matching a specific filter + +**Complexity:** O(n) where n is the number of time-series that match the filters + +**Since:** 1.0.0 + +
+ +
+TS.MRANGE - Query a range across multiple time series by filters in forward direction + +**Syntax:** `TS.MRANGE fromTimestamp toTimestamp [LATEST] [FILTER BY TS Timestamp + [Timestamp ...]] [FILTER BY VALUE min max] [WITHLABELS | + SELECTED LABELS label1 [label1 ...]] [COUNT count] [[ALIGN value] + AGGREGATION aggregators bucketDuration [BUCKETTIMESTAMP] + [EMPTY]] FILTER  [GROUPBY label REDUCE reducer]` + +**Description:** Query a range across multiple time series by filters in forward direction + +**Complexity:** O(n/m+k) where n = Number of data points, m = Chunk size (data points per chunk), k = Number of data points that are in the requested ranges + +**Since:** 1.0.0 + +
+ +
+TS.MREVRANGE - Query a range across multiple time-series by filters in reverse direction + +**Syntax:** `TS.MREVRANGE fromTimestamp toTimestamp [LATEST] + [FILTER BY TS Timestamp [Timestamp ...]] [FILTER BY VALUE min max] + [WITHLABELS | SELECTED LABELS label1 [label1 ...]] [COUNT count] + [[ALIGN value] AGGREGATION aggregators bucketDuration + [BUCKETTIMESTAMP] [EMPTY]] FILTER  [GROUPBY label REDUCE + reducer]` + +**Description:** Query a range across multiple time-series by filters in reverse direction + +**Complexity:** O(n/m+k) where n = Number of data points, m = Chunk size (data points per chunk), k = Number of data points that are in the requested ranges + +**Since:** 1.4.0 + +
+ +
+TS.QUERYINDEX - Get all time series keys matching a filter list + +**Syntax:** `TS.QUERYINDEX ` + +**Description:** Get all time series keys matching a filter list + +**Complexity:** O(n) where n is the number of time-series that match the filters + +**Since:** 1.0.0 + +
+ +
+TS.RANGE - Query a range in forward direction + +**Syntax:** `TS.RANGE key fromTimestamp toTimestamp [LATEST] + [FILTER BY TS Timestamp [Timestamp ...]] [FILTER BY VALUE min max] + [COUNT count] [[ALIGN value] AGGREGATION aggregators bucketDuration [BUCKETTIMESTAMP] [EMPTY]]` + +**Description:** Query a range in forward direction + +**Complexity:** O(n/m+k) where n = Number of data points, m = Chunk size (data points per chunk), k = Number of data points that are in the requested range + +**Since:** 1.0.0 + +
+ +
+TS.REVRANGE - Query a range in reverse direction + +**Syntax:** `TS.REVRANGE key fromTimestamp toTimestamp [LATEST] + [FILTER BY TS Timestamp [Timestamp ...]] [FILTER BY VALUE min max] + [COUNT count] [[ALIGN value] AGGREGATION aggregators + bucketDuration [BUCKETTIMESTAMP] [EMPTY]]` + +**Description:** Query a range in reverse direction + +**Complexity:** O(n/m+k) where n = Number of data points, m = Chunk size (data points per chunk), k = Number of data points that are in the requested range + +**Since:** 1.4.0 + +
+ + +## Vector set commands + +Vector set commands operate on vector data structures for similarity search and range queries. + +
+VADD - Add a new element to a vector set, or update its vector if it already exists. + +**Syntax:** `VADD key [REDUCE dim] (FP32 | VALUES num) vector element [CAS] [NOQUANT | Q8 | BIN] + [EF build-exploration-factor] [SETATTR attributes] [M numlinks]` + +**Description:** Add a new element to a vector set, or update its vector if it already exists. + +**Complexity:** O(log(N)) for each element added, where N is the number of elements in the vector set. + +**Since:** 8.0.0 + +
+ +
+VCARD - Return the number of elements in a vector set. + +**Syntax:** `VCARD key` + +**Description:** Return the number of elements in a vector set. + +**Complexity:** O(1) + +**Since:** 8.0.0 + +
+ +
+VDIM - Return the dimension of vectors in the vector set. + +**Syntax:** `VDIM key` + +**Description:** Return the dimension of vectors in the vector set. + +**Complexity:** O(1) + +**Since:** 8.0.0 + +
+ +
+VEMB - Return the vector associated with an element. + +**Syntax:** `VEMB key element [RAW]` + +**Description:** Return the vector associated with an element. + +**Complexity:** O(1) + +**Since:** 8.0.0 + +
+ +
+VGETATTR - Retrieve the JSON attributes of elements. + +**Syntax:** `VGETATTR key element` + +**Description:** Retrieve the JSON attributes of elements. + +**Complexity:** O(1) + +**Since:** 8.0.0 + +
+ +
+VINFO - Return information about a vector set. + +**Syntax:** `VINFO key` + +**Description:** Return information about a vector set. + +**Complexity:** O(1) + +**Since:** 8.0.0 + +
+ +
+VISMEMBER - Check if an element exists in a vector set. + +**Syntax:** `VISMEMBER key element` + +**Description:** Check if an element exists in a vector set. + +**Complexity:** O(1) + +**Since:** 8.0.0 + +
+ +
+VLINKS - Return the neighbors of an element at each layer in the HNSW graph. + +**Syntax:** `VLINKS key element [WITHSCORES]` + +**Description:** Return the neighbors of an element at each layer in the HNSW graph. + +**Complexity:** O(1) + +**Since:** 8.0.0 + +
+ +
+VRANDMEMBER - Return one or multiple random members from a vector set. + +**Syntax:** `VRANDMEMBER key [count]` + +**Description:** Return one or multiple random members from a vector set. + +**Complexity:** O(N) where N is the absolute value of the count argument. + +**Since:** 8.0.0 + +
+ +
+VRANGE - Return elements in a lexicographical range + +**Syntax:** `VRANGE key start end [count]` + +**Description:** Return elements in a lexicographical range + +**Complexity:** O(log(K)+M) where K is the number of elements in the start prefix, and M is the number of elements returned. In practical terms, the command is just O(M) + +**Since:** 8.4.0 + +
+ +
+VREM - Remove an element from a vector set. + +**Syntax:** `VREM key element` + +**Description:** Remove an element from a vector set. + +**Complexity:** O(log(N)) for each element removed, where N is the number of elements in the vector set. + +**Since:** 8.0.0 + +
+ +
+VSETATTR - Associate or remove the JSON attributes of elements. + +**Syntax:** `VSETATTR key element "{ JSON obj }"` + +**Description:** Associate or remove the JSON attributes of elements. + +**Complexity:** O(1) + +**Since:** 8.0.0 + +
+ +
+VSIM - Return elements by vector similarity. + +**Syntax:** `VSIM key (ELE | FP32 | VALUES num) (vector | element) [WITHSCORES] [WITHATTRIBS] [COUNT num] + [EPSILON delta] [EF search-exploration-factor] [FILTER expression] [FILTER-EF max-filtering-effort] + [TRUTH] [NOTHREAD]` + +**Description:** Return elements by vector similarity. + +**Complexity:** O(log(N)) where N is the number of elements in the vector set. + +**Since:** 8.0.0 + +
+ + +## Pub/Sub commands + +Pub/Sub commands enable message passing between clients. + +
+PSUBSCRIBE - Listens for messages published to channels that match one or more patterns. + +**Syntax:** `PSUBSCRIBE pattern [pattern ...]` + +**Description:** Listens for messages published to channels that match one or more patterns. + +**Complexity:** O(N) where N is the number of patterns to subscribe to. + +**Since:** 2.0.0 + +
+ +
+PUBLISH - Posts a message to a channel. + +**Syntax:** `PUBLISH channel message` + +**Description:** Posts a message to a channel. + +**Complexity:** O(N+M) where N is the number of clients subscribed to the receiving channel and M is the total number of subscribed patterns (by any client). + +**Since:** 2.0.0 + +
+ +
+PUBSUB CHANNELS - Returns the active channels. + +**Syntax:** `PUBSUB CHANNELS [pattern]` + +**Description:** Returns the active channels. + +**Complexity:** O(N) where N is the number of active channels, and assuming constant time pattern matching (relatively short channels and patterns) + +**Since:** 2.8.0 + +
+ +
+PUBSUB NUMPAT - Returns a count of unique pattern subscriptions. + +**Syntax:** `PUBSUB NUMPAT` + +**Description:** Returns a count of unique pattern subscriptions. + +**Complexity:** O(1) + +**Since:** 2.8.0 + +
+ +
+PUBSUB NUMSUB - Returns a count of subscribers to channels. + +**Syntax:** `PUBSUB NUMSUB [channel [channel ...]]` + +**Description:** Returns a count of subscribers to channels. + +**Complexity:** O(N) for the NUMSUB subcommand, where N is the number of requested channels + +**Since:** 2.8.0 + +
+ +
+PUBSUB SHARDCHANNELS - Returns the active shard channels. + +**Syntax:** `PUBSUB SHARDCHANNELS [pattern]` + +**Description:** Returns the active shard channels. + +**Complexity:** O(N) where N is the number of active shard channels, and assuming constant time pattern matching (relatively short shard channels). + +**Since:** 7.0.0 + +
+ +
+PUBSUB SHARDNUMSUB - Returns the count of subscribers of shard channels. + +**Syntax:** `PUBSUB SHARDNUMSUB [shardchannel [shardchannel ...]]` + +**Description:** Returns the count of subscribers of shard channels. + +**Complexity:** O(N) for the SHARDNUMSUB subcommand, where N is the number of requested shard channels + +**Since:** 7.0.0 + +
+ +
+PUNSUBSCRIBE - Stops listening to messages published to channels that match one or more patterns. + +**Syntax:** `PUNSUBSCRIBE [pattern [pattern ...]]` + +**Description:** Stops listening to messages published to channels that match one or more patterns. + +**Complexity:** O(N) where N is the number of patterns to unsubscribe. + +**Since:** 2.0.0 + +
+ +
+SPUBLISH - Post a message to a shard channel + +**Syntax:** `SPUBLISH shardchannel message` + +**Description:** Post a message to a shard channel + +**Complexity:** O(N) where N is the number of clients subscribed to the receiving shard channel. + +**Since:** 7.0.0 + +
+ +
+SSUBSCRIBE - Listens for messages published to shard channels. + +**Syntax:** `SSUBSCRIBE shardchannel [shardchannel ...]` + +**Description:** Listens for messages published to shard channels. + +**Complexity:** O(N) where N is the number of shard channels to subscribe to. + +**Since:** 7.0.0 + +
+ +
+SUBSCRIBE - Listens for messages published to channels. + +**Syntax:** `SUBSCRIBE channel [channel ...]` + +**Description:** Listens for messages published to channels. + +**Complexity:** O(N) where N is the number of channels to subscribe to. + +**Since:** 2.0.0 + +
+ +
+SUNSUBSCRIBE - Stops listening to messages posted to shard channels. + +**Syntax:** `SUNSUBSCRIBE [shardchannel [shardchannel ...]]` + +**Description:** Stops listening to messages posted to shard channels. + +**Complexity:** O(N) where N is the number of shard channels to unsubscribe. + +**Since:** 7.0.0 + +
+ +
+UNSUBSCRIBE - Stops listening to messages posted to channels. + +**Syntax:** `UNSUBSCRIBE [channel [channel ...]]` + +**Description:** Stops listening to messages posted to channels. + +**Complexity:** O(N) where N is the number of channels to unsubscribe. + +**Since:** 2.0.0 + +
+ + +## Transaction commands + +Transaction commands enable atomic execution of command groups. + +
+DISCARD - Discards a transaction. + +**Syntax:** `DISCARD` + +**Description:** Discards a transaction. + +**Complexity:** O(N), when N is the number of queued commands + +**Since:** 2.0.0 + +
+ +
+EXEC - Executes all commands in a transaction. + +**Syntax:** `EXEC` + +**Description:** Executes all commands in a transaction. + +**Complexity:** Depends on commands in the transaction + +**Since:** 1.2.0 + +
+ +
+MULTI - Starts a transaction. + +**Syntax:** `MULTI` + +**Description:** Starts a transaction. + +**Complexity:** O(1) + +**Since:** 1.2.0 + +
+ +
+UNWATCH - Forgets about watched keys of a transaction. + +**Syntax:** `UNWATCH` + +**Description:** Forgets about watched keys of a transaction. + +**Complexity:** O(1) + +**Since:** 2.2.0 + +
+ +
+WATCH - Monitors changes to keys to determine the execution of a transaction. + +**Syntax:** `WATCH key [key ...]` + +**Description:** Monitors changes to keys to determine the execution of a transaction. + +**Complexity:** O(1) for every key. + +**Since:** 2.2.0 + +
+ + +## Scripting commands + +Scripting commands enable server-side Lua script execution. + +
+EVAL - Executes a server-side Lua script. + +**Syntax:** `EVAL script numkeys [key [key ...]] [arg [arg ...]]` + +**Description:** Executes a server-side Lua script. + +**Complexity:** Depends on the script that is executed. + +**Since:** 2.6.0 + +
+ +
+EVALSHA - Executes a server-side Lua script by SHA1 digest. + +**Syntax:** `EVALSHA sha1 numkeys [key [key ...]] [arg [arg ...]]` + +**Description:** Executes a server-side Lua script by SHA1 digest. + +**Complexity:** Depends on the script that is executed. + +**Since:** 2.6.0 + +
+ +
+EVALSHA_RO - Executes a read-only server-side Lua script by SHA1 digest. + +**Syntax:** `EVALSHA RO sha1 numkeys [key [key ...]] [arg [arg ...]]` + +**Description:** Executes a read-only server-side Lua script by SHA1 digest. + +**Complexity:** Depends on the script that is executed. + +**Since:** 7.0.0 + +
+ +
+EVAL_RO - Executes a read-only server-side Lua script. + +**Syntax:** `EVAL RO script numkeys [key [key ...]] [arg [arg ...]]` + +**Description:** Executes a read-only server-side Lua script. + +**Complexity:** Depends on the script that is executed. + +**Since:** 7.0.0 + +
+ +
+FCALL - Invokes a function. + +**Syntax:** `FCALL function numkeys [key [key ...]] [arg [arg ...]]` + +**Description:** Invokes a function. + +**Complexity:** Depends on the function that is executed. + +**Since:** 7.0.0 + +
+ +
+FCALL_RO - Invokes a read-only function. + +**Syntax:** `FCALL RO function numkeys [key [key ...]] [arg [arg ...]]` + +**Description:** Invokes a read-only function. + +**Complexity:** Depends on the function that is executed. + +**Since:** 7.0.0 + +
+ +
+FUNCTION DELETE - Deletes a library and its functions. + +**Syntax:** `FUNCTION DELETE library-name` + +**Description:** Deletes a library and its functions. + +**Complexity:** O(1) + +**Since:** 7.0.0 + +
+ +
+FUNCTION DUMP - Dumps all libraries into a serialized binary payload. + +**Syntax:** `FUNCTION DUMP` + +**Description:** Dumps all libraries into a serialized binary payload. + +**Complexity:** O(N) where N is the number of functions + +**Since:** 7.0.0 + +
+ +
+FUNCTION FLUSH - Deletes all libraries and functions. + +**Syntax:** `FUNCTION FLUSH [ASYNC | SYNC]` + +**Description:** Deletes all libraries and functions. + +**Complexity:** O(N) where N is the number of functions deleted + +**Since:** 7.0.0 + +
+ +
+FUNCTION KILL - Terminates a function during execution. + +**Syntax:** `FUNCTION KILL` + +**Description:** Terminates a function during execution. + +**Complexity:** O(1) + +**Since:** 7.0.0 + +
+ +
+FUNCTION LIST - Returns information about all libraries. + +**Syntax:** `FUNCTION LIST [LIBRARYNAME library-name-pattern] [WITHCODE]` + +**Description:** Returns information about all libraries. + +**Complexity:** O(N) where N is the number of functions + +**Since:** 7.0.0 + +
+ +
+FUNCTION LOAD - Creates a library. + +**Syntax:** `FUNCTION LOAD [REPLACE] function-code` + +**Description:** Creates a library. + +**Complexity:** O(1) (considering compilation time is redundant) + +**Since:** 7.0.0 + +
+ +
+FUNCTION RESTORE - Restores all libraries from a payload. + +**Syntax:** `FUNCTION RESTORE serialized-value [FLUSH | APPEND | REPLACE]` + +**Description:** Restores all libraries from a payload. + +**Complexity:** O(N) where N is the number of functions on the payload + +**Since:** 7.0.0 + +
+ +
+FUNCTION STATS - Returns information about a function during execution. + +**Syntax:** `FUNCTION STATS` + +**Description:** Returns information about a function during execution. + +**Complexity:** O(1) + +**Since:** 7.0.0 + +
+ +
+SCRIPT DEBUG - Sets the debug mode of server-side Lua scripts. + +**Syntax:** `SCRIPT DEBUG ` + +**Description:** Sets the debug mode of server-side Lua scripts. + +**Complexity:** O(1) + +**Since:** 3.2.0 + +
+ +
+SCRIPT EXISTS - Determines whether server-side Lua scripts exist in the script cache. + +**Syntax:** `SCRIPT EXISTS sha1 [sha1 ...]` + +**Description:** Determines whether server-side Lua scripts exist in the script cache. + +**Complexity:** O(N) with N being the number of scripts to check (so checking a single script is an O(1) operation). + +**Since:** 2.6.0 + +
+ +
+SCRIPT FLUSH - Removes all server-side Lua scripts from the script cache. + +**Syntax:** `SCRIPT FLUSH [ASYNC | SYNC]` + +**Description:** Removes all server-side Lua scripts from the script cache. + +**Complexity:** O(N) with N being the number of scripts in cache + +**Since:** 2.6.0 + +
+ +
+SCRIPT KILL - Terminates a server-side Lua script during execution. + +**Syntax:** `SCRIPT KILL` + +**Description:** Terminates a server-side Lua script during execution. + +**Complexity:** O(1) + +**Since:** 2.6.0 + +
+ +
+SCRIPT LOAD - Loads a server-side Lua script to the script cache. + +**Syntax:** `SCRIPT LOAD script` + +**Description:** Loads a server-side Lua script to the script cache. + +**Complexity:** O(N) with N being the length in bytes of the script body. + +**Since:** 2.6.0 + +
+ + +## Connection commands + +Connection commands manage client connections. + +
+AUTH - Authenticates the connection. + +**Syntax:** `AUTH [username] password` + +**Description:** Authenticates the connection. + +**Complexity:** O(N) where N is the number of passwords defined for the user + +**Since:** 1.0.0 + +
+ +
+CLIENT CACHING - Instructs the server whether to track the keys in the next request. + +**Syntax:** `CLIENT CACHING ` + +**Description:** Instructs the server whether to track the keys in the next request. + +**Complexity:** O(1) + +**Since:** 6.0.0 + +
+ +
+CLIENT GETNAME - Returns the name of the connection. + +**Syntax:** `CLIENT GETNAME` + +**Description:** Returns the name of the connection. + +**Complexity:** O(1) + +**Since:** 2.6.9 + +
+ +
+CLIENT GETREDIR - Returns the client ID to which the connection's tracking notifications are redirected. + +**Syntax:** `CLIENT GETREDIR` + +**Description:** Returns the client ID to which the connection's tracking notifications are redirected. + +**Complexity:** O(1) + +**Since:** 6.0.0 + +
+ +
+CLIENT ID - Returns the unique client ID of the connection. + +**Syntax:** `CLIENT ID` + +**Description:** Returns the unique client ID of the connection. + +**Complexity:** O(1) + +**Since:** 5.0.0 + +
+ +
+CLIENT INFO - Returns information about the connection. + +**Syntax:** `CLIENT INFO` + +**Description:** Returns information about the connection. + +**Complexity:** O(1) + +**Since:** 6.2.0 + +
+ +
+CLIENT KILL - Terminates open connections. + +**Syntax:** `CLIENT KILL ] | [USER username] | [ADDR ip:port] | + [LADDR ip:port] | [SKIPME ] | [MAXAGE maxage] + [[ID client-id] | [TYPE ] | [USER username] | [ADDR ip:port] | [LADDR ip:port] | + [SKIPME ] | [MAXAGE maxage] ...]>>` + +**Description:** Terminates open connections. + +**Complexity:** O(N) where N is the number of client connections + +**Since:** 2.4.0 + +
+ +
+CLIENT LIST - Lists open connections. + +**Syntax:** `CLIENT LIST [TYPE ] + [ID client-id [client-id ...]]` + +**Description:** Lists open connections. + +**Complexity:** O(N) where N is the number of client connections + +**Since:** 2.4.0 + +
+ +
+CLIENT NO-EVICT - Sets the client eviction mode of the connection. + +**Syntax:** `CLIENT NO-EVICT ` + +**Description:** Sets the client eviction mode of the connection. + +**Complexity:** O(1) + +**Since:** 7.0.0 + +
+ +
+CLIENT NO-TOUCH - Controls whether commands sent by the client affect the LRU/LFU of accessed keys. + +**Syntax:** `CLIENT NO-TOUCH ` + +**Description:** Controls whether commands sent by the client affect the LRU/LFU of accessed keys. + +**Complexity:** O(1) + +**Since:** 7.2.0 + +
+ +
+CLIENT PAUSE - Suspends commands processing. + +**Syntax:** `CLIENT PAUSE timeout [WRITE | ALL]` + +**Description:** Suspends commands processing. + +**Complexity:** O(1) + +**Since:** 3.0.0 + +
+ +
+CLIENT REPLY - Instructs the server whether to reply to commands. + +**Syntax:** `CLIENT REPLY ` + +**Description:** Instructs the server whether to reply to commands. + +**Complexity:** O(1) + +**Since:** 3.2.0 + +
+ +
+CLIENT SETINFO - Sets information specific to the client or connection. + +**Syntax:** `CLIENT SETINFO ` + +**Description:** Sets information specific to the client or connection. + +**Complexity:** O(1) + +**Since:** 7.2.0 + +
+ +
+CLIENT SETNAME - Sets the connection name. + +**Syntax:** `CLIENT SETNAME connection-name` + +**Description:** Sets the connection name. + +**Complexity:** O(1) + +**Since:** 2.6.9 + +
+ +
+CLIENT TRACKING - Controls server-assisted client-side caching for the connection. + +**Syntax:** `CLIENT TRACKING [REDIRECT client-id] [PREFIX prefix + [PREFIX prefix ...]] [BCAST] [OPTIN] [OPTOUT] [NOLOOP]` + +**Description:** Controls server-assisted client-side caching for the connection. + +**Complexity:** O(1). Some options may introduce additional complexity. + +**Since:** 6.0.0 + +
+ +
+CLIENT TRACKINGINFO - Returns information about server-assisted client-side caching for the connection. + +**Syntax:** `CLIENT TRACKINGINFO` + +**Description:** Returns information about server-assisted client-side caching for the connection. + +**Complexity:** O(1) + +**Since:** 6.2.0 + +
+ +
+CLIENT UNBLOCK - Unblocks a client blocked by a blocking command from a different connection. + +**Syntax:** `CLIENT UNBLOCK client-id [TIMEOUT | ERROR]` + +**Description:** Unblocks a client blocked by a blocking command from a different connection. + +**Complexity:** O(log N) where N is the number of client connections + +**Since:** 5.0.0 + +
+ +
+CLIENT UNPAUSE - Resumes processing commands from paused clients. + +**Syntax:** `CLIENT UNPAUSE` + +**Description:** Resumes processing commands from paused clients. + +**Complexity:** O(N) Where N is the number of paused clients + +**Since:** 6.2.0 + +
+ +
+ECHO - Returns the given string. + +**Syntax:** `ECHO message` + +**Description:** Returns the given string. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+HELLO - Handshakes with the Redis server. + +**Syntax:** `HELLO [protover [AUTH username password] [SETNAME clientname]]` + +**Description:** Handshakes with the Redis server. + +**Complexity:** O(1) + +**Since:** 6.0.0 + +
+ +
+PING - Returns the server's liveliness response. + +**Syntax:** `PING [message]` + +**Description:** Returns the server's liveliness response. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+QUIT - Closes the connection. + +**Syntax:** `QUIT` + +**Description:** Closes the connection. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+RESET - Resets the connection. + +**Syntax:** `RESET` + +**Description:** Resets the connection. + +**Complexity:** O(1) + +**Since:** 6.2.0 + +
+ +
+SELECT - Changes the selected database. + +**Syntax:** `SELECT index` + +**Description:** Changes the selected database. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ + +## Server commands + +Server commands provide server management and introspection. + +
+ACL CAT - Lists the ACL categories, or the commands inside a category. + +**Syntax:** `ACL CAT [category]` + +**Description:** Lists the ACL categories, or the commands inside a category. + +**Complexity:** O(1) since the categories and commands are a fixed set. + +**Since:** 6.0.0 + +
+ +
+ACL DELUSER - Deletes ACL users, and terminates their connections. + +**Syntax:** `ACL DELUSER username [username ...]` + +**Description:** Deletes ACL users, and terminates their connections. + +**Complexity:** O(1) amortized time considering the typical user. + +**Since:** 6.0.0 + +
+ +
+ACL DRYRUN - Simulates the execution of a command by a user, without executing the command. + +**Syntax:** `ACL DRYRUN username command [arg [arg ...]]` + +**Description:** Simulates the execution of a command by a user, without executing the command. + +**Complexity:** O(1). + +**Since:** 7.0.0 + +
+ +
+ACL GENPASS - Generates a pseudorandom, secure password that can be used to identify ACL users. + +**Syntax:** `ACL GENPASS [bits]` + +**Description:** Generates a pseudorandom, secure password that can be used to identify ACL users. + +**Complexity:** O(1) + +**Since:** 6.0.0 + +
+ +
+ACL GETUSER - Lists the ACL rules of a user. + +**Syntax:** `ACL GETUSER username` + +**Description:** Lists the ACL rules of a user. + +**Complexity:** O(N). Where N is the number of password, command and pattern rules that the user has. + +**Since:** 6.0.0 + +
+ +
+ACL LIST - Dumps the effective rules in ACL file format. + +**Syntax:** `ACL LIST` + +**Description:** Dumps the effective rules in ACL file format. + +**Complexity:** O(N). Where N is the number of configured users. + +**Since:** 6.0.0 + +
+ +
+ACL LOAD - Reloads the rules from the configured ACL file. + +**Syntax:** `ACL LOAD` + +**Description:** Reloads the rules from the configured ACL file. + +**Complexity:** O(N). Where N is the number of configured users. + +**Since:** 6.0.0 + +
+ +
+ACL LOG - Lists recent security events generated due to ACL rules. + +**Syntax:** `ACL LOG [count | RESET]` + +**Description:** Lists recent security events generated due to ACL rules. + +**Complexity:** O(N) with N being the number of entries shown. + +**Since:** 6.0.0 + +
+ +
+ACL SAVE - Saves the effective ACL rules in the configured ACL file. + +**Syntax:** `ACL SAVE` + +**Description:** Saves the effective ACL rules in the configured ACL file. + +**Complexity:** O(N). Where N is the number of configured users. + +**Since:** 6.0.0 + +
+ +
+ACL SETUSER - Creates and modifies an ACL user and its rules. + +**Syntax:** `ACL SETUSER username [rule [rule ...]]` + +**Description:** Creates and modifies an ACL user and its rules. + +**Complexity:** O(N). Where N is the number of rules provided. + +**Since:** 6.0.0 + +
+ +
+ACL USERS - Lists all ACL users. + +**Syntax:** `ACL USERS` + +**Description:** Lists all ACL users. + +**Complexity:** O(N). Where N is the number of configured users. + +**Since:** 6.0.0 + +
+ +
+ACL WHOAMI - Returns the authenticated username of the current connection. + +**Syntax:** `ACL WHOAMI` + +**Description:** Returns the authenticated username of the current connection. + +**Complexity:** O(1) + +**Since:** 6.0.0 + +
+ +
+BGREWRITEAOF - Asynchronously rewrites the append-only file to disk. + +**Syntax:** `BGREWRITEAOF` + +**Description:** Asynchronously rewrites the append-only file to disk. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+BGSAVE - Asynchronously saves the database(s) to disk. + +**Syntax:** `BGSAVE [SCHEDULE]` + +**Description:** Asynchronously saves the database(s) to disk. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+COMMAND - Returns detailed information about all commands. + +**Syntax:** `COMMAND` + +**Description:** Returns detailed information about all commands. + +**Complexity:** O(N) where N is the total number of Redis commands + +**Since:** 2.8.13 + +
+ +
+COMMAND COUNT - Returns a count of commands. + +**Syntax:** `COMMAND COUNT` + +**Description:** Returns a count of commands. + +**Complexity:** O(1) + +**Since:** 2.8.13 + +
+ +
+COMMAND DOCS - Returns documentary information about one, multiple or all commands. + +**Syntax:** `COMMAND DOCS [command-name [command-name ...]]` + +**Description:** Returns documentary information about one, multiple or all commands. + +**Complexity:** O(N) where N is the number of commands to look up + +**Since:** 7.0.0 + +
+ +
+COMMAND GETKEYS - Extracts the key names from an arbitrary command. + +**Syntax:** `COMMAND GETKEYS command [arg [arg ...]]` + +**Description:** Extracts the key names from an arbitrary command. + +**Complexity:** O(N) where N is the number of arguments to the command + +**Since:** 2.8.13 + +
+ +
+COMMAND GETKEYSANDFLAGS - Extracts the key names and access flags for an arbitrary command. + +**Syntax:** `COMMAND GETKEYSANDFLAGS command [arg [arg ...]]` + +**Description:** Extracts the key names and access flags for an arbitrary command. + +**Complexity:** O(N) where N is the number of arguments to the command + +**Since:** 7.0.0 + +
+ +
+COMMAND INFO - Returns information about one, multiple or all commands. + +**Syntax:** `COMMAND INFO [command-name [command-name ...]]` + +**Description:** Returns information about one, multiple or all commands. + +**Complexity:** O(N) where N is the number of commands to look up + +**Since:** 2.8.13 + +
+ +
+COMMAND LIST - Returns a list of command names. + +**Syntax:** `COMMAND LIST [FILTERBY ]` + +**Description:** Returns a list of command names. + +**Complexity:** O(N) where N is the total number of Redis commands + +**Since:** 7.0.0 + +
+ +
+CONFIG GET - Returns the effective values of configuration parameters. + +**Syntax:** `CONFIG GET parameter [parameter ...]` + +**Description:** Returns the effective values of configuration parameters. + +**Complexity:** O(N) when N is the number of configuration parameters provided + +**Since:** 2.0.0 + +
+ +
+CONFIG RESETSTAT - Resets the server's statistics. + +**Syntax:** `CONFIG RESETSTAT` + +**Description:** Resets the server's statistics. + +**Complexity:** O(1) + +**Since:** 2.0.0 + +
+ +
+CONFIG REWRITE - Persists the effective configuration to file. + +**Syntax:** `CONFIG REWRITE` + +**Description:** Persists the effective configuration to file. + +**Complexity:** O(1) + +**Since:** 2.8.0 + +
+ +
+CONFIG SET - Sets configuration parameters in-flight. + +**Syntax:** `CONFIG SET parameter value [parameter value ...]` + +**Description:** Sets configuration parameters in-flight. + +**Complexity:** O(N) when N is the number of configuration parameters provided + +**Since:** 2.0.0 + +
+ +
+DBSIZE - Returns the number of keys in the database. + +**Syntax:** `DBSIZE` + +**Description:** Returns the number of keys in the database. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+FAILOVER - Starts a coordinated failover from a server to one of its replicas. + +**Syntax:** `FAILOVER [TO host port [FORCE]] [ABORT] [TIMEOUT milliseconds]` + +**Description:** Starts a coordinated failover from a server to one of its replicas. + +**Complexity:** O(1) + +**Since:** 6.2.0 + +
+ +
+FLUSHALL - Removes all keys from all databases. + +**Syntax:** `FLUSHALL [ASYNC | SYNC]` + +**Description:** Removes all keys from all databases. + +**Complexity:** O(N) where N is the total number of keys in all databases + +**Since:** 1.0.0 + +
+ +
+FLUSHDB - Remove all keys from the current database. + +**Syntax:** `FLUSHDB [ASYNC | SYNC]` + +**Description:** Remove all keys from the current database. + +**Complexity:** O(N) where N is the number of keys in the selected database + +**Since:** 1.0.0 + +
+ +
+HOTKEYS - A container for hotkeys tracking commands. + +**Syntax:** `HOTKEYS` + +**Description:** A container for hotkeys tracking commands. + +**Complexity:** Depends on subcommand. + +**Since:** 8.6.0 + +
+ +
+HOTKEYS GET - Returns lists of top K hotkeys depending on metrics chosen in HOTKEYS START command. + +**Syntax:** `HOTKEYS GET` + +**Description:** Returns lists of top K hotkeys depending on metrics chosen in HOTKEYS START command. + +**Complexity:** O(K) where K is the number of hotkeys returned. + +**Since:** 8.6.0 + +
+ +
+HOTKEYS RESET - Release the resources used for hotkey tracking. + +**Syntax:** `HOTKEYS RESET` + +**Description:** Release the resources used for hotkey tracking. + +**Complexity:** O(1) + +**Since:** 8.6.0 + +
+ +
+HOTKEYS START - Starts hotkeys tracking. + +**Syntax:** `HOTKEYS START METRICS count [CPU] [NET] [COUNT k] [DURATION seconds] [SAMPLE ratio] [SLOTS count slot [slot ...]]` + +**Description:** Starts hotkeys tracking. + +**Complexity:** O(1) + +**Since:** 8.6.0 + +
+ +
+HOTKEYS STOP - Stops hotkeys tracking. + +**Syntax:** `HOTKEYS STOP` + +**Description:** Stops hotkeys tracking. + +**Complexity:** O(1) + +**Since:** 8.6.0 + +
+ +
+INFO - Returns information and statistics about the server. + +**Syntax:** `INFO [section [section ...]]` + +**Description:** Returns information and statistics about the server. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+LASTSAVE - Returns the Unix timestamp of the last successful save to disk. + +**Syntax:** `LASTSAVE` + +**Description:** Returns the Unix timestamp of the last successful save to disk. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+LATENCY DOCTOR - Returns a human-readable latency analysis report. + +**Syntax:** `LATENCY DOCTOR` + +**Description:** Returns a human-readable latency analysis report. + +**Complexity:** O(1) + +**Since:** 2.8.13 + +
+ +
+LATENCY GRAPH - Returns a latency graph for an event. + +**Syntax:** `LATENCY GRAPH event` + +**Description:** Returns a latency graph for an event. + +**Complexity:** O(1) + +**Since:** 2.8.13 + +
+ +
+LATENCY HISTOGRAM - Returns the cumulative distribution of latencies of a subset or all commands. + +**Syntax:** `LATENCY HISTOGRAM [command [command ...]]` + +**Description:** Returns the cumulative distribution of latencies of a subset or all commands. + +**Complexity:** O(N) where N is the number of commands with latency information being retrieved. + +**Since:** 7.0.0 + +
+ +
+LATENCY HISTORY - Returns timestamp-latency samples for an event. + +**Syntax:** `LATENCY HISTORY event` + +**Description:** Returns timestamp-latency samples for an event. + +**Complexity:** O(1) + +**Since:** 2.8.13 + +
+ +
+LATENCY LATEST - Returns the latest latency samples for all events. + +**Syntax:** `LATENCY LATEST` + +**Description:** Returns the latest latency samples for all events. + +**Complexity:** O(1) + +**Since:** 2.8.13 + +
+ +
+LATENCY RESET - Resets the latency data for one or more events. + +**Syntax:** `LATENCY RESET [event [event ...]]` + +**Description:** Resets the latency data for one or more events. + +**Complexity:** O(1) + +**Since:** 2.8.13 + +
+ +
+LOLWUT - Displays computer art and the Redis version + +**Syntax:** `LOLWUT [VERSION version]` + +**Description:** Displays computer art and the Redis version + +**Complexity:** + +**Since:** 5.0.0 + +
+ +
+MEMORY DOCTOR - Outputs a memory problems report. + +**Syntax:** `MEMORY DOCTOR` + +**Description:** Outputs a memory problems report. + +**Complexity:** O(1) + +**Since:** 4.0.0 + +
+ +
+MEMORY MALLOC-STATS - Returns the allocator statistics. + +**Syntax:** `MEMORY MALLOC-STATS` + +**Description:** Returns the allocator statistics. + +**Complexity:** Depends on how much memory is allocated, could be slow + +**Since:** 4.0.0 + +
+ +
+MEMORY PURGE - Asks the allocator to release memory. + +**Syntax:** `MEMORY PURGE` + +**Description:** Asks the allocator to release memory. + +**Complexity:** Depends on how much memory is allocated, could be slow + +**Since:** 4.0.0 + +
+ +
+MEMORY STATS - Returns details about memory usage. + +**Syntax:** `MEMORY STATS` + +**Description:** Returns details about memory usage. + +**Complexity:** O(1) + +**Since:** 4.0.0 + +
+ +
+MEMORY USAGE - Estimates the memory usage of a key. + +**Syntax:** `MEMORY USAGE key [SAMPLES count]` + +**Description:** Estimates the memory usage of a key. + +**Complexity:** O(N) where N is the number of samples. + +**Since:** 4.0.0 + +
+ +
+MODULE LIST - Returns all loaded modules. + +**Syntax:** `MODULE LIST` + +**Description:** Returns all loaded modules. + +**Complexity:** O(N) where N is the number of loaded modules. + +**Since:** 4.0.0 + +
+ +
+MODULE LOAD - Loads a module. + +**Syntax:** `MODULE LOAD path [arg [arg ...]]` + +**Description:** Loads a module. + +**Complexity:** O(1) + +**Since:** 4.0.0 + +
+ +
+MODULE LOADEX - Loads a module using extended parameters. + +**Syntax:** `MODULE LOADEX path [CONFIG name value [CONFIG name value ...]] + [ARGS args [args ...]]` + +**Description:** Loads a module using extended parameters. + +**Complexity:** O(1) + +**Since:** 7.0.0 + +
+ +
+MODULE UNLOAD - Unloads a module. + +**Syntax:** `MODULE UNLOAD name` + +**Description:** Unloads a module. + +**Complexity:** O(1) + +**Since:** 4.0.0 + +
+ +
+MONITOR - Listens for all requests received by the server in real-time. + +**Syntax:** `MONITOR` + +**Description:** Listens for all requests received by the server in real-time. + +**Complexity:** + +**Since:** 1.0.0 + +
+ +
+PSYNC - An internal command used in replication. + +**Syntax:** `PSYNC replicationid offset` + +**Description:** An internal command used in replication. + +**Complexity:** + +**Since:** 2.8.0 + +
+ +
+REPLCONF - An internal command for configuring the replication stream. + +**Syntax:** `REPLCONF` + +**Description:** An internal command for configuring the replication stream. + +**Complexity:** O(1) + +**Since:** 3.0.0 + +
+ +
+REPLICAOF - Configures a server as replica of another, or promotes it to a master. + +**Syntax:** `REPLICAOF ` + +**Description:** Configures a server as replica of another, or promotes it to a master. + +**Complexity:** O(1) + +**Since:** 5.0.0 + +
+ +
+RESTORE-ASKING - An internal command for migrating keys in a cluster. + +**Syntax:** `RESTORE-ASKING key ttl serialized-value [REPLACE] [ABSTTL] + [IDLETIME seconds] [FREQ frequency]` + +**Description:** An internal command for migrating keys in a cluster. + +**Complexity:** O(1) to create the new key and additional O(N*M) to reconstruct the serialized value, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1). However for sorted set values the complexity is O(N*M*log(N)) because inserting values into sorted sets is O(log(N)). + +**Since:** 3.0.0 + +
+ +
+ROLE - Returns the replication role. + +**Syntax:** `ROLE` + +**Description:** Returns the replication role. + +**Complexity:** O(1) + +**Since:** 2.8.12 + +
+ +
+SAVE - Synchronously saves the database(s) to disk. + +**Syntax:** `SAVE` + +**Description:** Synchronously saves the database(s) to disk. + +**Complexity:** O(N) where N is the total number of keys in all databases + +**Since:** 1.0.0 + +
+ +
+SHUTDOWN - Synchronously saves the database(s) to disk and shuts down the Redis server. + +**Syntax:** `SHUTDOWN [NOSAVE | SAVE] [NOW] [FORCE] [ABORT]` + +**Description:** Synchronously saves the database(s) to disk and shuts down the Redis server. + +**Complexity:** O(N) when saving, where N is the total number of keys in all databases when saving data, otherwise O(1) + +**Since:** 1.0.0 + +
+ +
+SLAVEOF - Sets a Redis server as a replica of another, or promotes it to being a master. + +**Syntax:** `SLAVEOF ` + +**Description:** Sets a Redis server as a replica of another, or promotes it to being a master. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+SLOWLOG GET - Returns the slow log's entries. + +**Syntax:** `SLOWLOG GET [count]` + +**Description:** Returns the slow log's entries. + +**Complexity:** O(N) where N is the number of entries returned + +**Since:** 2.2.12 + +
+ +
+SLOWLOG LEN - Returns the number of entries in the slow log. + +**Syntax:** `SLOWLOG LEN` + +**Description:** Returns the number of entries in the slow log. + +**Complexity:** O(1) + +**Since:** 2.2.12 + +
+ +
+SLOWLOG RESET - Clears all entries from the slow log. + +**Syntax:** `SLOWLOG RESET` + +**Description:** Clears all entries from the slow log. + +**Complexity:** O(N) where N is the number of entries in the slowlog + +**Since:** 2.2.12 + +
+ +
+SWAPDB - Swaps two Redis databases. + +**Syntax:** `SWAPDB index1 index2` + +**Description:** Swaps two Redis databases. + +**Complexity:** O(N) where N is the count of clients watching or blocking on keys from both databases. + +**Since:** 4.0.0 + +
+ +
+SYNC - An internal command used in replication. + +**Syntax:** `SYNC` + +**Description:** An internal command used in replication. + +**Complexity:** + +**Since:** 1.0.0 + +
+ +
+TIME - Returns the server time. + +**Syntax:** `TIME` + +**Description:** Returns the server time. + +**Complexity:** O(1) + +**Since:** 2.6.0 + +
+ + +## Cluster commands + +Cluster commands manage Redis Cluster operations. + +
+ASKING - Signals that a cluster client is following an -ASK redirect. + +**Syntax:** `ASKING` + +**Description:** Signals that a cluster client is following an -ASK redirect. + +**Complexity:** O(1) + +**Since:** 3.0.0 + +
+ +
+CLUSTER ADDSLOTS - Assigns new hash slots to a node. + +**Syntax:** `CLUSTER ADDSLOTS slot [slot ...]` + +**Description:** Assigns new hash slots to a node. + +**Complexity:** O(N) where N is the total number of hash slot arguments + +**Since:** 3.0.0 + +
+ +
+CLUSTER ADDSLOTSRANGE - Assigns new hash slot ranges to a node. + +**Syntax:** `CLUSTER ADDSLOTSRANGE start-slot end-slot [start-slot end-slot ...]` + +**Description:** Assigns new hash slot ranges to a node. + +**Complexity:** O(N) where N is the total number of the slots between the start slot and end slot arguments. + +**Since:** 7.0.0 + +
+ +
+CLUSTER BUMPEPOCH - Advances the cluster config epoch. + +**Syntax:** `CLUSTER BUMPEPOCH` + +**Description:** Advances the cluster config epoch. + +**Complexity:** O(1) + +**Since:** 3.0.0 + +
+ +
+CLUSTER COUNT-FAILURE-REPORTS - Returns the number of active failure reports active for a node. + +**Syntax:** `CLUSTER COUNT-FAILURE-REPORTS node-id` + +**Description:** Returns the number of active failure reports active for a node. + +**Complexity:** O(N) where N is the number of failure reports + +**Since:** 3.0.0 + +
+ +
+CLUSTER COUNTKEYSINSLOT - Returns the number of keys in a hash slot. + +**Syntax:** `CLUSTER COUNTKEYSINSLOT slot` + +**Description:** Returns the number of keys in a hash slot. + +**Complexity:** O(1) + +**Since:** 3.0.0 + +
+ +
+CLUSTER DELSLOTS - Sets hash slots as unbound for a node. + +**Syntax:** `CLUSTER DELSLOTS slot [slot ...]` + +**Description:** Sets hash slots as unbound for a node. + +**Complexity:** O(N) where N is the total number of hash slot arguments + +**Since:** 3.0.0 + +
+ +
+CLUSTER DELSLOTSRANGE - Sets hash slot ranges as unbound for a node. + +**Syntax:** `CLUSTER DELSLOTSRANGE start-slot end-slot [start-slot end-slot ...]` + +**Description:** Sets hash slot ranges as unbound for a node. + +**Complexity:** O(N) where N is the total number of the slots between the start slot and end slot arguments. + +**Since:** 7.0.0 + +
+ +
+CLUSTER FAILOVER - Forces a replica to perform a manual failover of its master. + +**Syntax:** `CLUSTER FAILOVER [FORCE | TAKEOVER]` + +**Description:** Forces a replica to perform a manual failover of its master. + +**Complexity:** O(1) + +**Since:** 3.0.0 + +
+ +
+CLUSTER FLUSHSLOTS - Deletes all slots information from a node. + +**Syntax:** `CLUSTER FLUSHSLOTS` + +**Description:** Deletes all slots information from a node. + +**Complexity:** O(1) + +**Since:** 3.0.0 + +
+ +
+CLUSTER FORGET - Removes a node from the nodes table. + +**Syntax:** `CLUSTER FORGET node-id` + +**Description:** Removes a node from the nodes table. + +**Complexity:** O(1) + +**Since:** 3.0.0 + +
+ +
+CLUSTER GETKEYSINSLOT - Returns the key names in a hash slot. + +**Syntax:** `CLUSTER GETKEYSINSLOT slot count` + +**Description:** Returns the key names in a hash slot. + +**Complexity:** O(N) where N is the number of requested keys + +**Since:** 3.0.0 + +
+ +
+CLUSTER INFO - Returns information about the state of a node. + +**Syntax:** `CLUSTER INFO` + +**Description:** Returns information about the state of a node. + +**Complexity:** O(1) + +**Since:** 3.0.0 + +
+ +
+CLUSTER KEYSLOT - Returns the hash slot for a key. + +**Syntax:** `CLUSTER KEYSLOT key` + +**Description:** Returns the hash slot for a key. + +**Complexity:** O(N) where N is the number of bytes in the key + +**Since:** 3.0.0 + +
+ +
+CLUSTER LINKS - Returns a list of all TCP links to and from peer nodes. + +**Syntax:** `CLUSTER LINKS` + +**Description:** Returns a list of all TCP links to and from peer nodes. + +**Complexity:** O(N) where N is the total number of Cluster nodes + +**Since:** 7.0.0 + +
+ +
+CLUSTER MEET - Forces a node to handshake with another node. + +**Syntax:** `CLUSTER MEET ip port [cluster-bus-port]` + +**Description:** Forces a node to handshake with another node. + +**Complexity:** O(1) + +**Since:** 3.0.0 + +
+ +
+CLUSTER MIGRATION - Start, monitor, and cancel atomic slot migration tasks. + +**Syntax:** `CLUSTER MIGRATION | + STATUS <[ID task-id] | [ALL]>>` + +**Description:** Start, monitor, and cancel atomic slot migration tasks. + +**Complexity:** O(N) where N is the total number of the slots between the start slot and end slot arguments. + +**Since:** 8.4.0 + +
+ +
+CLUSTER MYID - Returns the ID of a node. + +**Syntax:** `CLUSTER MYID` + +**Description:** Returns the ID of a node. + +**Complexity:** O(1) + +**Since:** 3.0.0 + +
+ +
+CLUSTER MYSHARDID - Returns the shard ID of a node. + +**Syntax:** `CLUSTER MYSHARDID` + +**Description:** Returns the shard ID of a node. + +**Complexity:** O(1) + +**Since:** 7.2.0 + +
+ +
+CLUSTER NODES - Returns the cluster configuration for a node. + +**Syntax:** `CLUSTER NODES` + +**Description:** Returns the cluster configuration for a node. + +**Complexity:** O(N) where N is the total number of Cluster nodes + +**Since:** 3.0.0 + +
+ +
+CLUSTER REPLICAS - Lists the replica nodes of a master node. + +**Syntax:** `CLUSTER REPLICAS node-id` + +**Description:** Lists the replica nodes of a master node. + +**Complexity:** O(N) where N is the number of replicas. + +**Since:** 5.0.0 + +
+ +
+CLUSTER REPLICATE - Configure a node as replica of a master node. + +**Syntax:** `CLUSTER REPLICATE node-id` + +**Description:** Configure a node as replica of a master node. + +**Complexity:** O(1) + +**Since:** 3.0.0 + +
+ +
+CLUSTER RESET - Resets a node. + +**Syntax:** `CLUSTER RESET [HARD | SOFT]` + +**Description:** Resets a node. + +**Complexity:** O(N) where N is the number of known nodes. The command may execute a FLUSHALL as a side effect. + +**Since:** 3.0.0 + +
+ +
+CLUSTER SAVECONFIG - Forces a node to save the cluster configuration to disk. + +**Syntax:** `CLUSTER SAVECONFIG` + +**Description:** Forces a node to save the cluster configuration to disk. + +**Complexity:** O(1) + +**Since:** 3.0.0 + +
+ +
+CLUSTER SET-CONFIG-EPOCH - Sets the configuration epoch for a new node. + +**Syntax:** `CLUSTER SET-CONFIG-EPOCH config-epoch` + +**Description:** Sets the configuration epoch for a new node. + +**Complexity:** O(1) + +**Since:** 3.0.0 + +
+ +
+CLUSTER SETSLOT - Binds a hash slot to a node. + +**Syntax:** `CLUSTER SETSLOT slot ` + +**Description:** Binds a hash slot to a node. + +**Complexity:** O(1) + +**Since:** 3.0.0 + +
+ +
+CLUSTER SHARDS - Returns the mapping of cluster slots to shards. + +**Syntax:** `CLUSTER SHARDS` + +**Description:** Returns the mapping of cluster slots to shards. + +**Complexity:** O(N) where N is the total number of cluster nodes + +**Since:** 7.0.0 + +
+ +
+CLUSTER SLAVES - Lists the replica nodes of a master node. + +**Syntax:** `CLUSTER SLAVES node-id` + +**Description:** Lists the replica nodes of a master node. + +**Complexity:** O(N) where N is the number of replicas. + +**Since:** 3.0.0 + +
+ +
+CLUSTER SLOT-STATS - Return an array of slot usage statistics for slots assigned to the current node. + +**Syntax:** `CLUSTER SLOT-STATS ` + +**Description:** Return an array of slot usage statistics for slots assigned to the current node. + +**Complexity:** O(N) where N is the total number of slots based on arguments. O(N*log(N)) with ORDERBY subcommand. + +**Since:** 8.2.0 + +
+ +
+CLUSTER SLOTS - Returns the mapping of cluster slots to nodes. + +**Syntax:** `CLUSTER SLOTS` + +**Description:** Returns the mapping of cluster slots to nodes. + +**Complexity:** O(N) where N is the total number of Cluster nodes + +**Since:** 3.0.0 + +
+ +
+READONLY - Enables read-only queries for a connection to a Redis Cluster replica node. + +**Syntax:** `READONLY` + +**Description:** Enables read-only queries for a connection to a Redis Cluster replica node. + +**Complexity:** O(1) + +**Since:** 3.0.0 + +
+ +
+READWRITE - Enables read-write queries for a connection to a Reids Cluster replica node. + +**Syntax:** `READWRITE` + +**Description:** Enables read-write queries for a connection to a Reids Cluster replica node. + +**Complexity:** O(1) + +**Since:** 3.0.0 + +
+ + +## Generic commands + +Generic commands work across all data types. + +
+COPY - Copies the value of a key to a new key. + +**Syntax:** `COPY source destination [DB destination-db] [REPLACE]` + +**Description:** Copies the value of a key to a new key. + +**Complexity:** O(N) worst case for collections, where N is the number of nested items. O(1) for string values. + +**Since:** 6.2.0 + +
+ +
+DEL - Deletes one or more keys. + +**Syntax:** `DEL key [key ...]` + +**Description:** Deletes one or more keys. + +**Complexity:** O(N) where N is the number of keys that will be removed. When a key to remove holds a value other than a string, the individual complexity for this key is O(M) where M is the number of elements in the list, set, sorted set or hash. Removing a single key that holds a string value is O(1). + +**Since:** 1.0.0 + +
+ +
+DUMP - Returns a serialized representation of the value stored at a key. + +**Syntax:** `DUMP key` + +**Description:** Returns a serialized representation of the value stored at a key. + +**Complexity:** O(1) to access the key and additional O(N*M) to serialize it, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1). + +**Since:** 2.6.0 + +
+ +
+EXISTS - Determines whether one or more keys exist. + +**Syntax:** `EXISTS key [key ...]` + +**Description:** Determines whether one or more keys exist. + +**Complexity:** O(N) where N is the number of keys to check. + +**Since:** 1.0.0 + +
+ +
+EXPIRE - Sets the expiration time of a key in seconds. + +**Syntax:** `EXPIRE key seconds [NX | XX | GT | LT]` + +**Description:** Sets the expiration time of a key in seconds. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+EXPIREAT - Sets the expiration time of a key to a Unix timestamp. + +**Syntax:** `EXPIREAT key unix-time-seconds [NX | XX | GT | LT]` + +**Description:** Sets the expiration time of a key to a Unix timestamp. + +**Complexity:** O(1) + +**Since:** 1.2.0 + +
+ +
+EXPIRETIME - Returns the expiration time of a key as a Unix timestamp. + +**Syntax:** `EXPIRETIME key` + +**Description:** Returns the expiration time of a key as a Unix timestamp. + +**Complexity:** O(1) + +**Since:** 7.0.0 + +
+ +
+KEYS - Returns all key names that match a pattern. + +**Syntax:** `KEYS pattern` + +**Description:** Returns all key names that match a pattern. + +**Complexity:** O(N) with N being the number of keys in the database, under the assumption that the key names in the database and the given pattern have limited length. + +**Since:** 1.0.0 + +
+ +
+MIGRATE - Atomically transfers a key from one Redis instance to another. + +**Syntax:** `MIGRATE host port destination-db timeout [COPY] [REPLACE] + [AUTH password | AUTH2 username password] [KEYS key [key ...]]` + +**Description:** Atomically transfers a key from one Redis instance to another. + +**Complexity:** This command actually executes a DUMP+DEL in the source instance, and a RESTORE in the target instance. See the pages of these commands for time complexity. Also an O(N) data transfer between the two instances is performed. + +**Since:** 2.6.0 + +
+ +
+MOVE - Moves a key to another database. + +**Syntax:** `MOVE key db` + +**Description:** Moves a key to another database. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+OBJECT ENCODING - Returns the internal encoding of a Redis object. + +**Syntax:** `OBJECT ENCODING key` + +**Description:** Returns the internal encoding of a Redis object. + +**Complexity:** O(1) + +**Since:** 2.2.3 + +
+ +
+OBJECT FREQ - Returns the logarithmic access frequency counter of a Redis object. + +**Syntax:** `OBJECT FREQ key` + +**Description:** Returns the logarithmic access frequency counter of a Redis object. + +**Complexity:** O(1) + +**Since:** 4.0.0 + +
+ +
+OBJECT IDLETIME - Returns the time since the last access to a Redis object. + +**Syntax:** `OBJECT IDLETIME key` + +**Description:** Returns the time since the last access to a Redis object. + +**Complexity:** O(1) + +**Since:** 2.2.3 + +
+ +
+OBJECT REFCOUNT - Returns the reference count of a value of a key. + +**Syntax:** `OBJECT REFCOUNT key` + +**Description:** Returns the reference count of a value of a key. + +**Complexity:** O(1) + +**Since:** 2.2.3 + +
+ +
+PERSIST - Removes the expiration time of a key. + +**Syntax:** `PERSIST key` + +**Description:** Removes the expiration time of a key. + +**Complexity:** O(1) + +**Since:** 2.2.0 + +
+ +
+PEXPIRE - Sets the expiration time of a key in milliseconds. + +**Syntax:** `PEXPIRE key milliseconds [NX | XX | GT | LT]` + +**Description:** Sets the expiration time of a key in milliseconds. + +**Complexity:** O(1) + +**Since:** 2.6.0 + +
+ +
+PEXPIREAT - Sets the expiration time of a key to a Unix milliseconds timestamp. + +**Syntax:** `PEXPIREAT key unix-time-milliseconds [NX | XX | GT | LT]` + +**Description:** Sets the expiration time of a key to a Unix milliseconds timestamp. + +**Complexity:** O(1) + +**Since:** 2.6.0 + +
+ +
+PEXPIRETIME - Returns the expiration time of a key as a Unix milliseconds timestamp. + +**Syntax:** `PEXPIRETIME key` + +**Description:** Returns the expiration time of a key as a Unix milliseconds timestamp. + +**Complexity:** O(1) + +**Since:** 7.0.0 + +
+ +
+PTTL - Returns the expiration time in milliseconds of a key. + +**Syntax:** `PTTL key` + +**Description:** Returns the expiration time in milliseconds of a key. + +**Complexity:** O(1) + +**Since:** 2.6.0 + +
+ +
+RANDOMKEY - Returns a random key name from the database. + +**Syntax:** `RANDOMKEY` + +**Description:** Returns a random key name from the database. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+RENAME - Renames a key and overwrites the destination. + +**Syntax:** `RENAME key newkey` + +**Description:** Renames a key and overwrites the destination. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+RENAMENX - Renames a key only when the target key name doesn't exist. + +**Syntax:** `RENAMENX key newkey` + +**Description:** Renames a key only when the target key name doesn't exist. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+RESTORE - Creates a key from the serialized representation of a value. + +**Syntax:** `RESTORE key ttl serialized-value [REPLACE] [ABSTTL] + [IDLETIME seconds] [FREQ frequency]` + +**Description:** Creates a key from the serialized representation of a value. + +**Complexity:** O(1) to create the new key and additional O(N*M) to reconstruct the serialized value, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1). However for sorted set values the complexity is O(N*M*log(N)) because inserting values into sorted sets is O(log(N)). + +**Since:** 2.6.0 + +
+ +
+Redis 6.2 Commands Reference - Complete list of all Redis commands available in version 6.2, organized by functional group + +**Syntax:** `` + +**Description:** Complete list of all Redis commands available in version 6.2, organized by functional group + +**Complexity:** + +**Since:** + +
+ +
+Redis 7.2 Commands Reference - Complete list of all Redis commands available in version 7.2, organized by functional group + +**Syntax:** `` + +**Description:** Complete list of all Redis commands available in version 7.2, organized by functional group + +**Complexity:** + +**Since:** + +
+ +
+Redis 7.4 Commands Reference - Complete list of all Redis commands available in version 7.4, organized by functional group + +**Syntax:** `` + +**Description:** Complete list of all Redis commands available in version 7.4, organized by functional group + +**Complexity:** + +**Since:** + +
+ +
+Redis 8.0 Commands Reference - Complete list of all Redis commands available in version 8.0, organized by functional group + +**Syntax:** `` + +**Description:** Complete list of all Redis commands available in version 8.0, organized by functional group + +**Complexity:** + +**Since:** + +
+ +
+Redis 8.2 Commands Reference - Complete list of all Redis commands available in version 8.2, organized by functional group + +**Syntax:** `` + +**Description:** Complete list of all Redis commands available in version 8.2, organized by functional group + +**Complexity:** + +**Since:** + +
+ +
+Redis 8.4 Commands Reference - Complete list of all Redis commands available in version 8.4, organized by functional group + +**Syntax:** `` + +**Description:** Complete list of all Redis commands available in version 8.4, organized by functional group + +**Complexity:** + +**Since:** + +
+ +
+Redis 8.6 Commands Reference - Complete list of all Redis commands available in version 8.6, organized by functional group + +**Syntax:** `` + +**Description:** Complete list of all Redis commands available in version 8.6, organized by functional group + +**Complexity:** + +**Since:** + +
+ +
+SCAN - Iterates over the key names in the database. + +**Syntax:** `SCAN cursor [MATCH pattern] [COUNT count] [TYPE type]` + +**Description:** Iterates over the key names in the database. + +**Complexity:** O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection. + +**Since:** 2.8.0 + +
+ +
+SORT - Sorts the elements in a list, a set, or a sorted set, optionally storing the result. + +**Syntax:** `SORT key [BY pattern] [LIMIT offset count] [GET pattern [GET pattern + ...]] [ASC | DESC] [ALPHA] [STORE destination]` + +**Description:** Sorts the elements in a list, a set, or a sorted set, optionally storing the result. + +**Complexity:** O(N+M*log(M)) where N is the number of elements in the list or set to sort, and M the number of returned elements. When the elements are not sorted, complexity is O(N). + +**Since:** 1.0.0 + +
+ +
+SORT_RO - Returns the sorted elements of a list, a set, or a sorted set. + +**Syntax:** `SORT RO key [BY pattern] [LIMIT offset count] [GET pattern [GET + pattern ...]] [ASC | DESC] [ALPHA]` + +**Description:** Returns the sorted elements of a list, a set, or a sorted set. + +**Complexity:** O(N+M*log(M)) where N is the number of elements in the list or set to sort, and M the number of returned elements. When the elements are not sorted, complexity is O(N). + +**Since:** 7.0.0 + +
+ +
+TOUCH - Returns the number of existing keys out of those specified after updating the time they were last accessed. + +**Syntax:** `TOUCH key [key ...]` + +**Description:** Returns the number of existing keys out of those specified after updating the time they were last accessed. + +**Complexity:** O(N) where N is the number of keys that will be touched. + +**Since:** 3.2.1 + +
+ +
+TTL - Returns the expiration time in seconds of a key. + +**Syntax:** `TTL key` + +**Description:** Returns the expiration time in seconds of a key. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+TYPE - Determines the type of value stored at a key. + +**Syntax:** `TYPE key` + +**Description:** Determines the type of value stored at a key. + +**Complexity:** O(1) + +**Since:** 1.0.0 + +
+ +
+UNLINK - Asynchronously deletes one or more keys. + +**Syntax:** `UNLINK key [key ...]` + +**Description:** Asynchronously deletes one or more keys. + +**Complexity:** O(1) for each key removed regardless of its size. Then the command does O(N) work in a different thread in order to reclaim memory, where N is the number of allocations the deleted objects where composed of. + +**Since:** 4.0.0 + +
+ +
+WAIT - Blocks until the asynchronous replication of all preceding write commands sent by the connection is completed. + +**Syntax:** `WAIT numreplicas timeout` + +**Description:** Blocks until the asynchronous replication of all preceding write commands sent by the connection is completed. + +**Complexity:** O(1) + +**Since:** 3.0.0 + +
+ +
+WAITAOF - Blocks until all of the preceding write commands sent by the connection are written to the append-only file of the master and/or replicas. + +**Syntax:** `WAITAOF numlocal numreplicas timeout` + +**Description:** Blocks until all of the preceding write commands sent by the connection are written to the append-only file of the master and/or replicas. + +**Complexity:** O(1) + +**Since:** 7.2.0 + +
+ + diff --git a/content/commands/ts.mrange.md b/content/commands/ts.mrange.md index b016ad17a2..3e407fd9b4 100644 --- a/content/commands/ts.mrange.md +++ b/content/commands/ts.mrange.md @@ -53,50 +53,9 @@ arguments: optional: true token: ALIGN type: integer - - arguments: - - name: avg - token: AVG - type: pure-token - - name: first - token: FIRST - type: pure-token - - name: last - token: LAST - type: pure-token - - name: min - token: MIN - type: pure-token - - name: max - token: MAX - type: pure-token - - name: sum - token: SUM - type: pure-token - - name: range - token: RANGE - type: pure-token - - name: count - token: COUNT - type: pure-token - - name: std.p - token: STD.P - type: pure-token - - name: std.s - token: STD.S - type: pure-token - - name: var.p - token: VAR.P - type: pure-token - - name: var.s - token: VAR.S - type: pure-token - - name: twa - since: 1.8.0 - token: TWA - type: pure-token - name: aggregator + - name: aggregationType token: AGGREGATION - type: oneof + type: string - name: bucketDuration type: integer - name: buckettimestamp @@ -165,15 +124,14 @@ stack_path: docs/data-types/timeseries summary: Query a range across multiple time series by filters in forward direction syntax: "TS.MRANGE fromTimestamp toTimestamp\n [LATEST]\n [FILTER_BY_TS ts...]\n\ \ [FILTER_BY_VALUE min max]\n [WITHLABELS | ]\n [COUNT\ - \ count]\n [[ALIGN align] AGGREGATION aggregator bucketDuration [BUCKETTIMESTAMP\ + \ count]\n [[ALIGN align] AGGREGATION aggregators bucketDuration [BUCKETTIMESTAMP\ \ bt] [EMPTY]]\n FILTER filterExpr...\n [GROUPBY label REDUCE reducer]\n" syntax_fmt: "TS.MRANGE fromTimestamp toTimestamp [LATEST] [FILTER_BY_TS\_Timestamp\n\ \ [Timestamp ...]] [FILTER_BY_VALUE min max] [WITHLABELS |\n SELECTED_LABELS label1\ - \ [label1 ...]] [COUNT\_count] [[ALIGN\_value]\n AGGREGATION\_ bucketDuration\n\ - \ [BUCKETTIMESTAMP] [EMPTY]] FILTER\_\ - \ [GROUPBY label REDUCE\n reducer]" + \ [label1 ...]] [COUNT\_count] [[ALIGN\_value]\n AGGREGATION\ aggregators bucketDuration\ + \ [BUCKETTIMESTAMP]\n [EMPTY]] FILTER\_\ + \ [GROUPBY label REDUCE reducer]" title: TS.MRANGE --- {{< note >}} @@ -288,13 +246,13 @@ Values include:
-AGGREGATION aggregator bucketDuration +AGGREGATION aggregators bucketDuration -per time series, aggregates samples into time buckets, where: +for each time series, aggregates samples into time buckets, where: - - `aggregator` takes one of the following aggregation types: + - `aggregators` is one or more comma-separated aggregators from the following table: - | `aggregator` | Description | + | aggregator | Description | | ------------ | --------------------------------------------------------------- | | `avg` | Arithmetic mean of all non-NaN values | | `sum` | Sum of all non-NaN values | @@ -313,6 +271,11 @@ per time series, aggregates samples into time buckets, where: | `twa` | Time-weighted average over the bucket's timeframe (ignores NaN values) (since RedisTimeSeries 1.8) | - `bucketDuration` is duration of each bucket, in milliseconds. + + Note: `aggregators` can either be a single aggregator or multiple aggregators separated by commas as shown below. + No whitespace is allowed between aggregators. + + AGGREGATION min,avg,max Without `ALIGN`, bucket start times are multiples of `bucketDuration`. @@ -338,7 +301,7 @@ controls how bucket timestamps are reported. is a flag, which, when specified, reports aggregations also for empty buckets. -| `aggregator` | Value reported for each empty bucket | +| aggregator | Value reported for each empty bucket | | -------------------- | ------------------------------------ | | `sum`, `count` | `0` | | `last` | The value of the last sample before the bucket's start. `NaN` when no such sample. | @@ -354,6 +317,7 @@ Regardless of the values of `fromTimestamp` and `toTimestamp`, no data is report splits time series into groups, each group contains time series that share the same value for the provided label name, then aggregates results in each group. When combined with `AGGREGATION` the `GROUPBY`/`REDUCE` is applied post aggregation stage. +`GROUPBY`/`REDUCE` is not permitted when multiple aggregators are specified. - `label` is label name. A group is created for all time series that share the same value for this label. diff --git a/content/commands/ts.mrevrange.md b/content/commands/ts.mrevrange.md index 55f5fca968..f4f83e829c 100644 --- a/content/commands/ts.mrevrange.md +++ b/content/commands/ts.mrevrange.md @@ -53,50 +53,9 @@ arguments: optional: true token: ALIGN type: integer - - arguments: - - name: avg - token: AVG - type: pure-token - - name: first - token: FIRST - type: pure-token - - name: last - token: LAST - type: pure-token - - name: min - token: MIN - type: pure-token - - name: max - token: MAX - type: pure-token - - name: sum - token: SUM - type: pure-token - - name: range - token: RANGE - type: pure-token - - name: count - token: COUNT - type: pure-token - - name: std.p - token: STD.P - type: pure-token - - name: std.s - token: STD.S - type: pure-token - - name: var.p - token: VAR.P - type: pure-token - - name: var.s - token: VAR.S - type: pure-token - - name: twa - since: 1.8.0 - token: TWA - type: pure-token - name: aggregator + - name: aggregators token: AGGREGATION - type: oneof + type: string - name: bucketDuration type: integer - name: buckettimestamp @@ -165,15 +124,14 @@ stack_path: docs/data-types/timeseries summary: Query a range across multiple time-series by filters in reverse direction syntax: "TS.MREVRANGE fromTimestamp toTimestamp\n [LATEST]\n [FILTER_BY_TS ts...]\n\ \ [FILTER_BY_VALUE min max]\n [WITHLABELS | ]\n [COUNT\ - \ count]\n [[ALIGN align] AGGREGATION aggregator bucketDuration [BUCKETTIMESTAMP\ + \ count]\n [[ALIGN align] AGGREGATION aggregators bucketDuration [BUCKETTIMESTAMP\ \ bt] [EMPTY]]\n FILTER filterExpr...\n [GROUPBY label REDUCE reducer]\n" syntax_fmt: "TS.MREVRANGE fromTimestamp toTimestamp [LATEST]\n [FILTER_BY_TS\_Timestamp\ \ [Timestamp ...]] [FILTER_BY_VALUE min max]\n [WITHLABELS | SELECTED_LABELS label1\ - \ [label1 ...]] [COUNT\_count]\n [[ALIGN\_value] AGGREGATION\_\n\ - \ bucketDuration [BUCKETTIMESTAMP] [EMPTY]] FILTER\_ [GROUPBY label REDUCE\n reducer]" + \ [label1 ...]] [COUNT\_count]\n [[ALIGN\_value] AGGREGATION\ aggregators bucketDuration\n\ + \ [BUCKETTIMESTAMP] [EMPTY]] FILTER\_\ + \ [GROUPBY label REDUCE\n reducer]" title: TS.MREVRANGE --- {{< note >}} @@ -288,13 +246,13 @@ Values include:
-AGGREGATION aggregator bucketDuration +AGGREGATION aggregators bucketDuration -per time series, aggregates samples into time buckets, where: +for each time series, aggregates samples into time buckets, where: - - `aggregator` takes one of the following aggregation types: + - `aggregators` is one or more comma-separated aggregators from the following table: - | `aggregator` | Description | + | aggregator | Description | | ------------ | --------------------------------------------------------------- | | `avg` | Arithmetic mean of all non-NaN values | | `sum` | Sum of all non-NaN values | @@ -313,6 +271,11 @@ per time series, aggregates samples into time buckets, where: | `twa` | Time-weighted average over the bucket's timeframe (ignores NaN values) (since RedisTimeSeries 1.8) | - `bucketDuration` is duration of each bucket, in milliseconds. + + Note: `aggregators` can either be a single aggregator or multiple aggregators separated by commas as shown below. + No whitespace is allowed between aggregators. + + AGGREGATION min,avg,max Without `ALIGN`, bucket start times are multiples of `bucketDuration`. @@ -338,7 +301,7 @@ controls how bucket timestamps are reported. is a flag, which, when specified, reports aggregations also for empty buckets. -| `aggregator` | Value reported for each empty bucket | +| aggregator | Value reported for each empty bucket | | -------------------- | ------------------------------------ | | `sum`, `count` | `0` | | `last` | The value of the last sample before the bucket's start. `NaN` when no such sample. | @@ -354,6 +317,7 @@ Regardless of the values of `fromTimestamp` and `toTimestamp`, no data is report splits time series into groups, each group contains time series that share the same value for the provided label name, then aggregates results in each group. When combined with `AGGREGATION` the `GROUPBY`/`REDUCE` is applied post aggregation stage. +`GROUPBY`/`REDUCE` is not permitted when multiple aggregators are specified. - `label` is label name. A group is created for all time series that share the same value for this label. diff --git a/content/commands/ts.range.md b/content/commands/ts.range.md index 398a9ed1bc..c9e31434f4 100644 --- a/content/commands/ts.range.md +++ b/content/commands/ts.range.md @@ -39,50 +39,9 @@ arguments: optional: true token: ALIGN type: integer - - arguments: - - name: avg - token: AVG - type: pure-token - - name: first - token: FIRST - type: pure-token - - name: last - token: LAST - type: pure-token - - name: min - token: MIN - type: pure-token - - name: max - token: MAX - type: pure-token - - name: sum - token: SUM - type: pure-token - - name: range - token: RANGE - type: pure-token - - name: count - token: COUNT - type: pure-token - - name: std.p - token: STD.P - type: pure-token - - name: std.s - token: STD.S - type: pure-token - - name: var.p - token: VAR.P - type: pure-token - - name: var.s - token: VAR.S - type: pure-token - - name: twa - since: 1.8.0 - token: TWA - type: pure-token - name: aggregator + - name: aggregators token: AGGREGATION - type: oneof + type: string - name: bucketDuration type: integer - name: buckettimestamp @@ -120,12 +79,11 @@ since: 1.0.0 stack_path: docs/data-types/timeseries summary: Query a range in forward direction syntax: "TS.RANGE key fromTimestamp toTimestamp\n [LATEST]\n [FILTER_BY_TS ts...]\n\ - \ [FILTER_BY_VALUE min max]\n [COUNT count] \n [[ALIGN align] AGGREGATION aggregator\ + \ [FILTER_BY_VALUE min max]\n [COUNT count] \n [[ALIGN align] AGGREGATION aggregators\ \ bucketDuration [BUCKETTIMESTAMP bt] [EMPTY]]\n" syntax_fmt: "TS.RANGE key fromTimestamp toTimestamp [LATEST]\n [FILTER_BY_TS\_Timestamp\ \ [Timestamp ...]] [FILTER_BY_VALUE min max]\n [COUNT\_count] [[ALIGN\_value] AGGREGATION\_\ - \n bucketDuration [BUCKETTIMESTAMP] [EMPTY]]" + aggregators bucketDuration [BUCKETTIMESTAMP] [EMPTY]]" title: TS.RANGE --- @@ -204,13 +162,13 @@ is a time bucket alignment control for `AGGREGATION`. It controls the time bucke
-AGGREGATION aggregator bucketDuration +AGGREGATION aggregators bucketDuration -aggregates samples into time buckets, where: +for each time series, aggregates samples into time buckets, where: - - `aggregator` takes one of the following aggregation types: + - `aggregators` is one or more comma-separated aggregators from the following table: - | `aggregator` | Description | + | aggregator | Description | | ------------ | --------------------------------------------------------------- | | `avg` | Arithmetic mean of all non-NaN values | | `sum` | Sum of all non-NaN values | @@ -229,6 +187,11 @@ aggregates samples into time buckets, where: | `twa` | Time-weighted average over the bucket's timeframe (ignores NaN values) (since RedisTimeSeries 1.8) | - `bucketDuration` is duration of each bucket, in milliseconds. + + Note: `aggregators` can either be a single aggregator or multiple aggregators separated by commas as shown below. + No whitespace is allowed between aggregators. + + AGGREGATION min,avg,max Without `ALIGN`, bucket start times are multiples of `bucketDuration`. @@ -254,7 +217,7 @@ controls how bucket timestamps are reported. is a flag, which, when specified, reports aggregations also for empty buckets. -| `aggregator` | Value reported for each empty bucket | +| aggregator | Value reported for each empty bucket | | -------------------- | ------------------------------------ | | `sum`, `count` | `0` | | `last` | The value of the last sample before the bucket's start. `NaN` when no such sample. | @@ -297,12 +260,14 @@ TS.RANGE temp:TLV - + FILTER_BY_VALUE -100 100 2) 40 {{< / highlight >}} -Now, retrieve the average value, while ignoring out-of-range values. +Now, retrieve the minimum, average, and maximum values, while ignoring out-of-range values. {{< highlight bash >}} -TS.RANGE temp:TLV - + FILTER_BY_VALUE -100 100 AGGREGATION avg 1000 +TS.RANGE temp:TLV - + FILTER_BY_VALUE -100 100 AGGREGATION min,avg,max 1000 1) 1) (integer) 1000 - 2) 35 + 2) 30 + 3) 35 + 4) 40 {{< / highlight >}}
diff --git a/content/commands/ts.revrange.md b/content/commands/ts.revrange.md index 450f590d8c..c9733ca829 100644 --- a/content/commands/ts.revrange.md +++ b/content/commands/ts.revrange.md @@ -39,50 +39,9 @@ arguments: optional: true token: ALIGN type: integer - - arguments: - - name: avg - token: AVG - type: pure-token - - name: first - token: FIRST - type: pure-token - - name: last - token: LAST - type: pure-token - - name: min - token: MIN - type: pure-token - - name: max - token: MAX - type: pure-token - - name: sum - token: SUM - type: pure-token - - name: range - token: RANGE - type: pure-token - - name: count - token: COUNT - type: pure-token - - name: std.p - token: STD.P - type: pure-token - - name: std.s - token: STD.S - type: pure-token - - name: var.p - token: VAR.P - type: pure-token - - name: var.s - token: VAR.S - type: pure-token - - name: twa - since: 1.8.0 - token: TWA - type: pure-token - name: aggregator + - name: aggregators token: AGGREGATION - type: oneof + type: string - name: bucketDuration type: integer - name: buckettimestamp @@ -120,12 +79,12 @@ since: 1.4.0 stack_path: docs/data-types/timeseries summary: Query a range in reverse direction syntax: "TS.REVRANGE key fromTimestamp toTimestamp\n [LATEST]\n [FILTER_BY_TS ts...]\n\ - \ [FILTER_BY_VALUE min max]\n [COUNT count]\n [[ALIGN align] AGGREGATION aggregator\ + \ [FILTER_BY_VALUE min max]\n [COUNT count]\n [[ALIGN align] AGGREGATION aggregators\ \ bucketDuration [BUCKETTIMESTAMP bt] [EMPTY]]\n" syntax_fmt: "TS.REVRANGE key fromTimestamp toTimestamp [LATEST]\n [FILTER_BY_TS\_\ Timestamp [Timestamp ...]] [FILTER_BY_VALUE min max]\n [COUNT\_count] [[ALIGN\_\ - value] AGGREGATION\_\n bucketDuration [BUCKETTIMESTAMP] [EMPTY]]" + value] AGGREGATION\_aggregators\n bucketDuration [BUCKETTIMESTAMP]\ + \ [EMPTY]]" title: TS.REVRANGE --- @@ -205,12 +164,13 @@ Values include:
-AGGREGATION aggregator bucketDuration -aggregates samples into time buckets, where: +AGGREGATION aggregators bucketDuration - - `aggregator` takes one of the following aggregation types: +for each time series, aggregates samples into time buckets, where: - | `aggregator` | Description | + - `aggregators` is one or more comma-separated aggregators from the following table: + + | aggregator | Description | | ------------ | --------------------------------------------------------------- | | `avg` | Arithmetic mean of all non-NaN values | | `sum` | Sum of all non-NaN values | @@ -229,7 +189,12 @@ aggregates samples into time buckets, where: | `twa` | Time-weighted average over the bucket's timeframe (ignores NaN values) (since RedisTimeSeries 1.8) | - `bucketDuration` is duration of each bucket, in milliseconds. - + + Note: `aggregators` can either be a single aggregator or multiple aggregators separated by commas as shown below. + No whitespace is allowed between aggregators. + + AGGREGATION min,avg,max + Without `ALIGN`, bucket start times are multiples of `bucketDuration`. With `ALIGN align`, bucket start times are multiples of `bucketDuration` with remainder `align % bucketDuration`. @@ -253,7 +218,7 @@ controls how bucket timestamps are reported. [EMPTY] (since RedisTimeSeries 1.8) is a flag, which, when specified, reports aggregations also for empty buckets. -| `aggregator` | Value reported for each empty bucket | +| aggregator | Value reported for each empty bucket | | -------------------- | ------------------------------------ | | `sum`, `count` | `0` | | `last` | The value of the last sample before the bucket's start. `NaN` when no such sample. | @@ -297,12 +262,14 @@ TS.REVRANGE temp:TLV - + FILTER_BY_VALUE -100 100 2) 30 {{< / highlight >}} -Now, retrieve the average value, while ignoring out-of-range values. +Now, retrieve the minimum, average, and maximum values, while ignoring out-of-range values. {{< highlight bash >}} -TS.REVRANGE temp:TLV - + FILTER_BY_VALUE -100 100 AGGREGATION avg 1000 +TS.REVRANGE temp:TLV - + FILTER_BY_VALUE -100 100 AGGREGATION min,avg,max 1000 1) 1) (integer) 1000 - 2) 35 + 2) 30 + 3) 35 + 4) 40 {{< / highlight >}}
diff --git a/content/commands/xautoclaim.md b/content/commands/xautoclaim.md index 6c945bb4ad..af1684ca2e 100644 --- a/content/commands/xautoclaim.md +++ b/content/commands/xautoclaim.md @@ -97,6 +97,8 @@ However, note that you may want to continue calling `XAUTOCLAIM` even after the Note that only messages that are idle longer than `` are claimed, and claiming a message resets its idle time. This ensures that only a single consumer can successfully claim a given pending message at a specific instant of time and trivially reduces the probability of processing the same message multiple times. +Messages that have been released back to the group using [`XNACK`]({{< relref "/commands/xnack" >}}) are immediately claimable since their delivery time is set to 0, satisfying any minimum idle time requirement. + While iterating the PEL, if `XAUTOCLAIM` stumbles upon a message which doesn't exist in the stream anymore (either trimmed or deleted by [`XDEL`]({{< relref "/commands/xdel" >}})) it does not claim it, and deletes it from the PEL in which it was found. This feature was introduced in Redis 7.0. These message IDs are returned to the caller as a part of `XAUTOCLAIM`s reply. diff --git a/content/commands/xclaim.md b/content/commands/xclaim.md index dd76ff5f4c..8192b1bb1d 100644 --- a/content/commands/xclaim.md +++ b/content/commands/xclaim.md @@ -109,6 +109,8 @@ This dynamic is clearly explained in the [Stream intro documentation]({{< relref Note that the message is claimed only if its idle time is greater than the minimum idle time we specify when calling `XCLAIM`. Because as a side effect `XCLAIM` will also reset the idle time (since this is a new attempt at processing the message), two consumers trying to claim a message at the same time will never both succeed: only one will successfully claim the message. This avoids that we process a given message multiple times in a trivial way (yet multiple processing is possible and unavoidable in the general case). +Messages that have been released back to the group using [`XNACK`]({{< relref "/commands/xnack" >}}) are immediately claimable since their delivery time is set to 0, satisfying any minimum idle time requirement. + Moreover, as a side effect, `XCLAIM` will increment the count of attempted deliveries of the message unless the `JUSTID` option has been specified (which only delivers the message ID, not the message itself). In this way messages that cannot be processed for some reason, for instance because the consumers crash attempting to process them, will start to have a larger counter and can be detected inside the system. `XCLAIM` will not claim a message in the following cases: diff --git a/content/commands/xidmprecord.md b/content/commands/xidmprecord.md new file mode 100644 index 0000000000..54fb1a3ae6 --- /dev/null +++ b/content/commands/xidmprecord.md @@ -0,0 +1,120 @@ +--- +acl_categories: +- '@write' +- '@stream' +- '@fast' +arguments: +- key_spec_index: 0 + name: key + type: key +- name: pid + type: string +- name: iid + type: string +- name: stream-id + type: string +arity: 5 +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- write +- denyoom +- fast +complexity: O(1) +description: An internal command for setting IDMP metadata on an existing stream message. +group: stream +hidden: false +key_specs: +- begin_search: + index: + pos: 1 + find_keys: + range: + lastkey: 0 + limit: 0 + step: 1 + flags: + - RW + - UPDATE +linkTitle: XIDMPRECORD +railroad_diagram: /images/railroad/xidmprecord.svg +reply_schema: + const: OK +since: 8.8.0 +summary: An internal command for setting IDMP metadata on an existing stream message. +syntax_fmt: XIDMPRECORD key pid iid stream-id +title: XIDMPRECORD +--- + +`XIDMPRECORD` is an internal command for setting IDMP metadata on an existing stream message, which would be replayed during AOF loading. +Users should not call this command directly. + +## Required arguments + +
key + +is the name of a stream key. + +
+ +
pid + +is a producer ID. + +
+ +
iid + +is an IDMP (idempotency) ID. + +
+ +
stream-id + +is the ID of an existing stream message. + +
+ +## Redis Software and Redis Cloud compatibility + +| Redis
Software | Redis
Cloud | Notes | +|:----------------------|:-----------------|:------| +| ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | + +## Return information + +{{< multitabs id="return-info" + tab1="RESP2" + tab2="RESP3" >}} + +One of the following: + +- A [simple string reply]({{< relref "/develop/reference/protocol-spec/#simple-strings" >}}) - `OK` when the provided pid/iid pair already maps to the same stream ID (that is, the command is idempotent). +- A [simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors">}}) in one of the following cases: + - the key does not exist + - the key does not refer to a stream + - the stream ID refers to an non-existent or deleted entry + - pid and/or iid are empty + - the pid/iid pair already maps to a different stream ID + +-tab-sep- + +One of the following: + +- A [simple string reply]({{< relref "/develop/reference/protocol-spec/#simple-strings" >}}) - `OK` when the provided pid/iid pair already maps to the same stream ID (that is, the command is idempotent). +- A [simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors">}}) in one of the following cases: + - the key does not exist + - the key does not refer to a stream + - the stream ID refers to an non-existent or deleted entry + - pid and/or iid are empty + - the pid/iid pair already maps to a different stream ID + +{{< /multitabs >}} diff --git a/content/commands/xinfo-stream.md b/content/commands/xinfo-stream.md index c9ffd89e06..24aa4c2b57 100644 --- a/content/commands/xinfo-stream.md +++ b/content/commands/xinfo-stream.md @@ -46,6 +46,8 @@ history: - - 8.6.0 - Added the `idmp-duration`, `idmp-maxsize`, `pids-tracked`, `iids-tracked`, `iids-added` and `iids-duplicates` fields for IDMP tracking. +- - 8.8.0 + - Added the `nacked-count` field to consumer groups in the `FULL` output. key_specs: - RO: true access: true @@ -106,11 +108,12 @@ The following information is provided for each of the groups: * **pel-count**: the length of the group's pending entries list (PEL), which are messages that were delivered but are yet to be acknowledged * **pending**: an array with pending entries information (see below) * **consumers**: an array with consumers information (see below) +* **nacked-count**: the number of entries currently in the NACKed portion of the PEL. See the [`XNACK` command page]({{< relref "/commands/xnack" >}}) for more details. Added in Redis 8.8. The following information is provided for each pending entry: 1. The ID of the message. -2. The name of the consumer that fetched the message and has still to acknowledge it. We call it the current *owner* of the message. +2. The name of the consumer that fetched the message and has yet to acknowledge it. We call it the current *owner* of the message. For messages that have been released back to the group using [`XNACK`]({{< relref "/commands/xnack" >}}), this field will be an empty string. 3. The UNIX timestamp of when the message was delivered to this consumer. 4. The number of times this message was delivered. diff --git a/content/commands/xnack.md b/content/commands/xnack.md new file mode 100644 index 0000000000..ca7b7be734 --- /dev/null +++ b/content/commands/xnack.md @@ -0,0 +1,237 @@ +--- +acl_categories: +- '@stream' +arguments: +- key_spec_index: 0 + name: key + type: key +- name: group + type: string +- arguments: + - name: silent + token: SILENT + type: pure-token + - name: fail + token: FAIL + type: pure-token + - name: fatal + token: FATAL + type: pure-token + name: mode + type: oneof +- arguments: + - name: numids + type: integer + - multiple: true + name: id + type: string + name: ids + token: IDS + type: block +- name: count + optional: true + token: RETRYCOUNT + type: integer +- name: force + optional: true + token: FORCE + type: pure-token +arity: -7 +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- write +- fast +complexity: O(1) for each message ID processed. +description: Releases pending messages back to the group's PEL without acknowledging + them, making them available for re-delivery. +group: stream +hidden: false +key_specs: +- begin_search: + index: + pos: 1 + find_keys: + range: + lastkey: 0 + limit: 0 + step: 1 + flags: + - RW + - UPDATE +linkTitle: XNACK +since: 8.8.0 +summary: Releases pending messages back to the group's PEL without acknowledging them, + making them available for re-delivery. +syntax_fmt: "XNACK key group IDS\_numids id [id ...]\n [RETRYCOUNT\_\ + count] [FORCE]" +title: XNACK +--- + +In the context of a stream consumer group, this command allows a consumer to explicitly release pending messages back to the group's Pending Entries List (PEL) without acknowledging them. Released messages become immediately available for re-delivery to other consumers in the group, eliminating the idle-timeout delay normally required for message recovery. + +This is particularly useful in scenarios such as graceful consumer shutdown, consumer-side failures, resource constraints, or poison message detection. The command provides three different modes that control how the delivery counter is adjusted, giving consumers fine-grained control over retry semantics. + +## Required arguments + +
key + +Name of the stream. + +
+ +
group + +Name of the consumer group. + +
+ +
mode + +Controls the delivery counter adjustment. Must be one of: + +- **SILENT**: Decrements the delivery counter by 1, essentially "undoing" the delivery increment. Use this for an internal failure on the consumer side while processing the message or graceful shutdown where the delivery "didn't count". +- **FAIL**: Keeps the current delivery counter value unchanged. Use this when the current consumer failed to process this message (for example, due to memory constraints). The root cause may be the message or the consumer (it is unclear), so the best strategy would be to let another consumer try to process the message. +- **FATAL**: Sets the delivery counter to the maximum value (LLONG_MAX or ~9.22 X 1018), marking the message as permanently failed. Use this for invalid or suspected malicious messages. + +
+ +
ids + +Block of arguments that specifies the message IDs to release, where `numids` is the number of message IDs that follow, and `id [id ...]` represents the stream entry IDs to be released back to the group. + +
+ +## Optional arguments + +
RETRYCOUNT + +Directly sets the delivery counter to the specified value, overriding the mode-based adjustment. This gives explicit control over the retry counter regardless of the mode selected. Note: this is an internal argument that should usually not be used by consumers. + +
+ +
FORCE + +Creates new unowned PEL entries for IDs that are not already in the group PEL. Each entry must exist in the stream. When `FORCE` creates an entry, the delivery counter is set to `0` (or to `RETRYCOUNT` if specified, or to `LLONG_MAX` if mode is `FATAL`). Note: this is an internal argument that should usually not be used by consumers. + +
+ +## Examples + +
+Basic usage with FAIL mode + +``` +> XADD mystream * field value1 +"1526569498055-0" +> XADD mystream * field value2 +"1526569498056-0" +> XGROUP CREATE mystream mygroup 0 +OK +> XREADGROUP GROUP mygroup consumer1 STREAMS mystream > +1) 1) "mystream" + 2) 1) 1) "1526569498055-0" + 2) 1) "field" + 2) "value1" + 2) 1) "1526569498056-0" + 2) 1) "field" + 2) "value2" +> XNACK mystream mygroup FAIL IDS 2 1526569498055-0 1526569498056-0 +(integer) 2 +``` + +After NACKing, the messages appear with empty consumer in XPENDING: + +``` +> XPENDING mystream mygroup - + 10 +1) 1) "1526569498055-0" + 2) "" + 3) (integer) -1 + 4) (integer) 1 +2) 1) "1526569498056-0" + 2) "" + 3) (integer) -1 + 4) (integer) 1 +``` + +
+ +
+Using SILENT mode for graceful shutdown + +``` +> XNACK mystream mygroup SILENT IDS 1 1526569498055-0 +(integer) 1 +``` + +With SILENT mode, the delivery counter is decremented, effectively "undoing" the delivery. + +
+ +
+Using FATAL mode for poison messages + +``` +> XNACK mystream mygroup FATAL IDS 1 1526569498055-0 +(integer) 1 +``` + +This marks the message as permanently failed by setting the delivery counter to maximum value. + +
+ +## Behavior + +When `XNACK` executes successfully, the entry: + +* is marked as unowned (its last consumer is set to an empty string). +* is assigned a last delivery time of `0`. +* is placed at the end of the NACKed portion of the PEL. +* is available for immediate re-delivery via [`XREADGROUP`]({{< relref "/commands/xreadgroup" >}}) CLAIM, [`XCLAIM`]({{< relref "/commands/xclaim" >}}), or [`XAUTOCLAIM`]({{< relref "/commands/xautoclaim" >}}). + +The head of the PEL is reserved for all NACKed messages, ordered as a FIFO list, followed by pending messages that were neither ACKed nor NACKed in their existing order. + +NACKed messages are prioritized over other pending messages in the group's PEL, ensuring they are delivered before idle messages during claim operations. + +## Notes + +- `XNACK` will only process message IDs that exist in the consumer group's PEL. Messages that are not pending will be ignored and not counted in the return value. +- Released messages occupy a dedicated zone at the head of the PEL (called the *XNACKed portion of the PEL*), ensuring they are prioritized for re-delivery over other pending entries. +- Released messages have their delivery time set to 0, making them immediately claimable regardless of the `min-idle-time` parameter in claiming commands. +- Unlike [`XACK`]({{< relref "/commands/xack" >}}), this command does not remove messages from the PEL but instead makes them available for other consumers. + +## Redis Software and Redis Cloud compatibility + +| Redis
Software | Redis
Cloud | Notes | +|:----------------------|:-----------------|:------| +| ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | + +## Return information + +{{< multitabs id="return-info" + tab1="RESP2" + tab2="RESP3" >}} + +[Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): The number of messages successfully released back to the group PEL. Messages that are not in the consumer group PEL will not be counted. + +-tab-sep- + +[Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): The number of messages successfully released back to the consumer group PEL. Messages that are not in the consumer group PEL will not be counted. + +{{< /multitabs >}} + +## See also + +- [`XREADGROUP`]({{< relref "/commands/xreadgroup" >}}): Read messages from a consumer group +- [`XACK`]({{< relref "/commands/xack" >}}): Acknowledge processed messages +- [`XCLAIM`]({{< relref "/commands/xclaim" >}}): Claim pending messages from other consumers +- [`XAUTOCLAIM`]({{< relref "/commands/xautoclaim" >}}): Automatically claim idle pending messages +- [`XPENDING`]({{< relref "/commands/xpending" >}}): Inspect pending messages in a consumer group diff --git a/content/commands/xpending.md b/content/commands/xpending.md index 9e64bc2419..ec7d4653a5 100644 --- a/content/commands/xpending.md +++ b/content/commands/xpending.md @@ -165,7 +165,7 @@ is detailed information for each message in the pending entries list. For each message four attributes are returned: 1. The ID of the message. -2. The name of the consumer that fetched the message and has still to acknowledge it. We call it the current *owner* of the message. +2. The name of the consumer that fetched the message and has still to acknowledge it. We call it the current *owner* of the message. For messages that have been released back to the group using [`XNACK`]({{< relref "/commands/xnack" >}}), this field will be an empty string. 3. The number of milliseconds that elapsed since the last time this message was delivered to this consumer. 4. The number of times this message was delivered. diff --git a/content/commands/xreadgroup.md b/content/commands/xreadgroup.md index 96b73a3f8e..5adc2117d2 100644 --- a/content/commands/xreadgroup.md +++ b/content/commands/xreadgroup.md @@ -169,6 +169,8 @@ If there are no such messages, Redis will continue as normal (consume incoming m `CLAIM min-idle-time` is ignored if the specified id is not `>`. +Messages that have been released back to the group using [`XNACK`]({{< relref "/commands/xnack" >}}), added in Redis 8.8, are immediately claimable since their delivery time is set to 0, satisfying any minimum idle time requirement. + ### Reply extension for claimed entries When `CLAIM min-idle-time` is used, additional information is provided for each pending entry retrieved (similar to the reply of [`XPENDING`]({{< relref "/commands/xpending" >}})). For each claimed pending entry, the reply includes: @@ -187,7 +189,8 @@ When not blocked, across streams, entries are reported in the order the streams When using `CLAIM`, the following ordering guarantees apply per stream: - Idle pending entries are reported first, then incoming entries -- Idle pending entries are ordered by idle time (longer first) +- Among pending entries, messages released via [`XNACK`]({{< relref "/commands/xnack" >}}) are prioritized and reported first +- Other idle pending entries are ordered by idle time (longer first) - Incoming entries are reported in the order they were added by `XADD` (older first) For example, if there are 20 idle pending entries and 200 incoming entries (in all the specified streams together): diff --git a/content/commands/zinter.md b/content/commands/zinter.md index a3ea97e27f..ec7b38d1dd 100644 --- a/content/commands/zinter.md +++ b/content/commands/zinter.md @@ -4,39 +4,35 @@ acl_categories: - '@sortedset' - '@slow' arguments: -- display_text: numkeys - name: numkeys +- name: numkeys type: integer -- display_text: key - key_spec_index: 0 +- key_spec_index: 0 multiple: true name: key type: key -- display_text: weight - multiple: true +- multiple: true name: weight optional: true token: WEIGHTS type: integer - arguments: - - display_text: sum - name: sum + - name: sum token: SUM type: pure-token - - display_text: min - name: min + - name: min token: MIN type: pure-token - - display_text: max - name: max + - name: max token: MAX type: pure-token + - name: count + token: COUNT + type: pure-token name: aggregate optional: true token: AGGREGATE type: oneof -- display_text: withscores - name: withscores +- name: withscores optional: true token: WITHSCORES type: pure-token @@ -60,25 +56,27 @@ complexity: O(N*K)+O(M*log(M)) worst case with N being the smallest input sorted description: Returns the intersect of multiple sorted sets. group: sorted-set hidden: false +history: +- - 8.8.0 + - Added `COUNT` aggregate option. key_specs: -- RO: true - access: true - begin_search: - spec: - index: 1 - type: index +- begin_search: + index: + pos: 1 find_keys: - spec: + keynum: firstkey: 1 keynumidx: 0 - keystep: 1 - type: keynum + step: 1 + flags: + - RO + - ACCESS linkTitle: ZINTER railroad_diagram: /images/railroad/zinter.svg since: 6.2.0 summary: Returns the intersect of multiple sorted sets. syntax_fmt: "ZINTER numkeys key [key ...] [WEIGHTS\_weight [weight ...]]\n [AGGREGATE\_\ - ] [WITHSCORES]" + ] [WITHSCORES]" title: ZINTER --- {{< note >}} diff --git a/content/commands/zinterstore.md b/content/commands/zinterstore.md index 077dfa00f7..ad6bd7e860 100644 --- a/content/commands/zinterstore.md +++ b/content/commands/zinterstore.md @@ -4,37 +4,33 @@ acl_categories: - '@sortedset' - '@slow' arguments: -- display_text: destination - key_spec_index: 0 +- key_spec_index: 0 name: destination type: key -- display_text: numkeys - name: numkeys +- name: numkeys type: integer -- display_text: key - key_spec_index: 1 +- key_spec_index: 1 multiple: true name: key type: key -- display_text: weight - multiple: true +- multiple: true name: weight optional: true token: WEIGHTS type: integer - arguments: - - display_text: sum - name: sum + - name: sum token: SUM type: pure-token - - display_text: min - name: min + - name: min token: MIN type: pure-token - - display_text: max - name: max + - name: max token: MAX type: pure-token + - name: count + token: COUNT + type: pure-token name: aggregate optional: true token: AGGREGATE @@ -60,37 +56,38 @@ complexity: O(N*K)+O(M*log(M)) worst case with N being the smallest input sorted description: Stores the intersect of multiple sorted sets in a key. group: sorted-set hidden: false +history: +- - 8.8.0 + - Added `COUNT` aggregate option. key_specs: -- OW: true - begin_search: - spec: - index: 1 - type: index +- begin_search: + index: + pos: 1 find_keys: - spec: - keystep: 1 + range: lastkey: 0 limit: 0 - type: range - update: true -- RO: true - access: true - begin_search: - spec: - index: 2 - type: index + step: 1 + flags: + - OW + - UPDATE +- begin_search: + index: + pos: 2 find_keys: - spec: + keynum: firstkey: 1 keynumidx: 0 - keystep: 1 - type: keynum + step: 1 + flags: + - RO + - ACCESS linkTitle: ZINTERSTORE railroad_diagram: /images/railroad/zinterstore.svg since: 2.0.0 summary: Stores the intersect of multiple sorted sets in a key. syntax_fmt: "ZINTERSTORE destination numkeys key [key ...] [WEIGHTS\_weight\n [weight\ - \ ...]] [AGGREGATE\_]" + \ ...]] [AGGREGATE\_]" title: ZINTERSTORE --- {{< note >}} diff --git a/content/commands/zunion.md b/content/commands/zunion.md index 976b8afd10..ade5e6da7f 100644 --- a/content/commands/zunion.md +++ b/content/commands/zunion.md @@ -4,39 +4,35 @@ acl_categories: - '@sortedset' - '@slow' arguments: -- display_text: numkeys - name: numkeys +- name: numkeys type: integer -- display_text: key - key_spec_index: 0 +- key_spec_index: 0 multiple: true name: key type: key -- display_text: weight - multiple: true +- multiple: true name: weight optional: true token: WEIGHTS type: integer - arguments: - - display_text: sum - name: sum + - name: sum token: SUM type: pure-token - - display_text: min - name: min + - name: min token: MIN type: pure-token - - display_text: max - name: max + - name: max token: MAX type: pure-token + - name: count + token: COUNT + type: pure-token name: aggregate optional: true token: AGGREGATE type: oneof -- display_text: withscores - name: withscores +- name: withscores optional: true token: WITHSCORES type: pure-token @@ -59,25 +55,27 @@ complexity: O(N)+O(M*log(M)) with N being the sum of the sizes of the input sort description: Returns the union of multiple sorted sets. group: sorted-set hidden: false +history: +- - 8.8.0 + - Added `COUNT` aggregate option. key_specs: -- RO: true - access: true - begin_search: - spec: - index: 1 - type: index +- begin_search: + index: + pos: 1 find_keys: - spec: + keynum: firstkey: 1 keynumidx: 0 - keystep: 1 - type: keynum + step: 1 + flags: + - RO + - ACCESS linkTitle: ZUNION railroad_diagram: /images/railroad/zunion.svg since: 6.2.0 summary: Returns the union of multiple sorted sets. syntax_fmt: "ZUNION numkeys key [key ...] [WEIGHTS\_weight [weight ...]]\n [AGGREGATE\_\ - ] [WITHSCORES]" + ] [WITHSCORES]" title: ZUNION --- {{< note >}} diff --git a/content/commands/zunionstore.md b/content/commands/zunionstore.md index 3f15918d14..2aeba755d0 100644 --- a/content/commands/zunionstore.md +++ b/content/commands/zunionstore.md @@ -4,37 +4,33 @@ acl_categories: - '@sortedset' - '@slow' arguments: -- display_text: destination - key_spec_index: 0 +- key_spec_index: 0 name: destination type: key -- display_text: numkeys - name: numkeys +- name: numkeys type: integer -- display_text: key - key_spec_index: 1 +- key_spec_index: 1 multiple: true name: key type: key -- display_text: weight - multiple: true +- multiple: true name: weight optional: true token: WEIGHTS type: integer - arguments: - - display_text: sum - name: sum + - name: sum token: SUM type: pure-token - - display_text: min - name: min + - name: min token: MIN type: pure-token - - display_text: max - name: max + - name: max token: MAX type: pure-token + - name: count + token: COUNT + type: pure-token name: aggregate optional: true token: AGGREGATE @@ -59,37 +55,38 @@ complexity: O(N)+O(M log(M)) with N being the sum of the sizes of the input sort description: Stores the union of multiple sorted sets in a key. group: sorted-set hidden: false +history: +- - 8.8.0 + - Added `COUNT` aggregate option. key_specs: -- OW: true - begin_search: - spec: - index: 1 - type: index +- begin_search: + index: + pos: 1 find_keys: - spec: - keystep: 1 + range: lastkey: 0 limit: 0 - type: range - update: true -- RO: true - access: true - begin_search: - spec: - index: 2 - type: index + step: 1 + flags: + - OW + - UPDATE +- begin_search: + index: + pos: 2 find_keys: - spec: + keynum: firstkey: 1 keynumidx: 0 - keystep: 1 - type: keynum + step: 1 + flags: + - RO + - ACCESS linkTitle: ZUNIONSTORE railroad_diagram: /images/railroad/zunionstore.svg since: 2.0.0 summary: Stores the union of multiple sorted sets in a key. syntax_fmt: "ZUNIONSTORE destination numkeys key [key ...] [WEIGHTS\_weight\n [weight\ - \ ...]] [AGGREGATE\_]" + \ ...]] [AGGREGATE\_]" title: ZUNIONSTORE --- {{< note >}} @@ -105,10 +102,9 @@ the input keys and the other (optional) arguments. By default, the resulting score of an element is the sum of its scores in the sorted sets where it exists. -Using the `WEIGHTS` option, it is possible to specify a multiplication factor -for each input sorted set. -This means that the score of every element in every input sorted set is -multiplied by this factor before being passed to the aggregation function. +Using the `WEIGHTS` option, it is possible to specify a multiplication factor for +each input sorted set. Each element's score is multiplied by its corresponding +weight before aggregation. When `WEIGHTS` is not given, the multiplication factors default to `1`. With the `AGGREGATE` option, it is possible to specify how the results of the @@ -117,6 +113,20 @@ This option defaults to `SUM`, where the score of an element is summed across the inputs where it exists. When this option is set to either `MIN` or `MAX`, the resulting set will contain the minimum or maximum score of an element across the inputs where it exists. +For `SUM`, `MIN`, and `MAX`, each element's score is multiplied by its +corresponding weight before aggregation. + +When `AGGREGATE COUNT` is specified, the original element scores are ignored +entirely. The resulting score for each element is determined by which input sets +contain it, optionally scaled by `WEIGHTS`: + +- Without `WEIGHTS`, each input set containing the element contributes `1` to + its score — effectively counting set membership. +- With `WEIGHTS`, each input set containing the element contributes its + corresponding weight, so the score becomes the sum of those weights. + +This enables a common use case: counting set membership frequency directly at +the command level, without application-side workarounds. If `destination` already exists, it is overwritten. diff --git a/content/develop/ai/search-and-query/advanced-concepts/_index.md b/content/develop/ai/search-and-query/advanced-concepts/_index.md index 467a712664..1bec411343 100644 --- a/content/develop/ai/search-and-query/advanced-concepts/_index.md +++ b/content/develop/ai/search-and-query/advanced-concepts/_index.md @@ -45,6 +45,7 @@ Redis Open Source supports the following Redis Search features. This article pro * Geo-filtering using Redis [geo commands]({{< relref "/commands/" >}}?group=geo) * [Vector search]({{< relref "/develop/ai/search-and-query/vectors" >}}) * [Key and field expiration behavior]({{< relref "/develop/ai/search-and-query/advanced-concepts/expiration" >}}) +* [Search commands in MULTI/EXEC transactions and Lua scripts]({{< relref "/develop/ai/search-and-query/advanced-concepts/transactions" >}}) ## Full-text search features diff --git a/content/develop/ai/search-and-query/advanced-concepts/aggregations.md b/content/develop/ai/search-and-query/advanced-concepts/aggregations.md index 0e5e79e293..fd0c84ee1d 100644 --- a/content/develop/ai/search-and-query/advanced-concepts/aggregations.md +++ b/content/develop/ai/search-and-query/advanced-concepts/aggregations.md @@ -354,6 +354,60 @@ REDUCE RANDOM_SAMPLE {nargs} {property} {sample_size} Perform a reservoir sampling of the group elements with a given size, and return an array of the sampled items with an even distribution. +#### COLLECT + +{{< note >}} +The `COLLECT` reducer was introduced in version 8.8.0. +{{< /note >}} + +**Format** + +``` +REDUCE COLLECT {nargs} + FIELDS ( * | {num_fields} {field_1} [{field_2} ...] ) + [DISTINCT] + [SORTBY {nargs} {@field} [ASC|DESC] [{@field} [ASC|DESC] ...]] + [LIMIT {offset} {count}] + [AS {alias}] +``` + +**Description** + +Collect documents within each group as an array of key-value maps, projecting either all fields currently available in the pipeline or an explicit list of fields, with optional sorting, limiting, and deduplication. + +- `FIELDS *` returns all document fields available at the current pipeline stage. This is stage-local: it does not trigger an implicit load and does not reach back to fields from earlier stages that were not preserved as grouping keys or reducer aliases. +- `FIELDS {num} {field_1} ...` projects a specific list of fields. The special fields `@__key` (document key) and `@__score` (document score) are supported as projectable fields alongside document fields. +- Fields missing from a document are omitted from that entry (sparse output, with no NULL placeholders). +- `DISTINCT` (optional) deduplicates entries with identical projected fields, keeping the best representative according to the sort keys. When `DISTINCT` is omitted, all documents are retained including duplicates. +- `SORTBY` (optional) sorts documents within each group by one or more fields with `ASC`/`DESC`. +- `LIMIT` (optional) limits the number of documents returned per group. + +Each collected entry is returned as a key-value map (matching the standard `FT.AGGREGATE` result format). The `COLLECT` output is an array of such maps nested under the alias. For example: + +``` +"top_fruits" => + 1) "__key" => "doc_10" + "__score" => "0.95" + "fruit" => "apple" + "color" => "yellow" + "sweetness"=> "6" + 2) "__key" => "doc_1" + "__score" => "0.82" + "fruit" => "banana" + "color" => "yellow" + "sweetness"=> "5" +``` + +For example, to group movies by genre and collect the top 5 movies per group, sorted by rating in descending order: + +``` +FT.AGGREGATE idx:movies "*" + LOAD * + GROUPBY 1 @genre + REDUCE COLLECT 10 FIELDS 1 * SORTBY 2 @rating DESC LIMIT 0 5 AS top_movies + SORTBY 1 @genre LIMIT 0 50 +``` + ## APPLY expressions `APPLY` performs a one-to-one transformation on one or more properties in each record. It either stores the result as a new property down the pipeline, or replaces any property using this transformation. diff --git a/content/develop/ai/search-and-query/advanced-concepts/transactions.md b/content/develop/ai/search-and-query/advanced-concepts/transactions.md new file mode 100644 index 0000000000..974fdc6440 --- /dev/null +++ b/content/develop/ai/search-and-query/advanced-concepts/transactions.md @@ -0,0 +1,63 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: How Redis Search commands behave inside MULTI/EXEC transactions and Lua scripts +linkTitle: Search in transactions +title: Search commands in MULTI/EXEC transactions and Lua scripts +weight: 36 +--- + +Redis Search commands ([`FT.SEARCH`]({{< relref "/commands/ft.search" >}}), +[`FT.AGGREGATE`]({{< relref "/commands/ft.aggregate" >}}), +[`FT.HYBRID`]({{< relref "/commands/ft.hybrid" >}}), +[`FT.PROFILE`]({{< relref "/commands/ft.profile" >}}), and +[`FT.CURSOR READ`]({{< relref "/commands/ft.cursor-read" >}})) +can be used inside [`MULTI`]({{< relref "/commands/multi" >}})/[`EXEC`]({{< relref "/commands/exec" >}}) +transactions and [Lua scripts]({{< relref "/develop/programmability/lua-api" >}}), +but the behavior differs depending on your deployment topology. + +## Standalone and single-shard deployments + +Query commands inside a `MULTI`/`EXEC` block or Lua script (including when issued +through a client pipeline that wraps commands in a transaction) execute synchronously +on the main Redis thread, regardless of the +[`search-workers`]({{< relref "/develop/ai/search-and-query/administration/configuration#search-workers" >}}) +setting. + +The worker thread pool is bypassed in this context because Redis transactions +require all commands to complete sequentially without yielding to other clients. +As a result, queries inside transactions do not benefit from the parallelism +provided by `search-workers > 0`, but they execute correctly and return results +as expected. + +## Multi-shard deployments (OSS Cluster and Redis Software with multiple shards) + +Redis Search commands inside a `MULTI`/`EXEC` block or a Lua script are rejected with +the following error: + +``` +Cannot perform FT.SEARCH: Cannot block +``` + +This is because the coordinator must fan out the query to multiple shards and +collect results asynchronously, which is incompatible with the sequential +execution model of transactions. This limitation applies regardless of the +`search-workers` setting. + +## Related commands + +- [`FT.SEARCH`]({{< relref "/commands/ft.search" >}}) +- [`FT.AGGREGATE`]({{< relref "/commands/ft.aggregate" >}}) +- [`FT.HYBRID`]({{< relref "/commands/ft.hybrid" >}}) +- [`FT.PROFILE`]({{< relref "/commands/ft.profile" >}}) +- [`FT.CURSOR READ`]({{< relref "/commands/ft.cursor-read" >}}) +- [`MULTI`]({{< relref "/commands/multi" >}}) +- [`EXEC`]({{< relref "/commands/exec" >}}) diff --git a/content/develop/ai/search-and-query/vectors/_index.md b/content/develop/ai/search-and-query/vectors/_index.md index bc0188c9d3..9d07d3b29c 100644 --- a/content/develop/ai/search-and-query/vectors/_index.md +++ b/content/develop/ai/search-and-query/vectors/_index.md @@ -564,6 +564,12 @@ Use a higher ratio for better accuracy when precision is more important than per FT.SEARCH products "*=>[KNN 20 @product_embedding $BLOB]=>{$SHARD_K_RATIO: 0.8; $YIELD_DISTANCE_AS: similarity}" PARAMS 2 BLOB "\x12\xa9\xf5\x6c" SORTBY similarity DIALECT 2 ``` +[`FT.HYBRID`]({{< relref "/commands/ft.hybrid" >}}) also supports `SHARD_K_RATIO` as part of its `KNN` clause. The following query combines a text search for `laptop` with vector similarity, returning the top 100 nearest neighbors with each shard providing 50% of the requested results: + +``` +FT.HYBRID products-idx SEARCH "laptop" VSIM @description_vector $query_vec KNN 4 K 100 SHARD_K_RATIO 0.5 PARAMS 2 query_vec "\x12\xa9\xf5\x6c" +``` + ### Cluster considerations and best practices When using `$SHARD_K_RATIO` in Redis cluster environments, consider the following behavioral characteristics and best practices: diff --git a/content/develop/data-types/_index.md b/content/develop/data-types/_index.md index bc4800deac..69a5c84a0d 100644 --- a/content/develop/data-types/_index.md +++ b/content/develop/data-types/_index.md @@ -31,19 +31,20 @@ Each overview includes a comprehensive tutorial with code samples. [Redis Open Source]({{< relref "/operate/oss_and_stack" >}}) implements the following data types: -- [String](#strings) -- [Hash](#hashes) -- [List](#lists) -- [Set](#sets) -- [Sorted set](#sorted-sets) -- [Vector set](#vector-sets) -- [Stream](#streams) -- [Bitmap](#bitmaps) -- [Bitfield](#bitfields) -- [Geospatial](#geospatial-indexes) +- [Strings](#strings) + - [Bitmaps](#bitmaps) + - [Bitfields](#bitfields) +- [Arrays](#arrays) +- [Geospatial indexes](#geospatial-indexes) +- [Hashes](#hashes) - [JSON](#json) +- [Lists](#lists) - [Probabilistic data types](#probabilistic-data-types) +- [Sets](#sets) +- [Sorted sets](#sorted-sets) +- [Streams](#streams) - [Time series](#time-series) +- [Vector sets](#vector-sets) See [Compare data types]({{< relref "/develop/data-types/compare-data-types" >}}) for advice on which of the general-purpose data types is best for common tasks. @@ -56,56 +57,30 @@ For more information, see: * [Overview of Redis strings]({{< relref "/develop/data-types/strings" >}}) * [Redis string command reference]({{< relref "/commands/" >}}?group=string) -### Lists - -[Redis lists]({{< relref "/develop/data-types/lists" >}}) are lists of strings sorted by insertion order. -For more information, see: - -* [Overview of Redis lists]({{< relref "/develop/data-types/lists" >}}) -* [Redis list command reference]({{< relref "/commands/" >}}?group=list) - -### Sets - -[Redis sets]({{< relref "/develop/data-types/sets" >}}) are unordered collections of unique strings that act like the sets from your favorite programming language (for example, [Java HashSets](https://docs.oracle.com/javase/7/docs/api/java/util/HashSet.html), [Python sets](https://docs.python.org/3.10/library/stdtypes.html#set-types-set-frozenset), and so on). -With a Redis set, you can add, remove, and test for existence in O(1) time (in other words, regardless of the number of set elements). -For more information, see: - -* [Overview of Redis sets]({{< relref "/develop/data-types/sets" >}}) -* [Redis set command reference]({{< relref "/commands/" >}}?group=set) - -### Hashes - -[Redis hashes]({{< relref "/develop/data-types/hashes" >}}) are record types modeled as collections of field-value pairs. -As such, Redis hashes resemble [Python dictionaries](https://docs.python.org/3/tutorial/datastructures.html#dictionaries), [Java HashMaps](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html), and [Ruby hashes](https://ruby-doc.org/core-3.1.2/Hash.html). -For more information, see: - -* [Overview of Redis hashes]({{< relref "/develop/data-types/hashes" >}}) -* [Redis hashes command reference]({{< relref "/commands/" >}}?group=hash) - -### Sorted sets +### Bitfields -[Redis sorted sets]({{< relref "/develop/data-types/sorted-sets" >}}) are collections of unique strings that maintain order by each string's associated score. +[Redis bitfields]({{< relref "/develop/data-types/strings/bitfields" >}}) efficiently encode multiple counters in a string value. +Bitfields provide atomic get, set, and increment operations and support different overflow policies. For more information, see: -* [Overview of Redis sorted sets]({{< relref "/develop/data-types/sorted-sets" >}}) -* [Redis sorted set command reference]({{< relref "/commands/" >}}?group=sorted-set) +* [Overview of Redis bitfields]({{< relref "/develop/data-types/strings/bitfields" >}}) +* The [`BITFIELD`]({{< relref "/commands/bitfield" >}}) command. -### Vector sets +### Bitmaps -[Redis vector sets]({{< relref "/develop/data-types/vector-sets" >}}) are a specialized data type designed for managing high-dimensional vector data, enabling fast and efficient vector similarity search within Redis. Vector sets are optimized for use cases involving machine learning, recommendation systems, and semantic search, where each vector represents a data point in multi-dimensional space. Vector sets supports the [HNSW](https://en.wikipedia.org/wiki/Hierarchical_navigable_small_world) (hierarchical navigable small world) algorithm, allowing you to store, index, and query vectors based on the cosine similarity metric. With vector sets, Redis provides native support for hybrid search, combining vector similarity with structured [filters]({{< relref "/develop/data-types/vector-sets/filtered-search" >}}). +[Redis bitmaps]({{< relref "/develop/data-types/strings/bitmaps" >}}) let you perform bitwise operations on strings. For more information, see: -* [Overview of Redis vector sets]({{< relref "/develop/data-types/vector-sets" >}}) -* [Redis vector set command reference]({{< relref "/commands/" >}}?group=vector_set) +* [Overview of Redis bitmaps]({{< relref "/develop/data-types/strings/bitmaps" >}}) +* [Redis bitmap command reference]({{< relref "/commands/" >}}?group=bitmap) -### Streams +### Arrays -A [Redis stream]({{< relref "/develop/data-types/streams" >}}) is a data structure that acts like an append-only log. -Streams help record events in the order they occur and then syndicate them for processing. +[Redis arrays]({{< relref "/develop/data-types/arrays" >}}) are sparse, index-addressable sequences of strings. For more information, see: -* [Overview of Redis Streams]({{< relref "/develop/data-types/streams" >}}) -* [Redis Streams command reference]({{< relref "/commands/" >}}?group=stream) +* [Overview of Redis arrays]({{< relref "/develop/data-types/arrays" >}}) +* [Redis array command reference]({{< relref "/commands/" >}}?group=array) ### Geospatial indexes @@ -115,22 +90,14 @@ For more information, see: * [Overview of Redis geospatial indexes]({{< relref "/develop/data-types/geospatial" >}}) * [Redis geospatial indexes command reference]({{< relref "/commands/" >}}?group=geo) -### Bitmaps - -[Redis bitmaps]({{< relref "/develop/data-types/bitmaps" >}}) let you perform bitwise operations on strings. -For more information, see: - -* [Overview of Redis bitmaps]({{< relref "/develop/data-types/bitmaps" >}}) -* [Redis bitmap command reference]({{< relref "/commands/" >}}?group=bitmap) - -### Bitfields +### Hashes -[Redis bitfields]({{< relref "/develop/data-types/bitfields" >}}) efficiently encode multiple counters in a string value. -Bitfields provide atomic get, set, and increment operations and support different overflow policies. +[Redis hashes]({{< relref "/develop/data-types/hashes" >}}) are record types modeled as collections of field-value pairs. +As such, Redis hashes resemble [Python dictionaries](https://docs.python.org/3/tutorial/datastructures.html#dictionaries), [Java HashMaps](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html), and [Ruby hashes](https://ruby-doc.org/core-3.1.2/Hash.html). For more information, see: -* [Overview of Redis bitfields]({{< relref "/develop/data-types/bitfields" >}}) -* The [`BITFIELD`]({{< relref "/commands/bitfield" >}}) command. +* [Overview of Redis hashes]({{< relref "/develop/data-types/hashes" >}}) +* [Redis hashes command reference]({{< relref "/commands/" >}}?group=hash) ### JSON @@ -144,25 +111,26 @@ For more information, see: - [Overview of Redis JSON]({{< relref "/develop/data-types/json" >}}) - [JSON command reference]({{< relref "/commands" >}}?group=json) +### Lists + +[Redis lists]({{< relref "/develop/data-types/lists" >}}) are lists of strings sorted by insertion order. +For more information, see: + +* [Overview of Redis lists]({{< relref "/develop/data-types/lists" >}}) +* [Redis list command reference]({{< relref "/commands/" >}}?group=list) + ### Probabilistic data types These data types let you gather and calculate statistics in a way that is approximate but highly efficient. The following types are available: -- [HyperLogLog](#hyperloglog) - [Bloom filter](#bloom-filter) +- [Count-min sketch](#count-min-sketch) - [Cuckoo filter](#cuckoo-filter) +- [HyperLogLog](#hyperloglog) - [t-digest](#t-digest) - [Top-K](#top-k) -- [Count-min sketch](#count-min-sketch) - -### HyperLogLog - -The [Redis HyperLogLog]({{< relref "/develop/data-types/probabilistic/hyperloglogs" >}}) data structures provide probabilistic estimates of the cardinality (i.e., number of elements) of large sets. For more information, see: - -* [Overview of Redis HyperLogLog]({{< relref "/develop/data-types/probabilistic/hyperloglogs" >}}) -* [Redis HyperLogLog command reference]({{< relref "/commands/" >}}?group=hyperloglog) ### Bloom filter @@ -173,6 +141,15 @@ information, see: - [Overview of Redis Bloom filters]({{< relref "/develop/data-types/probabilistic/bloom-filter" >}}) - [Bloom filter command reference]({{< relref "/commands" >}}?group=bf) +### Count-min sketch + +[Redis Count-min sketch]({{< relref "/develop/data-types/probabilistic/count-min-sketch" >}}) +estimate the frequency of a data point within a stream of values. +For more information, see: + +- [Redis Count-min sketch overview]({{< relref "/develop/data-types/probabilistic/count-min-sketch" >}}) +- [Count-min sketch command reference]({{< relref "/commands" >}}?group=cms) + ### Cuckoo filter [Redis Cuckoo filters]({{< relref "/develop/data-types/probabilistic/cuckoo-filter" >}}) @@ -183,6 +160,13 @@ and performance. For more information, see: - [Overview of Redis Cuckoo filters]({{< relref "/develop/data-types/probabilistic/cuckoo-filter" >}}) - [Cuckoo filter command reference]({{< relref "/commands" >}}?group=cf) +### HyperLogLog + +The [Redis HyperLogLog]({{< relref "/develop/data-types/probabilistic/hyperloglogs" >}}) data structures provide probabilistic estimates of the cardinality (i.e., number of elements) of large sets. For more information, see: + +* [Overview of Redis HyperLogLog]({{< relref "/develop/data-types/probabilistic/hyperloglogs" >}}) +* [Redis HyperLogLog command reference]({{< relref "/commands/" >}}?group=hyperloglog) + ### t-digest [Redis t-digest]({{< relref "/develop/data-types/probabilistic/t-digest" >}}) @@ -201,16 +185,33 @@ For more information, see: - [Redis Top-K overview]({{< relref "/develop/data-types/probabilistic/top-k" >}}) - [Top-K command reference]({{< relref "/commands" >}}?group=topk) -### Count-min sketch +### Sets -[Redis Count-min sketch]({{< relref "/develop/data-types/probabilistic/count-min-sketch" >}}) -estimate the frequency of a data point within a stream of values. +[Redis sets]({{< relref "/develop/data-types/sets" >}}) are unordered collections of unique strings that act like the sets from your favorite programming language (for example, [Java HashSets](https://docs.oracle.com/javase/7/docs/api/java/util/HashSet.html), [Python sets](https://docs.python.org/3.10/library/stdtypes.html#set-types-set-frozenset), and so on). +With a Redis set, you can add, remove, and test for existence in O(1) time (in other words, regardless of the number of set elements). For more information, see: -- [Redis Count-min sketch overview]({{< relref "/develop/data-types/probabilistic/count-min-sketch" >}}) -- [Count-min sketch command reference]({{< relref "/commands" >}}?group=cms) +* [Overview of Redis sets]({{< relref "/develop/data-types/sets" >}}) +* [Redis set command reference]({{< relref "/commands/" >}}?group=set) + +### Sorted sets + +[Redis sorted sets]({{< relref "/develop/data-types/sorted-sets" >}}) are collections of unique strings that maintain order by each string's associated score. +For more information, see: + +* [Overview of Redis sorted sets]({{< relref "/develop/data-types/sorted-sets" >}}) +* [Redis sorted set command reference]({{< relref "/commands/" >}}?group=sorted-set) + +### Streams + +A [Redis stream]({{< relref "/develop/data-types/streams" >}}) is a data structure that acts like an append-only log. +Streams help record events in the order they occur and then syndicate them for processing. +For more information, see: + +* [Overview of Redis Streams]({{< relref "/develop/data-types/streams" >}}) +* [Redis Streams command reference]({{< relref "/commands/" >}}?group=stream) -## Time series +### Time series [Redis time series]({{< relref "/develop/data-types/timeseries" >}}) structures let you store and query timestamped data points. @@ -219,6 +220,14 @@ For more information, see: - [Redis time series overview]({{< relref "/develop/data-types/timeseries" >}}) - [Time series command reference]({{< relref "/commands" >}}?group=timeseries) +### Vector sets + +[Redis vector sets]({{< relref "/develop/data-types/vector-sets" >}}) are a specialized data type designed for managing high-dimensional vector data, enabling fast and efficient vector similarity search within Redis. Vector sets are optimized for use cases involving machine learning, recommendation systems, and semantic search, where each vector represents a data point in multi-dimensional space. Vector sets supports the [HNSW](https://en.wikipedia.org/wiki/Hierarchical_navigable_small_world) (hierarchical navigable small world) algorithm, allowing you to store, index, and query vectors based on the cosine similarity metric. With vector sets, Redis provides native support for hybrid search, combining vector similarity with structured [filters]({{< relref "/develop/data-types/vector-sets/filtered-search" >}}). +For more information, see: + +* [Overview of Redis vector sets]({{< relref "/develop/data-types/vector-sets" >}}) +* [Redis vector set command reference]({{< relref "/commands/" >}}?group=vector_set) + ## Adding extensions To extend the features provided by the included data types, use one of these options: diff --git a/content/develop/data-types/arrays.md b/content/develop/data-types/arrays.md new file mode 100644 index 0000000000..c54339b13f --- /dev/null +++ b/content/develop/data-types/arrays.md @@ -0,0 +1,236 @@ +--- +bannerText: Array is a new data type that is currently in preview and may be subject to change. +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- kubernetes +- clients +description: Introduction to Redis arrays +linkTitle: Arrays +title: Redis arrays +weight: 15 +--- + +{{< command-group group="array" title="Array command summary" show_link=true >}} + +Redis arrays are sparse, index-addressable data structures that map integer indexes (in the range 0 to 2⁶⁴−1) to string values. Unlike lists, elements are accessed directly by index rather than by position in a sequence, and you can set any index without allocating the gaps between occupied slots. This makes arrays well-suited for timestamped event logs, ring buffers over streaming measurements, sliding-window analytics, and other workloads that involve sparse or high-index access patterns. + +## Basic usage + +Use [`ARSET`]({{< relref "/commands/arset" >}}) to write one or more contiguous values starting at a given index, and [`ARGET`]({{< relref "/commands/arget" >}}) to read the value at an index. Accessing an unset index returns a nil reply. + +``` +> ARSET events:1 0 "login" "click" "purchase" +(integer) 3 +> ARGET events:1 0 +"login" +> ARGET events:1 999 +(nil) +``` + +To write values at arbitrary, non-contiguous indexes, use [`ARMSET`]({{< relref "/commands/armset" >}}). To read several indexes in one round trip, use [`ARMGET`]({{< relref "/commands/armget" >}}): + +``` +> ARMSET metrics 0 "10" 5 "20" 100 "30" +(integer) 3 +> ARMGET metrics 0 5 100 999 +1) "10" +2) "20" +3) "30" +4) (nil) +``` + +## Array length vs. element count + +Redis arrays expose two distinct size measurements: + +- [`ARLEN`]({{< relref "/commands/arlen" >}}) returns the *logical length*: the highest set index plus one. +- [`ARCOUNT`]({{< relref "/commands/arcount" >}}) returns the number of *non-empty* elements. + +For a sparse array, these values can differ substantially: + +``` +> ARSET sparse 0 "a" +(integer) 1 +> ARSET sparse 1000000 "b" +(integer) 1 +> ARLEN sparse +(integer) 1000001 +> ARCOUNT sparse +(integer) 2 +``` + +## Reading ranges + +[`ARGETRANGE`]({{< relref "/commands/argetrange" >}}) returns every position in a range—including empty slots as nil—in index order. Reversing `start` and `end` reverses the direction: + +``` +> ARMSET seq 0 "a" 1 "b" 3 "d" +(integer) 3 +> ARGETRANGE seq 0 3 +1) "a" +2) "b" +3) (nil) +4) "d" +``` + +To iterate only the elements that exist and retrieve their indexes alongside their values, use [`ARSCAN`]({{< relref "/commands/arscan" >}}). It skips empty slots and returns a flat list of alternating index-value pairs, with an optional `LIMIT` to cap the result size: + +``` +> ARSCAN seq 0 3 +1) (integer) 0 +2) "a" +3) (integer) 1 +4) "b" +5) (integer) 3 +6) "d" +``` + +## Sequential insertion + +[`ARINSERT`]({{< relref "/commands/arinsert" >}}) appends values using an internal cursor that advances automatically after each call. Use [`ARNEXT`]({{< relref "/commands/arnext" >}}) to inspect where the next insert would land, and [`ARSEEK`]({{< relref "/commands/arseek" >}}) to reposition the cursor: + +``` +> ARINSERT log "event1" +(integer) 0 +> ARINSERT log "event2" +(integer) 1 +> ARNEXT log +(integer) 2 +> ARSEEK log 10 +(integer) 1 +> ARINSERT log "event3" +(integer) 10 +``` + +## Ring buffer mode + +[`ARRING`]({{< relref "/commands/arring" >}}) turns an array into a fixed-size circular buffer. Each call inserts a value at `insert_idx % size`, wrapping back to index `0` once the window is full and overwriting the oldest entry: + +``` +> ARRING readings 3 "v0" +(integer) 0 +> ARRING readings 3 "v1" +(integer) 1 +> ARRING readings 3 "v2" +(integer) 2 +> ARRING readings 3 "v3" +(integer) 0 +> ARGET readings 0 +"v3" +``` + +[`ARLASTITEMS`]({{< relref "/commands/arlastitems" >}}) retrieves the *N* most recently inserted elements in chronological order. Pass the `REV` flag to reverse the order: + +``` +> ARLASTITEMS readings 3 +1) "v1" +2) "v2" +3) "v3" +> ARLASTITEMS readings 3 REV +1) "v3" +2) "v2" +3) "v1" +``` + +## Aggregate operations + +[`AROP`]({{< relref "/commands/arop" >}}) performs a single-pass aggregate over a contiguous range of elements: + +| Operation | Description | +|-----------|-------------| +| `SUM` | Sum of numeric values | +| `MIN` | Minimum numeric value | +| `MAX` | Maximum numeric value | +| `AND` / `OR` / `XOR` | Bitwise operation on integer values | +| `MATCH value` | Count of elements equal to `value` | +| `USED` | Count of non-empty elements in the range | + +``` +> ARMSET scores 0 "10" 1 "20" 2 "30" +(integer) 3 +> AROP scores 0 2 SUM +"60" +> AROP scores 0 2 MAX +"30" +> AROP scores 0 2 MATCH "10" +(integer) 1 +``` + +## Searching elements + +[`ARGREP`]({{< relref "/commands/argrep" >}}) finds elements in a range whose values match one or more textual predicates and returns their indexes. Empty slots are skipped. Four predicate forms are supported: `EXACT` (full equality), `MATCH` (substring), `GLOB` (the same wildcard syntax as [`SCAN`]({{< relref "/commands/scan" >}}) `MATCH`), and `RE` (regular expression). Multiple predicates are combined with `OR` by default, or with `AND` when the option is given. Pass `NOCASE` for case-insensitive comparisons, `WITHVALUES` to return matching values alongside their indexes, and `LIMIT` to cap the number of matches. + +This is particularly useful when an array stores line-indexed text such as a log file, where each element holds one line: + +``` +> ARMSET log 0 "boot: ok" 1 "warn: disk" 2 "ERROR: cpu" 3 "info: ready" 4 "error: net" +(integer) 5 +> ARGREP log - + MATCH "error" NOCASE +1) (integer) 2 +2) (integer) 4 +> ARGREP log 0 4 GLOB "warn:*" OR GLOB "error:*" WITHVALUES +1) (integer) 1 +2) "warn: disk" +3) (integer) 4 +4) "error: net" +``` + +The special values `-` and `+` denote the first and last index of the array. Combined with [ring buffer mode](#ring-buffer-mode), this lets a fixed-size array hold the most recent *N* log lines and be searched in place. + +## Deleting elements + +[`ARDEL`]({{< relref "/commands/ardel" >}}) deletes one or more elements by index and returns the count of elements actually removed. [`ARDELRANGE`]({{< relref "/commands/ardelrange" >}}) removes all elements within an index range; reversing `start` and `end` is supported: + +``` +> ARDEL scores 1 +(integer) 1 +> ARDELRANGE scores 0 2 +(integer) 2 +``` + +Deleting the last remaining element removes the key entirely. + +## Introspection + +[`ARINFO`]({{< relref "/commands/arinfo" >}}) returns metadata about an array's internal structure, including its logical length, element count, and next insert index. Pass the `FULL` option to include per-slice statistics such as fill rates and counts of dense versus sparse slices: + +``` +> ARINFO readings + 1) "len" + 2) (integer) 3 + 3) "count" + 4) (integer) 3 + 5) "next-insert-index" + 6) (integer) 0 +... +``` + +## Configuration + +The following configuration parameters affect array behavior: +- `array-slice-size` +- `array-sparse-kmax` +- `array-sparse-kmin` + +See the [Redis configuration page]({{< relref "/operate/oss_and_stack/management/config" >}}) for details. + +## Performance + +Most array commands are O(1), including [`ARSET`]({{< relref "/commands/arset" >}}), [`ARGET`]({{< relref "/commands/arget" >}}), [`ARDEL`]({{< relref "/commands/ardel" >}}), [`ARINSERT`]({{< relref "/commands/arinsert" >}}), [`ARNEXT`]({{< relref "/commands/arnext" >}}), [`ARSEEK`]({{< relref "/commands/arseek" >}}), [`ARCOUNT`]({{< relref "/commands/arcount" >}}), and [`ARLEN`]({{< relref "/commands/arlen" >}}). Operations that touch N elements—such as [`ARGETRANGE`]({{< relref "/commands/argetrange" >}}), [`ARSCAN`]({{< relref "/commands/arscan" >}}), [`ARDELRANGE`]({{< relref "/commands/ardelrange" >}}), [`AROP`]({{< relref "/commands/arop" >}}), and [`ARLASTITEMS`]({{< relref "/commands/arlastitems" >}})—are O(N). The underlying sliced-array encoding handles both dense and sparse access patterns efficiently, so large index gaps consume very little memory. + +## Alternatives + +Arrays complement rather than replace the other Redis collection types: + +- Use [Redis lists]({{< relref "/develop/data-types/lists" >}}) when you need push/pop operations at either end, or when you need to insert elements between existing ones. +- Use [Redis hashes]({{< relref "/develop/data-types/hashes" >}}) when values are addressed by field name rather than by numeric index. +- Use [Redis streams]({{< relref "/develop/data-types/streams" >}}) when you need an append-only event log with consumer groups and acknowledgements. + +## Limits + +[`ARGETRANGE`]({{< relref "/commands/argetrange" >}}) enforces a hard limit of 1,000,000 elements per call to guard against accidentally large range reads. diff --git a/content/develop/data-types/compare-data-types.md b/content/develop/data-types/compare-data-types.md index b8eeddd558..d22d65d8d6 100644 --- a/content/develop/data-types/compare-data-types.md +++ b/content/develop/data-types/compare-data-types.md @@ -20,18 +20,21 @@ The following are highly specialized for precise purposes: - [Geospatial]({{< relref "/develop/data-types/geospatial" >}}): store strings with associated coordinates for geospatial queries. -- [Vector sets]({{< relref "/develop/data-types/vector-sets" >}}): - store strings with associated vector data (and optional metadata) - for vector similarity queries. - [Probabilistic data types]({{< relref "/develop/data-types/probabilistic" >}}): keep approximate counts and other statistics for large datasets. - [Time series]({{< relref "/develop/data-types/timeseries" >}}): store real-valued data points along with the time they were collected. +- [Vector sets]({{< relref "/develop/data-types/vector-sets" >}}): + store strings with associated vector data (and optional metadata) + for vector similarity queries. The remaining data types are more general-purpose: - [Strings]({{< relref "/develop/data-types/strings" >}}): store text or binary data. +- [Arrays]({{< relref "/develop/data-types/arrays" >}}): + store strings addressed by integer index, with support for sparse + indices and server-side aggregation. - [Hashes]({{< relref "/develop/data-types/hashes" >}}): store key-value pairs within a single key. - [JSON]({{< relref "/develop/data-types/json" >}}): @@ -68,6 +71,15 @@ whose internal structure will be managed by your own application. However, they also support operations to access ranges of bits in the string to use as bit sets, integers, or floating-point numbers. +### Arrays + +- **Structure**: sparse, index-addressable sequence of strings. +- **Operations**: get, set, delete, range read, range scan, sequential insert, aggregate. +- **Suitable for**: Event logs, ring buffers, sensor readings, and other append-heavy or sparse sequences. + +Arrays store values addressed by integer index, making random access O(1) regardless of the array's logical size. Because arrays are sparse, setting an element at index 1,000,000 does not allocate memory for the million empty slots in between, so large index gaps are inexpensive. Arrays distinguish between *logical length* (the highest set index plus one, returned by [`ARLEN`]({{< relref "/commands/arlen" >}})) and *element count* (the number of non-empty slots, returned by [`ARCOUNT`]({{< relref "/commands/arcount" >}})). + +In addition to direct index access, arrays support sequential insertion via [`ARINSERT`]({{< relref "/commands/arinsert" >}}), which advances an internal cursor automatically. The cursor can be repositioned with [`ARSEEK`]({{< relref "/commands/arseek" >}}), enabling flexible append patterns. [`ARRING`]({{< relref "/commands/arring" >}}) makes the ring buffer pattern explicit: it inserts values modulo a fixed size, wrapping around and overwriting the oldest entries when the buffer is full. [`AROP`]({{< relref "/commands/arop" >}}) performs single-pass aggregations (sum, min, max, bitwise operations, value matching) over a range without fetching each element individually. ### Hashes @@ -311,7 +323,7 @@ questions: ### Sequences You would normally store sequences of string or binary data using sorted sets, -lists, or streams. They each have advantages and disadvantages for particular purposes. +lists, streams, or arrays. They each have advantages and disadvantages for particular purposes. Use the decision tree below as a guide to choosing the best data type for your task. ```decision-tree {id="sequences-tree"} @@ -322,17 +334,35 @@ questions: root: text: | Do you need to maintain an arbitrary priority order, lexicographical order, - frequently access elements by index, or perform set operations? + or perform set operations? whyAsk: | - Sorted sets are the only sequence type that supports both ordering and set operations. - While lists also support indexing, it is O(n) for lists but O(log n) for sorted sets, - so sorted sets are more efficient if you need frequent index access + Sorted sets are the only sequence type that supports both ordering and set operations answers: yes: value: "Yes" outcome: label: "Use sorted sets" id: sortedSetsOutcome + no: + value: "No" + nextQuestion: indexedAccess + indexedAccess: + text: | + Do you need to address elements by a caller-chosen integer index + (including sparse or non-contiguous indices), perform server-side + aggregation over index ranges (sum, min, max, bitwise), or use a + fixed-size ring buffer that overwrites the oldest entries? + whyAsk: | + Arrays map integer indices directly to string values with O(1) access, + support sparse indexing without allocating the gaps, and include + server-side aggregation and ring-buffer operations that lists and + streams do not provide + answers: + yes: + value: "Yes" + outcome: + label: "Use arrays" + id: arraysOutcome no: value: "No" nextQuestion: timestampOrder diff --git a/content/develop/data-types/geospatial.md b/content/develop/data-types/geospatial.md index f2121d2785..78c69806c0 100644 --- a/content/develop/data-types/geospatial.md +++ b/content/develop/data-types/geospatial.md @@ -17,7 +17,7 @@ description: 'Introduction to the Redis Geospatial data type ' linkTitle: Geospatial title: Redis geospatial -weight: 80 +weight: 40 --- {{< command-group group="geo" title="Geospatial command summary" show_link=true >}} diff --git a/content/develop/data-types/hashes.md b/content/develop/data-types/hashes.md index 99afa94287..06153cf87f 100644 --- a/content/develop/data-types/hashes.md +++ b/content/develop/data-types/hashes.md @@ -17,7 +17,7 @@ description: 'Introduction to Redis hashes ' linkTitle: Hashes title: Redis hashes -weight: 40 +weight: 50 --- {{< command-group group="hash" title="Hash command summary" show_link=true >}} diff --git a/content/develop/data-types/json/_index.md b/content/develop/data-types/json/_index.md index 6699e5d5a7..d1c1b0620b 100644 --- a/content/develop/data-types/json/_index.md +++ b/content/develop/data-types/json/_index.md @@ -16,7 +16,7 @@ description: JSON support for Redis linkTitle: JSON stack: true title: JSON -weight: 11 +weight: 60 --- {{< command-group group="json" title="JSON command summary" show_link=true >}} @@ -89,6 +89,15 @@ OK "[[\"Deimos\",{\"crashes\":0}]]" {{< /clients-example >}} +Beginning with Redis 8.8, the JSON data type supports the ability to force a particular type when storing floating point homogeneous arrays (FPHAs)using the `FPHA BF16|FP16|FP32|FP64` option to the [`JSON.SET`]({{< relref "/commands/json.set" >}}) command. Here's an example: + +``` +> JSON.SET fp_array $ '[[1,2,3,4e3],[5,6.0,7,8]]' FPHA FP16 +OK +> JSON.GET fp_array $ +"[[[1.0,2.0,3.0,4000.0],[5.0,6.0,7.0,8.0]]]" +``` + The [`JSON.DEL`]({{< relref "commands/json.del/" >}}) command deletes any JSON value you specify with the `path` parameter. You can manipulate arrays with a dedicated subset of JSON commands: diff --git a/content/develop/data-types/json/use_cases.md b/content/develop/data-types/json/use_cases.md index 46244e8889..763989928d 100644 --- a/content/develop/data-types/json/use_cases.md +++ b/content/develop/data-types/json/use_cases.md @@ -9,9 +9,7 @@ categories: - oss - kubernetes - clients -description: 'JSON use cases - - ' +description: JSON use cases linkTitle: Use cases title: Use cases weight: 4 @@ -31,4 +29,6 @@ JSON allows you to atomically run operations like incrementing a value, adding, **Indexing and querying** -When you store JSON objects as Redis strings, there's no good way to query those objects. On the other hand, storing these objects as JSON using Redis Open Source lets you index and query them. This capability is provided by Redis Search. +When you store JSON objects as Redis strings, there's no good way to query those objects. On the other hand, storing these objects as JSON lets you index and query them. This capability is provided by Redis Search. + +With the `FPHA` option to the [`JSON.SET`]({{< relref "/commands/json.set" >}}) command, Redis provides the user with a flexible way to store floating point vectors for vector search. diff --git a/content/develop/data-types/lists.md b/content/develop/data-types/lists.md index 050f9ee62e..f0eb596c55 100644 --- a/content/develop/data-types/lists.md +++ b/content/develop/data-types/lists.md @@ -17,7 +17,7 @@ description: 'Introduction to Redis lists ' linkTitle: Lists title: Redis lists -weight: 20 +weight: 70 --- {{< command-group group="list" title="List command summary" show_link=true >}} diff --git a/content/develop/data-types/probabilistic/_index.md b/content/develop/data-types/probabilistic/_index.md index 13270ae0b8..0de84d539d 100644 --- a/content/develop/data-types/probabilistic/_index.md +++ b/content/develop/data-types/probabilistic/_index.md @@ -15,7 +15,7 @@ categories: description: Probabilistic data structures in Redis linkTitle: Probabilistic title: Probabilistic -weight: 140 +weight: 80 --- *Probabilistic data structures* give approximations of statistics such as diff --git a/content/develop/data-types/probabilistic/count-min-sketch.md b/content/develop/data-types/probabilistic/count-min-sketch.md index 12201be42b..5fe551b925 100644 --- a/content/develop/data-types/probabilistic/count-min-sketch.md +++ b/content/develop/data-types/probabilistic/count-min-sketch.md @@ -17,7 +17,7 @@ description: Count-min sketch is a probabilistic data structure that estimates t linkTitle: Count-min sketch stack: true title: Count-min sketch -weight: 60 +weight: 20 --- {{< command-group group="cms" title="Count-min sketch command summary" show_link=true >}} diff --git a/content/develop/data-types/probabilistic/cuckoo-filter.md b/content/develop/data-types/probabilistic/cuckoo-filter.md index 57fb582f51..53f3968a18 100644 --- a/content/develop/data-types/probabilistic/cuckoo-filter.md +++ b/content/develop/data-types/probabilistic/cuckoo-filter.md @@ -17,7 +17,7 @@ description: Cuckoo filters are a probabilistic data structure that checks for p linkTitle: Cuckoo filter stack: true title: Cuckoo filter -weight: 20 +weight: 30 --- {{< command-group group="cf" title="Cuckoo filter command summary" show_link=true >}} diff --git a/content/develop/data-types/probabilistic/hyperloglogs.md b/content/develop/data-types/probabilistic/hyperloglogs.md index 7d3d5adcc6..504df059e9 100644 --- a/content/develop/data-types/probabilistic/hyperloglogs.md +++ b/content/develop/data-types/probabilistic/hyperloglogs.md @@ -18,7 +18,7 @@ description: 'HyperLogLog is a probabilistic data structure that estimates the c ' linkTitle: HyperLogLog title: HyperLogLog -weight: 1 +weight: 40 --- {{< command-group group="hyperloglog" title="HyperLogLog command summary" show_link=true >}} diff --git a/content/develop/data-types/probabilistic/t-digest.md b/content/develop/data-types/probabilistic/t-digest.md index 78a6258842..07a94987d7 100644 --- a/content/develop/data-types/probabilistic/t-digest.md +++ b/content/develop/data-types/probabilistic/t-digest.md @@ -17,7 +17,7 @@ description: t-digest is a probabilistic data structure that allows you to estim linkTitle: t-digest stack: true title: t-digest -weight: 40 +weight: 50 --- {{< command-group group="tdigest" title="t-digest command summary" show_link=true >}} diff --git a/content/develop/data-types/probabilistic/top-k.md b/content/develop/data-types/probabilistic/top-k.md index 9bf4bf099c..efb44a13ec 100644 --- a/content/develop/data-types/probabilistic/top-k.md +++ b/content/develop/data-types/probabilistic/top-k.md @@ -17,7 +17,7 @@ description: Top-K is a probabilistic data structure that allows you to find the linkTitle: Top-K stack: true title: Top-K -weight: 50 +weight: 60 --- {{< command-group group="topk" title="Top-K command summary" show_link=true >}} diff --git a/content/develop/data-types/sets.md b/content/develop/data-types/sets.md index 08cbe206d5..7bd2ec8b7f 100644 --- a/content/develop/data-types/sets.md +++ b/content/develop/data-types/sets.md @@ -17,7 +17,7 @@ description: 'Introduction to Redis sets ' linkTitle: Sets title: Redis sets -weight: 30 +weight: 90 --- {{< command-group group="set" title="Set command summary" show_link=true >}} diff --git a/content/develop/data-types/sorted-sets.md b/content/develop/data-types/sorted-sets.md index 4e6576cdce..57c9caff3f 100644 --- a/content/develop/data-types/sorted-sets.md +++ b/content/develop/data-types/sorted-sets.md @@ -17,7 +17,7 @@ description: 'Introduction to Redis sorted sets ' linkTitle: Sorted sets title: Redis sorted sets -weight: 50 +weight: 100 --- {{< command-group group="sorted-set" title="Sorted set command summary" show_link=true >}} diff --git a/content/develop/data-types/streams/_index.md b/content/develop/data-types/streams/_index.md index d10233ef92..005a3ff1e7 100644 --- a/content/develop/data-types/streams/_index.md +++ b/content/develop/data-types/streams/_index.md @@ -17,7 +17,7 @@ categories: description: Introduction to Redis streams linkTitle: Streams title: Redis Streams -weight: 60 +weight: 110 --- {{< command-group group="stream" title="Stream command summary" show_link=true >}} @@ -390,6 +390,7 @@ Now it's time to zoom in to see the fundamental consumer group commands. They ar * [`XGROUP`]({{< relref "/commands/xgroup" >}}) is used in order to create, destroy and manage consumer groups. * [`XREADGROUP`]({{< relref "/commands/xreadgroup" >}}) is used to read from a stream via a consumer group. * [`XACK`]({{< relref "/commands/xack" >}}) is the command that allows a consumer to mark a pending message as correctly processed. +* [`XNACK`]({{< relref "/commands/xnack" >}}) is the command that allows a consumer to release pending messages back to the group without acknowledging them, making them immediately available for re-delivery to other consumers. * [`XACKDEL`]({{< relref "/commands/xackdel" >}}) combines acknowledgment and deletion in a single atomic operation with enhanced control over consumer group references. ## Creating a consumer group @@ -679,6 +680,35 @@ The counter that you observe in the [`XPENDING`]({{< relref "/commands/xpending" When there are failures, it is normal that messages will be delivered multiple times, but eventually they usually get processed and acknowledged. However there might be a problem processing some specific message, because it is corrupted or crafted in a way that triggers a bug in the processing code. In such a case what happens is that consumers will continuously fail to process this particular message. Because we have the counter of the delivery attempts, we can use that counter to detect messages that for some reason are not processable. So once the deliveries counter reaches a given large number that you chose, it is probably wiser to put such messages in another stream and send a notification to the system administrator. This is basically the way that Redis Streams implements the *dead letter* concept. +## Releasing messages back to the group: XNACK + +Starting with Redis 8.8, the [`XNACK`]({{< relref "/commands/xnack" >}}) command provides a way for consumers to explicitly release pending messages back to the group without acknowledging them. This is the opposite of claiming - instead of taking ownership of messages from other consumers, a consumer can release its own messages back to the group for immediate re-delivery. + +This capability addresses several common scenarios: + +1. **Graceful shutdown**: When a consumer is shutting down, it can release all its pending messages so other consumers can pick them up immediately without waiting for idle timeouts. + +2. **Consumer-side failures**: When a consumer encounters consumer-side issues (like network connectivity problems or resource constraints), it can release messages it cannot process rather than letting them sit idle. + +3. **Resource management**: A consumer under resource pressure can release complex or large messages that it cannot handle, allowing other consumers with more resources to process them. + +4. **Poison message handling**: A consumer can mark messages as permanently failed when it detects invalid or malicious content. + +The command provides three modes that control how the delivery counter is adjusted: + +- **SILENT**: Decrements the delivery counter, essentially "undoing" the delivery. Use this for graceful shutdowns or when the failure is unrelated to the message content. +- **FAIL**: Keeps the delivery counter unchanged. Use this when the current consumer cannot handle the message but others might be able to. +- **FATAL**: Sets the delivery counter to maximum value, marking the message as permanently failed for dead letter processing. + +Released messages are placed in a special "NACK zone" at the head of the consumer group's PEL, ensuring they are prioritized for re-delivery over other idle pending messages. This makes recovery much faster than traditional claiming mechanisms that rely on idle timeouts. + +``` +> XNACK mystream mygroup FAIL IDS 1 1526569498055-0 +(integer) 1 +``` + +After NACKing, the message appears with an empty consumer in [`XPENDING`]({{< relref "/commands/xpending" >}}) output and becomes immediately available for claiming or consumption via [`XREADGROUP`]({{< relref "/commands/xreadgroup" >}}) with the CLAIM option. + ## Working with multiple consumer groups Redis Streams can be associated with multiple consumer groups, where each entry is delivered to all the stream's consumer groups. Within each consumer group, consumers handle a portion of the entries collaboratively. This design enables different applications or services to process the same stream data independently. diff --git a/content/develop/data-types/strings.md b/content/develop/data-types/strings/_index.md similarity index 95% rename from content/develop/data-types/strings.md rename to content/develop/data-types/strings/_index.md index 339d5c8064..29a1c84901 100644 --- a/content/develop/data-types/strings.md +++ b/content/develop/data-types/strings/_index.md @@ -11,9 +11,7 @@ categories: - rc - kubernetes - clients -description: 'Introduction to Redis strings - - ' +description: Introduction to Redis strings linkTitle: Strings title: Redis Strings weight: 10 @@ -113,7 +111,7 @@ By default, a single Redis string can be a maximum of 512 MB. ## Bitwise and bitfield operations -To perform bitwise operations on a string, see the [bitmaps data type]({{< relref "/develop/data-types/bitmaps" >}}) docs. To store and manipulate integer values within a string, see the [bitfields data type]({{< relref "/develop/data-types/bitfields" >}}) docs. +To perform bitwise operations on a string, see the [bitmaps data type]({{< relref "/develop/data-types/strings/bitmaps" >}}) docs. To store and manipulate integer values within a string, see the [bitfields data type]({{< relref "/develop/data-types/strings/bitfields" >}}) docs. ## Performance diff --git a/content/develop/data-types/bitfields.md b/content/develop/data-types/strings/bitfields.md similarity index 95% rename from content/develop/data-types/bitfields.md rename to content/develop/data-types/strings/bitfields.md index 8b48f4d59a..eb0389f74a 100644 --- a/content/develop/data-types/bitfields.md +++ b/content/develop/data-types/strings/bitfields.md @@ -2,6 +2,7 @@ aliases: - /data-types/bitfields/ - /manual/data-types/bitfields/ +- /develop/data-types/bitfields/ categories: - docs - develop @@ -12,12 +13,10 @@ categories: - oss - kubernetes - clients -description: 'Introduction to Redis bitfields - - ' +description: Introduction to Redis bitfields linkTitle: Bitfields title: Redis bitfields -weight: 130 +weight: 10 --- {{< command-group group="bitmap" title="Bitmap/bitfield command summary" show_link=true >}} diff --git a/content/develop/data-types/bitmaps.md b/content/develop/data-types/strings/bitmaps.md similarity index 99% rename from content/develop/data-types/bitmaps.md rename to content/develop/data-types/strings/bitmaps.md index 6f2cbdc954..6bb7530958 100644 --- a/content/develop/data-types/bitmaps.md +++ b/content/develop/data-types/strings/bitmaps.md @@ -2,6 +2,7 @@ aliases: - /data-types/bitmaps/ - /manual/data-types/bitmaps/ +- /develop/data-types/bitmaps/ categories: - docs - develop @@ -15,7 +16,7 @@ categories: description: Introduction to Redis bitmaps linkTitle: Bitmaps title: Redis bitmaps -weight: 120 +weight: 20 --- {{< command-group group="bitmap" title="Bitmap/bitfield command summary" show_link=true >}} diff --git a/content/develop/data-types/timeseries/_index.md b/content/develop/data-types/timeseries/_index.md index 449bdb4c86..0fe32e6cbc 100644 --- a/content/develop/data-types/timeseries/_index.md +++ b/content/develop/data-types/timeseries/_index.md @@ -22,7 +22,7 @@ description: Ingest and query time series data with Redis linkTitle: Time series stack: true title: Time series -weight: 150 +weight: 120 --- {{< command-group group="timeseries" title="Time series command summary" show_link=true >}} @@ -33,7 +33,7 @@ weight: 150 The Redis time series data type lets you store real-valued data points along with the time they were collected. You can combine the values from a selection of time series and query them by time or value range. You can also compute -aggregate functions of the data over periods of time and create new time series +aggregators of the data over periods of time and create new time series from the results. When you create a time series, you can specify a maximum retention period for the data, relative to the last reported timestamp, to prevent the time series from growing indefinitely. @@ -373,26 +373,28 @@ bucket by an aggregate value, such as the average or maximum value. For example, if you expect to collect more than one billion data points in a day, you could aggregate the data using buckets of one minute. Since each bucket is represented by a single value, this reduces the dataset size to 1,440 data points (24 hours x 60 minutes = 1,440 minutes). -The range query commands let you specify an aggregation function and bucket size. -The available aggregation functions are: - -- `avg`: Arithmetic mean of all values -- `sum`: Sum of all values -- `min`: Minimum value -- `max`: Maximum value -- `range`: Difference between the highest and the lowest value -- `count`: Number of values -- `countNaN`: Number of NaN values (since Redis 8.6) -- `countAll`: Number of all values, both NaN and non-NaN (since Redis 8.6) -- `first`: Value with lowest timestamp in the bucket -- `last`: Value with highest timestamp in the bucket -- `std.p`: Population standard deviation of the values -- `std.s`: Sample standard deviation of the values -- `var.p`: Population variance of the values -- `var.s`: Sample variance of the values -- `twa`: Time-weighted average over the bucket's timeframe (since RedisTimeSeries v1.8) - -For example, the example below shows an aggregation with the `avg` function over all +The range query commands let you specify one or more aggregators and bucket size. +The available aggregators are: + +| aggregator | Description | +| ------------ | --------------------------------------------------------------- | +| `avg` | Arithmetic mean of all non-NaN values | +| `sum` | Sum of all non-NaN values | +| `min` | Minimum non-NaN value | +| `max` | Maximum non-NaN value | +| `range` | Difference between the maximum and the minimum non-NaN values | +| `count` | Number of non-NaN values | +| `countNaN` | Number of NaN values (since Redis 8.6) | +| `countAll` | Number of values, including NaN and non-NaN (since Redis 8.6) | +| `first` | The non-NaN value with the lowest timestamp in the bucket | +| `last` | The non-NaN value with the highest timestamp in the bucket | +| `std.p` | Population standard deviation of the non-NaN values | +| `std.s` | Sample standard deviation of the non-NaN values | +| `var.p` | Population variance of the non-NaN values | +| `var.s` | Sample variance of the non-NaN values | +| `twa` | Time-weighted average over the bucket's timeframe (ignores NaN values) (since RedisTimeSeries 1.8) | + +For example, the example below shows an aggregation with the `avg` aggregator over all five data points in the `rg:2` time series. The bucket size is 2ms, so there are three aggregated values with only one value used to calculate the average for the last bucket. @@ -406,13 +408,19 @@ aggregated values with only one value used to calculate the average for the last 2) 1.78 {{< /clients-example >}} -NaN Handling (Redis 8.6+): Starting from Redis 8.6, all existing aggregation functions ignore NaN values when computing results. For example, if a bucket contains values [1.0, NaN, 3.0], the `avg` aggregator will return 2.0 (average of 1.0 and 3.0), and the `count` aggregator will return 2. Use the new `countNaN` and `countAll` aggregators to count NaN values and total values respectively. +To use multiple aggregators in a single query, separate the aggregators with comma characters as in the following example. + +```bash +TS.RANGE rg:2 - + AGGREGATION min,avg,max 2 +``` + +NaN Handling (Redis 8.6+): Starting from Redis 8.6, all existing aggregators ignore NaN values when computing results. For example, if a bucket contains values [1.0, NaN, 3.0], the `avg` aggregator will return 2.0 (average of 1.0 and 3.0), and the `count` aggregator will return 2. Use the new `countNaN` and `countAll` aggregators to count NaN values and total values respectively. ### Bucket alignment The sequence of buckets has a reference timestamp, which is the timestamp where the first bucket in the sequence starts. By default, the reference timestamp is zero. -For example, the following commands create a time series and apply a `min` aggregation +For example, the following commands create a time series and apply a `min` aggregator with a bucket size of 25 milliseconds at the default zero alignment. {{< clients-example set="time_series_tutorial" step="agg_bucket" description="Bucket alignment: Use AGGREGATION with default zero alignment to group data into fixed-size time buckets when you need consistent time-based aggregations" difficulty="intermediate" buildsUpon="agg" >}} @@ -560,7 +568,7 @@ NaN values are useful in scenarios where you need to distinguish between: - **Adding NaN values**: Use [`TS.ADD`]({{< relref "commands/ts.add/" >}}) and [`TS.MADD`]({{< relref "commands/ts.madd/" >}}) to insert NaN values - **Querying NaN values**: All raw measurement queries ([`TS.GET`]({{< relref "commands/ts.get/" >}}), [`TS.RANGE`]({{< relref "commands/ts.range/" >}}), etc.) include NaN values in results -- **Aggregation with NaN**: All existing aggregation functions except `countNaN` and `countAll` ignore NaN values. Use `countNaN` and `countAll` to count NaN and total values +- **Aggregation with NaN**: All existing aggregators except `countNaN` and `countAll` ignore NaN values. Use `countNaN` and `countAll` to count NaN and total values - **Increment/Decrement**: [`TS.INCRBY`]({{< relref "commands/ts.incrby/" >}}) and [`TS.DECRBY`]({{< relref "commands/ts.decrby/" >}}) return errors when the current value or operand is NaN - **Duplicate policies**: Special handling for `MIN`, `MAX`, and `SUM` policies when mixing NaN and non-NaN values - **Filtering**: [`FILTER_BY_VALUE`]({{< relref "commands/ts.range#filter_by_value-min-max-since-redistimeseries-v16" >}}) parameters cannot be NaN values @@ -621,8 +629,8 @@ aggregation buckets are stored in a separate time series, leaving the original series unchanged. Use [`TS.CREATERULE`]({{< relref "commands/ts.createrule/" >}}) to create a -compaction rule, specifying the source and destination time series keys, the -aggregation function, and the bucket duration. Note that the destination time +compaction rule, specifying the source and destination time series keys, an +aggregator, and the bucket duration. Note that the destination time series must already exist when you create the rule and also that the compaction will only process data that is added to the source series after you create the rule. diff --git a/content/develop/data-types/vector-sets/_index.md b/content/develop/data-types/vector-sets/_index.md index a371004a8f..e87837a4a8 100644 --- a/content/develop/data-types/vector-sets/_index.md +++ b/content/develop/data-types/vector-sets/_index.md @@ -15,7 +15,7 @@ categories: description: Introduction to Redis vector sets linkTitle: Vector sets title: Redis vector sets -weight: 55 +weight: 130 --- {{< command-group group="module" url_group="vector_set" title="Vector set command summary" show_link=true >}} diff --git a/content/develop/pubsub/keyspace-notifications.md b/content/develop/pubsub/keyspace-notifications.md index 1bb800bfb0..6e0bee3112 100644 --- a/content/develop/pubsub/keyspace-notifications.md +++ b/content/develop/pubsub/keyspace-notifications.md @@ -83,6 +83,7 @@ following table: h Hash commands z Sorted set commands t Stream commands + a Array commands d Module key type events x Expired events (events generated every time a key expires) e Evicted events (events generated when a key is evicted for maxmemory) @@ -90,7 +91,7 @@ following table: n New key events generated whenever a new key is created (Note: not included in the 'A' class) o Overwritten events generated every time a key is overwritten (Note: not included in the 'A' class) c Type-changed events generated every time a key's type changes (Note: not included in the 'A' class) - A Alias for "g$lshztdxe", so that the "AKE" string means all the events except "m", "n", "o" and "c". + A Alias for "g$lshztdxea", so that the "AKE" string means all the events except "m", "n", "o" and "c". At least `K` or `E` should be present in the string, otherwise no event will be delivered regardless of the rest of the string. @@ -115,6 +116,7 @@ Different commands generate different kind of events according to the following * [`HSET`]({{< relref "/commands/hset" >}}), [`HSETNX`]({{< relref "/commands/hsetnx" >}}) and [`HMSET`]({{< relref "/commands/hmset" >}}) all generate a single `hset` event. * [`INCRBYFLOAT`]({{< relref "/commands/incrbyfloat" >}}) generates an `incrbyfloat` events. * [`INCR`]({{< relref "/commands/incr" >}}), [`DECR`]({{< relref "/commands/decr" >}}), [`INCRBY`]({{< relref "/commands/incrby" >}}), [`DECRBY`]({{< relref "/commands/decrby" >}}) commands all generate `incrby` events. +* [`INCREX`]({{< relref "/commands/increx" >}}) generates an `incrby` event (or `incrbyfloat` when used with `BYFLOAT`). Additionally, an `expire` event is generated when `EX`/`PX`/`EXAT`/`PXAT` is used, a `persist` event when `PERSIST` is used, or a `del` event if the specified expiration is already in the past and the key is removed. * [`LINSERT`]({{< relref "/commands/linsert" >}}) generates an `linsert` event. * [`LMOVE`]({{< relref "/commands/lmove" >}}) and [`BLMOVE`]({{< relref "/commands/blmove" >}}) generate an `lpop`/`rpop` event (depending on the wherefrom argument) and an `lpush`/`rpush` event (depending on the whereto argument). In both cases the order is guaranteed (the `lpush`/`rpush` event will always be delivered after the `lpop`/`rpop` event). Additionally a `del` event will be generated if the resulting list is zero length and the key is removed. * [`LPOP`]({{< relref "/commands/lpop" >}}) generates an `lpop` event. Additionally a `del` event is generated if the key is removed because the last element from the list was popped. @@ -194,8 +196,11 @@ Expired (`expired`) events are generated when the Redis server deletes the key a Every node of a Redis cluster generates events about its own subset of the keyspace as described above. However, unlike regular Pub/Sub communication in a cluster, events' notifications **are not** broadcasted to all nodes. Put differently, keyspace events are node-specific. This means that to receive all keyspace events of a cluster, clients need to subscribe to each of the nodes. +## See also + +See the [subkey notifications]({{< relref "/develop/pubsub/subkeyspace-notifications" >}}) page for information about subkey notifications (for example, individual fields of a hash key). + @history * `>= 6.0`: Key miss events were added. * `>= 7.0`: Event type `new` added - diff --git a/content/develop/pubsub/subkeyspace-notifications.md b/content/develop/pubsub/subkeyspace-notifications.md new file mode 100644 index 0000000000..4c1a585ae3 --- /dev/null +++ b/content/develop/pubsub/subkeyspace-notifications.md @@ -0,0 +1,104 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: Monitor changes to individual subkeys in real time +linkTitle: Subkey notifications +title: Redis subkey notifications +weight: 5 +--- + +Subkey notifications, added in Redis 8.8, extend Redis's existing [keyspace notification]({{< relref "/develop/pubsub/keyspace-notifications" >}}) system to include the key, the subkey (for example, the field for hashes, the path for JSON documents, and the element for arrays), and the event type. + +With standard keyspace notifications, when a hash field is modified via [`HSET`]({{< relref "/commands/hset" >}}), [`HDEL`]({{< relref "/commands/hdel" >}}), or [`HEXPIRE`]({{< relref "/commands/hexpire" >}}), the subscriber receives the key name and the event type but not which specific fields were affected. Subkey notifications solve this by carrying the affected field names in the message payload. + +Subkey notifications are delivered through Pub/Sub channels and are independent of the standard keyspace/keyevent notification channels. Enabling subkey notifications does **not** implicitly enable standard keyspace notifications, and vice versa. + +Note: Redis Pub/Sub is *fire and forget*. If your Pub/Sub client disconnects and reconnects later, all events delivered during the disconnection period are lost. + +### Notification channels + +Four new channel types are available, each suited to a different subscription pattern: + +| Channel format | Payload | +|---|---| +| `__subkeyspace@__:` | `\|:[,...]` | +| `__subkeyevent@__:` | `:\|:[,...]` | +| `__subkeyspaceitem@__:\n` | `` | +| `__subkeyspaceevent@__:\|` | `:[,...]` | + +**Design rationale:** + +- **Subkeyspace** (`__subkeyspace@__:`): Subscribe to a specific key; each message contains an event type and subkey names. +- **Subkeyevent** (`__subkeyevent@__:`): Subscribe to a specific event type; each message contains a key name and subkey names. +- **Subkeyspaceitem** (`__subkeyspaceitem@__:\n`): Subscribe to a specific key and subkey name combination; each message contains an event type. +- **Subkeyspaceevent** (`__subkeyspaceevent@__:|`): Subscribe to a specific event and key combination; each message contains subkey names. + +Subkeys in the payload are encoded in a length-prefixed format (`:`) to support binary-safe subkey names that may contain delimiter characters. + +**Safeguards:** + +- Events whose name contains `|` are skipped for the `__subkeyspace` and `__subkeyspaceevent` channels to avoid parsing ambiguity. +- Keys containing `\n` are skipped for the `__subkeyspaceitem` channel because newline is the key/subkey separator. +- Subkey events are only published when at least one subkey is present. + +### Configuration + +Subkey notifications are controlled by the existing `notify-keyspace-events` configuration string. Four new flag characters are added: + + S Subkeyspace events, published with __subkeyspace@__ prefix. + T Subkeyevent events, published with __subkeyevent@__ prefix. + I Subkeyspaceitem events, published with __subkeyspaceitem@__ prefix. + V Subkeyspaceevent events, published with __subkeyspaceevent@__ prefix. + h Hash commands. + +These flags are **independent** from the existing key-level flags (`K`, `E`, and so on). You may enable any combination. For example, to enable only the subkeyspace and subkeyevent channels: + + $ redis-cli config set notify-keyspace-events ST + +To enable all four subkey channel types: + + $ redis-cli config set notify-keyspace-events STIV + +### Commands emitting subkey notifications + +The following commands emit subkey notifications. Currently, only hash commands are supported; support for additional data types is planned for future releases. + +| Command | Event | Subkeys included | +|---|---|---| +| [`HSET`]({{< relref "/commands/hset" >}}) / [`HMSET`]({{< relref "/commands/hmset" >}}) | `hset` | All fields being set | +| [`HSETNX`]({{< relref "/commands/hsetnx" >}}) | `hset` | The field (only if it was set) | +| [`HDEL`]({{< relref "/commands/hdel" >}}) | `hdel` | All fields deleted | +| [`HGETDEL`]({{< relref "/commands/hgetdel" >}}) | `hdel` / `hexpired` | Deleted or lazily expired fields | +| [`HGETEX`]({{< relref "/commands/hgetex" >}}) | `hexpire` / `hpersist` / `hdel` / `hexpired` | Affected fields per event type | +| [`HINCRBY`]({{< relref "/commands/hincrby" >}}) | `hincrby` | The field | +| [`HINCRBYFLOAT`]({{< relref "/commands/hincrbyfloat" >}}) | `hincrbyfloat` | The field | +| [`HEXPIRE`]({{< relref "/commands/hexpire" >}}) / [`HPEXPIRE`]({{< relref "/commands/hpexpire" >}}) / [`HEXPIREAT`]({{< relref "/commands/hexpireat" >}}) / [`HPEXPIREAT`]({{< relref "/commands/hpexpireat" >}}) | `hexpire` | Fields whose TTLs were updated | +| [`HPERSIST`]({{< relref "/commands/hpersist" >}}) | `hpersist` | Fields that were persisted | +| [`HSETEX`]({{< relref "/commands/hsetex" >}}) | `hset` / `hdel` / `hexpire` / `hexpired` | Affected fields per event type | +| Subkey expiration (active or lazy) | `hexpired` | All expired fields, batched into a single notification | + +### Watching events in real time + +To observe subkey notifications, enable the desired channel types and use `redis-cli` to subscribe with a glob pattern: + + $ redis-cli config set notify-keyspace-events ST + $ redis-cli --csv psubscribe '__subkey*' + Reading messages... (press Ctrl-C to quit) + "psubscribe","__subkey*",1 + +Then, in another terminal, run a command: + + $ redis-cli hset myhash field1 val1 field2 val2 + +You will see messages similar to the following: + + "pmessage","__subkey*","__subkeyspace@0__:myhash","hset|7:field1,7:field2" + "pmessage","__subkey*","__subkeyevent@0__:hset","5:myhash|7:field1,7:field2" diff --git a/content/develop/reference/modules/modules-api-ref.md b/content/develop/reference/modules/modules-api-ref.md index b0a6143f21..88d6a6e5d3 100644 --- a/content/develop/reference/modules/modules-api-ref.md +++ b/content/develop/reference/modules/modules-api-ref.md @@ -2607,9 +2607,10 @@ The parameters are the following: Note: the metadata class name "AAAAAAAAA" is reserved and produces an error. -If [`RedisModule_CreateKeyMetaClass()`](#RedisModule_CreateKeyMetaClass) is called outside of `RedisModule_OnLoad()` function, -there is already a metadata class registered with the same name, -or if the metadata class name or metaver is invalid, a negative value is returned. +If [`RedisModule_CreateKeyMetaClass()`](#RedisModule_CreateKeyMetaClass) is called outside of `RedisModule_OnLoad()` function +and outside of server startup, there is already a metadata class registered +with the same name, or if the metadata class name or metaver is invalid, +a negative value is returned. Otherwise the new metadata class is registered into Redis, and a reference of type `RedisModuleKeyMetaClassId` is returned: the caller of the function should store this reference into a global variable to make future use of it in the @@ -3940,6 +3941,18 @@ integer. Otherwise (wrong reply type) return NULL. Modifies the user that [`RedisModule_Call`](#RedisModule_Call) will use (e.g. for ACL checks) + + +### `RedisModule_GetContextUser` + + const RedisModuleUser *RedisModule_GetContextUser(RedisModuleCtx *ctx); + +**Available since:** unreleased + +Returns the user associated with the context via [`RedisModule_SetContextUser`](#RedisModule_SetContextUser). +Returns NULL if no user was set on the context. +The returned pointer is borrowed from the context — do NOT free it. + ### `RedisModule_Call` @@ -4954,9 +4967,9 @@ the command, so the private data is often not needed. Note: Under normal circumstances [`RedisModule_UnblockClient`](#RedisModule_UnblockClient) should not be called for clients that are blocked on keys (Either the key will become ready or a timeout will occur). If for some reason you do want - to call RedisModule_UnblockClient it is possible: Client will be - handled as if it were timed-out (You must implement the timeout - callback in that case). + to call RedisModule_UnblockClient it is possible, but it must NOT be + called from module threads and the client will be handled as if it + timed out (You must implement the timeout callback in that case). @@ -5007,7 +5020,8 @@ A common usage for 'privdata' is a thread that computes something that needs to be passed to the client, included but not limited some slow to compute reply or some reply obtained via networking. -Note 1: this function can be called from threads spawned by the module. +Note 1: this function can be called from threads spawned by the module when +the client was blocked using [`RedisModule_BlockClient()`](#RedisModule_BlockClient). Note 2: when we unblock a client that is blocked for keys using the API [`RedisModule_BlockClientOnKeys()`](#RedisModule_BlockClientOnKeys), the privdata argument here is not used. @@ -5263,10 +5277,11 @@ is interested in. This can be an ORed mask of any of the following flags: - `REDISMODULE_NOTIFY_OVERWRITTEN`: Overwritten events - `REDISMODULE_NOTIFY_TYPE_CHANGED`: Type-changed events - `REDISMODULE_NOTIFY_KEY_TRIMMED`: Key trimmed events after a slot migration operation + - `REDISMODULE_NOTIFY_RATE_LIMIT`: Rate limit event - `REDISMODULE_NOTIFY_ALL`: All events (Excluding `REDISMODULE_NOTIFY_KEYMISS`, REDISMODULE_NOTIFY_NEW, REDISMODULE_NOTIFY_OVERWRITTEN, - REDISMODULE_NOTIFY_TYPE_CHANGED - and REDISMODULE_NOTIFY_KEY_TRIMMED) + REDISMODULE_NOTIFY_TYPE_CHANGED, REDISMODULE_NOTIFY_KEY_TRIMMED + and REDISMODULE_NOTIFY_RATE_LIMIT) - `REDISMODULE_NOTIFY_LOADED`: A special notification available only for modules, indicates that the key was loaded from persistence. Notice, when this event fires, the given key @@ -5330,6 +5345,77 @@ Returns: - `REDISMODULE_OK` on successful removal of the subscription. - `REDISMODULE_ERR` if no matching subscription was found or if invalid parameters were provided. + + +### `RedisModule_SubscribeToKeyspaceEventsWithSubkeys` + + int RedisModule_SubscribeToKeyspaceEventsWithSubkeys(RedisModuleCtx *ctx, + int types, + int flags, + RedisModuleNotificationWithSubkeysFunc callback); + +**Available since:** unreleased + +Subscribe to keyspace notifications with subkey information. + +This is the extended version of [`RedisModule_SubscribeToKeyspaceEvents`](#RedisModule_SubscribeToKeyspaceEvents). When subkeys +are available, the `subkeys` array and `count` are passed to the callback. +`subkeys` contains only the names of affected subkeys (values are not included), +and `count` is the number of elements. The array may contain duplicates when +the same subkey appears more than once in a command (e.g. HSET key f1 v1 f1 v2 +produces subkeys=["f1","f1"], count=2). When no subkeys are present, `subkeys` +will be NULL and `count` will be 0. Whether events without subkeys are delivered +depends on the `flags` parameter (see below). + +`types` is a bit mask of event types the module is interested in +(using the same `REDISMODULE_NOTIFY_`* flags as [`RedisModule_SubscribeToKeyspaceEvents`](#RedisModule_SubscribeToKeyspaceEvents)). + +`flags` controls delivery filtering: + - `REDISMODULE_NOTIFY_FLAG_NONE`: The callback is invoked for all matching + events regardless of whether subkeys are present, so a separate + [`RedisModule_SubscribeToKeyspaceEvents`](#RedisModule_SubscribeToKeyspaceEvents) registration can be omitted. + - `REDISMODULE_NOTIFY_FLAG_SUBKEYS_REQUIRED`: The callback is only invoked + when subkeys are not empty. Events without subkey information (e.g. SET, + EXPIRE, DEL) are skipped. + +The callback signature is: + void callback(`RedisModuleCtx` *ctx, int type, const char *event, + RedisModuleString *key, RedisModuleString **subkeys, int count); + +The subkeys array and its contents are only valid during the callback. +The underlying objects may be stack-allocated or temporary, so +[`RedisModule_RetainString`](#RedisModule_RetainString) must NOT be used on them. To keep a subkey beyond +the callback (e.g. in a [`RedisModule_AddPostNotificationJob`](#RedisModule_AddPostNotificationJob) callback), use +[`RedisModule_HoldString`](#RedisModule_HoldString) (which handles static objects by copying) or +[`RedisModule_CreateStringFromString`](#RedisModule_CreateStringFromString) to make a deep copy before returning. + + + +### `RedisModule_UnsubscribeFromKeyspaceEventsWithSubkeys` + + int RedisModule_UnsubscribeFromKeyspaceEventsWithSubkeys(RedisModuleCtx *ctx, + int types, + int flags, + RedisModuleNotificationWithSubkeysFunc callback); + +**Available since:** unreleased + +Unregister a module's callback from keyspace notifications with subkeys +for specific event types. + +This function removes a previously registered subscription identified by +the event mask, delivery flags, and the callback function. + +Parameters: + - ctx: The `RedisModuleCtx` associated with the calling module. + - types: The event mask representing the notification types to unsubscribe from. + - flags: The delivery flags that were used during registration. + - callback: The callback function pointer that was originally registered. + +Returns: + - `REDISMODULE_OK` on successful removal of the subscription. + - `REDISMODULE_ERR` if no matching subscription was found. + ### `RedisModule_AddPostNotificationJob` @@ -5383,6 +5469,26 @@ for additional filtering in `RedisModuleNotificationFunc`) Expose notifyKeyspaceEvent to modules + + +### `RedisModule_NotifyKeyspaceEventWithSubkeys` + + int RedisModule_NotifyKeyspaceEventWithSubkeys(RedisModuleCtx *ctx, + int type, + const char *event, + ; + +**Available since:** unreleased + +Like [`RedisModule_NotifyKeyspaceEvent`](#RedisModule_NotifyKeyspaceEvent), but also triggers subkey-level notifications +when subkeys are provided. Both key-level (keyspace/keyevent) and +subkey-level (subkeyspace/subkeyevent/subkeyspaceitem/subkeyspaceevent) +channels are published to, depending on the server configuration. + +This is the extended version of [`RedisModule_NotifyKeyspaceEvent`](#RedisModule_NotifyKeyspaceEvent) and can actually +replace it. When called with subkeys=NULL and count=0, it behaves +identically to [`RedisModule_NotifyKeyspaceEvent`](#RedisModule_NotifyKeyspaceEvent). + ## Modules Cluster API @@ -5987,6 +6093,7 @@ On success a `REDISMODULE_OK` is returned, otherwise `REDISMODULE_ERR` is returned and errno is set to the following values: * ENOENT: Specified command does not exist. +* EINVAL: Invalid number of arguments for the specified command. * EACCES: Command cannot be executed, according to ACL rules @@ -8854,6 +8961,7 @@ There is no guarantee that this info is always available, so this may return -1. * [`RedisModule_GetCommandKeysWithFlags`](#RedisModule_GetCommandKeysWithFlags) * [`RedisModule_GetContextFlags`](#RedisModule_GetContextFlags) * [`RedisModule_GetContextFlagsAll`](#RedisModule_GetContextFlagsAll) +* [`RedisModule_GetContextUser`](#RedisModule_GetContextUser) * [`RedisModule_GetCurrentCommandName`](#RedisModule_GetCurrentCommandName) * [`RedisModule_GetCurrentUserName`](#RedisModule_GetCurrentUserName) * [`RedisModule_GetDbIdFromDefragCtx`](#RedisModule_GetDbIdFromDefragCtx) @@ -8947,6 +9055,7 @@ There is no guarantee that this info is always available, so this may return -1. * [`RedisModule_ModuleTypeSetValue`](#RedisModule_ModuleTypeSetValue) * [`RedisModule_MonotonicMicroseconds`](#RedisModule_MonotonicMicroseconds) * [`RedisModule_NotifyKeyspaceEvent`](#RedisModule_NotifyKeyspaceEvent) +* [`RedisModule_NotifyKeyspaceEventWithSubkeys`](#RedisModule_NotifyKeyspaceEventWithSubkeys) * [`RedisModule_OpenKey`](#RedisModule_OpenKey) * [`RedisModule_PoolAlloc`](#RedisModule_PoolAlloc) * [`RedisModule_PublishMessage`](#RedisModule_PublishMessage) @@ -9060,6 +9169,7 @@ There is no guarantee that this info is always available, so this may return -1. * [`RedisModule_StringToULongLong`](#RedisModule_StringToULongLong) * [`RedisModule_StringTruncate`](#RedisModule_StringTruncate) * [`RedisModule_SubscribeToKeyspaceEvents`](#RedisModule_SubscribeToKeyspaceEvents) +* [`RedisModule_SubscribeToKeyspaceEventsWithSubkeys`](#RedisModule_SubscribeToKeyspaceEventsWithSubkeys) * [`RedisModule_SubscribeToServerEvent`](#RedisModule_SubscribeToServerEvent) * [`RedisModule_ThreadSafeContextLock`](#RedisModule_ThreadSafeContextLock) * [`RedisModule_ThreadSafeContextTryLock`](#RedisModule_ThreadSafeContextTryLock) @@ -9072,6 +9182,7 @@ There is no guarantee that this info is always available, so this may return -1. * [`RedisModule_UnlinkKey`](#RedisModule_UnlinkKey) * [`RedisModule_UnregisterCommandFilter`](#RedisModule_UnregisterCommandFilter) * [`RedisModule_UnsubscribeFromKeyspaceEvents`](#RedisModule_UnsubscribeFromKeyspaceEvents) +* [`RedisModule_UnsubscribeFromKeyspaceEventsWithSubkeys`](#RedisModule_UnsubscribeFromKeyspaceEventsWithSubkeys) * [`RedisModule_ValueLength`](#RedisModule_ValueLength) * [`RedisModule_WrongArity`](#RedisModule_WrongArity) * [`RedisModule_Yield`](#RedisModule_Yield) @@ -9089,4 +9200,3 @@ There is no guarantee that this info is always available, so this may return -1. * [`RedisModule_ZsetRem`](#RedisModule_ZsetRem) * [`RedisModule_ZsetScore`](#RedisModule_ZsetScore) * [`RedisModule__Assert`](#RedisModule__Assert) - diff --git a/content/develop/tools/cli.md b/content/develop/tools/cli.md index bcb8cc34da..5cb118b208 100644 --- a/content/develop/tools/cli.md +++ b/content/develop/tools/cli.md @@ -390,6 +390,9 @@ syntax hints. Like command history, this behavior can be turned on and off via t Reverse history searches, such as `CTRL-R` in terminals, is supported. +Starting with Redis 8.8, `redis-cli` supports word-jump navigation (`Alt/Option + ←/→`, `Ctrl + ←/→`), which makes +editing long commands much more efficient. + ### Preferences There are two ways to customize `redis-cli` behavior. The file `.redisclirc` diff --git a/content/develop/whats-new/8-6.md b/content/develop/whats-new/8-6.md index fe3d861009..b55d2ee3ce 100644 --- a/content/develop/whats-new/8-6.md +++ b/content/develop/whats-new/8-6.md @@ -127,7 +127,7 @@ Redis 8.6 introduces new metrics that provide deeper insights into system behavi Redis 8.6 continues the unified distribution approach, delivering all functionality in a single Redis Open Source package without separate modules. This includes: -- **RedisTimeSeries**: Enhanced with NaN value support and new aggregation functions. +- **RedisTimeSeries**: Enhanced with NaN value support and new aggregators. - **RedisBloom**: Improved security with RDB loading fixes and atomic slot migration support. - **RedisJSON**: Better privacy protection and enhanced atomic slot migration capabilities. diff --git a/content/develop/whats-new/8-8.md b/content/develop/whats-new/8-8.md new file mode 100644 index 0000000000..ae0caece6d --- /dev/null +++ b/content/develop/whats-new/8-8.md @@ -0,0 +1,198 @@ +--- +title: Redis 8.8 +alwaysopen: false +categories: +- docs +- operate +- rs +- rc +description: What's new in Redis 8.8 +linkTitle: What's new in Redis 8.8 +weight: 1 +--- + +Redis 8.8 introduces new features and performance improvements, building on the foundation of Redis 8.6. + +This release delivers improvements across multiple areas: +- A new Array data structure +- Subkey notification for hash fields (field-level notifications) +- `INCREX`: window counter rate limiter combining `INCR`, `INCRBY`, `INCRBYFLOAT`, bounds, and expiration +- `XNACK`: new streams command that lets consumers explicitly release pending messages +- `ZUNION`, `ZINTER`, `ZUNIONSTORE`, `ZINTERSTORE`: new `COUNT` aggregator +- `JSON.SET`: new `FPHA` argument to specify the FP type for homogeneous FP arrays +- `TS.RANGE`, `TS.REVRANGE`, `TS.MRANGE`, `TS.MREVRANGE`: multiple aggregators in a single command +- `FT.HYBRID` `KNN` clause: new argument to request fewer candidates per shard +- `FT.PROFILE` `HYBRID`: profiling support for `FT.HYBRID` +- New in-group sorting reducer - `COLLECT` for `FT.AGGREGATE` +- Substantial Search and Query performance improvements (Rust iterators, devirtualized vector hot paths, AArch64 atomics) +- HyperLogLog, `MGET`/`MSET`, and `HGETALL` performance improvements +- Numerous security fixes and bug fixes across core, Search, JSON, Time Series, and Probabilistic + +Below is a detailed breakdown of these updates. + +## Supported operating systems + +Redis 8.8 is tested on: + +- Ubuntu 22.04 (Jammy Jellyfish), 24.04 (Noble Numbat), 26.04 (Resolute Raccoon) +- Rocky Linux 8.10, 9.7, 10.1 +- AlmaLinux 8.10, 9.7, 10.1 +- Debian 12.13 (Bookworm), Debian 13.4 (Trixie) +- Alpine 3.23 +- macOS 14.8.4 (Sonoma), 15.7.4 (Sequoia), 26.3 (Tahoe) - for both Intel and ARM + +## Security fixes + +Redis 8.8 includes important security fixes (compared to 8.8-M03): + +- (CVE-2026-23479) Use-After-Free in unblock client flow may lead to remote code execution. +- (CVE-2026-25243) Invalid memory access in `RESTORE` may lead to remote code execution. +- (CVE-2026-23631) Lua Use-After-Free may lead to remote code execution. +- (CVE-2026-25588) Invalid memory access in `RESTORE` may lead to remote code execution (Time Series). +- (CVE-2026-25589) Invalid memory access in `RESTORE` may lead to remote code execution (Probabilistic). + +## New features + +### Array data structure + +Redis 8.8 introduces a new Array data structure (#15162), providing a dedicated data type for ordered, indexable collections. + +### Hash field-level notifications + +Redis 8.8 adds subkey notifications for hash fields, enabling field-level keyspace notifications for hash data. + +### INCREX rate limiter + +The new [`INCREX`]({{< relref "/commands/increx/" >}}) command (#15045) is a window counter rate limiter that combines `INCR`, `INCRBY`, `INCRBYFLOAT`, bounds, and expiration into a single atomic operation. It simplifies common rate-limiting patterns by eliminating the need for multi-command transactions. + +### XNACK streams command + +The new [`XNACK`]({{< relref "/commands/xnack/" >}}) command allows stream consumers to explicitly release pending messages, providing finer-grained control over consumer group pending entry lists. + +### Sorted set COUNT aggregator + +[`ZUNION`]({{< relref "/commands/zunion/" >}}), [`ZINTER`]({{< relref "/commands/zinter/" >}}), [`ZUNIONSTORE`]({{< relref "/commands/zunionstore/" >}}), and [`ZINTERSTORE`]({{< relref "/commands/zinterstore/" >}}) support a new `COUNT` aggregator for combining sorted sets. + +### JSON.SET FPHA argument + +[`JSON.SET`]({{< relref "/commands/json.set/" >}}) accepts a new `FPHA` argument that specifies the floating-point type for homogeneous FP arrays. + +### Time series multiple aggregators + +[`TS.RANGE`]({{< relref "/commands/ts.range/" >}}), [`TS.REVRANGE`]({{< relref "/commands/ts.revrange/" >}}), [`TS.MRANGE`]({{< relref "/commands/ts.mrange/" >}}), and [`TS.MREVRANGE`]({{< relref "/commands/ts.mrange/" >}}) now support multiple aggregators in a single command. + +### FT.HYBRID candidates per shard + +The [`FT.HYBRID`]({{< relref "/commands/ft.hybrid/" >}}) `KNN` clause accepts a new argument to request fewer candidates per shard, reducing overhead in cluster mode. + +### FT.PROFILE HYBRID + +[`FT.PROFILE`]({{< relref "/commands/ft.profile/" >}}) adds profiling support for [`FT.HYBRID`]({{< relref "/commands/ft.hybrid/" >}}) queries. + +### In-group sorting reducer + +A new reducer for [`FT.AGGREGATE`]({{< relref "/commands/ft.aggregate/" >}}) allows you to unwind grouped documents after `GROUPBY` and sort them within each group, enabling more sophisticated aggregation pipelines. + +## Bug fixes + +Redis 8.8 includes a broad set of bug fixes (compared to 8.8-M03). + +### Core fixes + +- `SUBSCRIBE`, `PSUBSCRIBE`, `SSUBSCRIBE`: crash on OOM (RED-167788). +- `CONFIG SET`: some settings allow invalid characters (RED-167787). +- `SCRIPT DEBUG`: potential crash on scripts (RED-175507). +- `VADD`: crash or buffer overflow on large `REDUCE` value (RED-170921). +- `VSET`: crash on huge allocations (MOD-12678). +- `cluster-announce-ip` rejecting hostnames (regression) (#15188). +- Double free when loading streams with duplicate consumer PEL entries (#15095). +- Issues processing corrupt Streams RDB data (#15124). +- `fast_float_strtod` rounding mismatch (#15111). +- `vecClear` reset the logical size without releasing element ownership (#15190). +- `MULTI` queue incorrect memory accounting (#15163). +- Cluster crash when `CLIENT KILL` unsubscribes `SSUBSCRIBE` client inside `EXEC` (#15094). +- Listpack backlength encoding thresholds off-by-one (#15151). +- Under-copy in the Lua debugger (#15115). +- Sentinel config injection via `SENTINEL SET` (#14970). +- Client output buffer memory tracking not accounting for copy-avoided bulk string references (#14934). +- `INCREX` syntax update (#15237). +- Memory tracking can be enabled at runtime in non-clustered mode (#15005). + +### Search and Query fixes + +- `FT.PROFILE HYBRID` returns an empty reply (MOD-14778). +- `FT.SPELLCHECK` treats `PARAMS` placeholders as literal terms instead of resolving them (MOD-10596). +- `FT.PROFILE` output is inconsistent when a profiled value is missing (MOD-10560). +- `FT.CREATE` now rejects schema definitions with invalid option combinations at creation time (MOD-14655). +- `PERSIST` and `HPERSIST` notifications are not reflected in index expiration tracking (MOD-14800). +- Race condition in `FT.HYBRID` causes intermittent failures under concurrent hybrid query load (MOD-14732). +- Crash on `FT.SEARCH` when topology validation fails (for example, some nodes unreachable) (MOD-14475). +- Coordinator deadlock under mixed `FT.SEARCH` and `FT.AGGREGATE` load (MOD-14268). +- Memory leak when `FT.DROPINDEX` runs concurrently with in-flight hybrid queries (MOD-14135). +- `FT.CURSOR READ` timeout and `ON_TIMEOUT FAIL` not enforced on coordinator and shard (MOD-14284, MOD-14998). +- Cursors not cleaned up after `MAXIDLE`, causing resource exhaustion (MOD-6430). +- Coordinator `RETURN_STRICT` returns wrong data on partial results, including `SORTBY` pipeline (MOD-13617). +- `MAXPREFIXEXPANSION` warnings not propagated to clients in cluster mode (MOD-13804). +- Search commands fail when no worker thread is available instead of falling back to main thread (MOD-14921). +- RDB load missing validation of `FT.CREATE` arguments, allowing corrupt index state on load (MOD-13118). +- Use-after-move in `Indexer_Process` causes crash during indexing (MOD-14980). +- Deadlock between background query and main-thread writer (MOD-15364). +- `FT.PROFILE` prints output using wrong iterator type (MOD-14678). +- Confusing error returned when `DEBUG_PARAMS_COUNT` is zero (MOD-15118). +- Stack-smashing error in coordinator code path (MOD-14649). + +### JSON fixes + +- Trailing chars are ignored (MOD-7266). +- Wrong mutation ordering for array commands with recursive paths (MOD-6722). +- JSONPath evaluation issues (MOD-14664, MOD-7264, MOD-7272, MOD-7270, MOD-7268). + +### Time series fixes + +- Potential crash on disconnections and TLS failures (MOD-14850). +- `count`, `countNaN`, `countAll` reducers return NaN when all values are NaN (MOD-14420). +- Cluster topology changes during a multi-shard command are not handled (MOD-14439). + +### Probabilistic fixes + +- Memory leak on RDB load (MOD-15418). + +## Performance and resource utilization improvements + +Redis 8.8 delivers a broad set of performance improvements (compared to 8.6). + +### Core improvements + +- HyperLogLog: 4 independent accumulators that are merged at the end (#15049). +- Batched prefetch for `MGET` and `MSET` (#15133). +- Batched prefetch for `HGETALL` on hashtable-encoded hashes (#14988). +- Pass size hint to jemalloc for faster deallocation (#15071). +- Reduces allocator and accounting overhead by adding compile-time jemalloc tuning (#15096). + +### Search and Query improvements + +- Vector index hot path (HNSW and brute-force) devirtualized, reducing per-query latency (MOD-14916). +- Inline LSE atomics enabled on AArch64, improving atomic operation throughput on ARM64 (MOD-14916, MOD-15419). +- Expiration handling overhead reduced when many keys expire simultaneously (MOD-14916). +- LTO (link-time optimization) enabled for x86_64 release builds (MOD-14700). +- Shard-level timeout adjusted to coordinator dispatch time for more accurate accounting (MOD-13189). +- Iterators ported to Rust, reducing FFI overhead. +- `numRecords` no longer updated for vector fields, removing unnecessary write overhead on ingest (MOD-15487). +- VecSim SVS thread pool integrated with the worker pool for better thread utilization (MOD-9881). + +## Configuration parameters + +Redis 8.8 introduces new configuration parameters (compared to 8.8-M03): + +- Slowlog entry truncation limits (#15182): + - `slowlog-entry-max-argc`: maximum number of command arguments kept in a slowlog entry. + - `slowlog-entry-max-string-len`: maximum length of a command argument in a slowlog entry. +- Default maximum worker threads value updated; `MAX_WORKER_THREADS` is now a string config (MOD-14486, MOD-14763). + +## Metrics + +- `FT.PROFILE`: added queue time tracking (MOD-13602). + +## CLI tools + +- Fixed memory leak on malformed legacy help entry in `redis-cli` (#15150). diff --git a/content/develop/whats-new/_index.md b/content/develop/whats-new/_index.md index 59cbf3089a..da75c574c0 100644 --- a/content/develop/whats-new/_index.md +++ b/content/develop/whats-new/_index.md @@ -12,6 +12,12 @@ hideListLinks: true weight: 10 --- +## Q2 2026 (April - June) Updates + +### Redis Version Updates + +- [Redis 8.8]({{< relref "/develop/whats-new/8-8" >}}) - New Array data structure, `INCREX` rate limiter, in-group sorting reducer for `FT.AGGREGATE`, Rust iterators and devirtualized vector hot paths in Search, HyperLogLog and `MGET`/`MSET`/`HGETALL` performance improvements. + ## Q1 2026 (January - March) Updates ### Tools @@ -40,7 +46,7 @@ weight: 10 - [Lists]({{< relref "/develop/data-types/lists" >}}) - [Sets]({{< relref "/develop/data-types/sets" >}}) - [Sorted sets]({{< relref "/develop/data-types/sorted-sets" >}}) - - [Bitmaps]({{< relref "/develop/data-types/bitmaps" >}}) + - [Bitmaps]({{< relref "/develop/data-types/strings/bitmaps" >}}) - [Geospatial]({{< relref "/develop/data-types/geospatial" >}}) - [JSON]({{< relref "/develop/data-types/json" >}}) - [Time series]({{< relref "/develop/data-types/timeseries" >}}) @@ -174,7 +180,7 @@ weight: 10 ### Data Types -- [Bitmaps]({{< relref "/develop/data-types/bitmaps" >}}): +- [Bitmaps]({{< relref "/develop/data-types/strings/bitmaps" >}}): - Added BITOP documentation with Python testable code examples - Added bit operation diagrams diff --git a/content/develop/whats-new/redis-feature-sets.md b/content/develop/whats-new/redis-feature-sets.md index c90b292c89..4bc959a982 100644 --- a/content/develop/whats-new/redis-feature-sets.md +++ b/content/develop/whats-new/redis-feature-sets.md @@ -17,6 +17,7 @@ To use a new feature introduced in a later feature set, you must upgrade the cor | Redis feature set | What's new | |-------------------|------------| +| **Feature set version:** 8.8| See [here]({{< relref "/develop/whats-new/8-8" >}})| | **Feature set version:** 8.6| See [here]({{< relref "/develop/whats-new/8-6" >}})| | **Feature set version:** 8.4| See [here]({{< relref "/develop/whats-new/8-4" >}})| | **Feature set version:** 8.2| See [here]({{< relref "/develop/whats-new/8-2" >}})| diff --git a/content/operate/oss_and_stack/install/install-stack/_index.md b/content/operate/oss_and_stack/install/install-stack/_index.md index 74879929c4..5cd7d76d8b 100644 --- a/content/operate/oss_and_stack/install/install-stack/_index.md +++ b/content/operate/oss_and_stack/install/install-stack/_index.md @@ -164,11 +164,12 @@ A preview of Redis Open Source 8.2 RC1 is available on Windows through [Memurai] The latest version of Redis Open Source has been tested on the following platforms: -- Ubuntu 22.04 (Jammy Jellyfish) and 24.04 (Noble Numbat). -- Rocky Linux 8.10, 9.5. -- AlmaLinux 8.10, 9.5, and 10.1. -- Debian 12 (Bookworm) and 13 (Trixie). -- macOS 14 (Sonoma), and 15 (Sequoia). +- Ubuntu 22.04 (Jammy Jellyfish), 24.04 (Noble Numbat), and 26.04 (Resolute Raccoon). +- Rocky Linux 8.10, 9.7, and 10.1. +- AlmaLinux 8.10, 9.7, and 10.1. +- Debian 12.13 (Bookworm) and Debian 13.4 (Trixie). +- Alpine 3.23. +- macOS 14.8.4 (Sonoma), 15.7.4 (Sequoia), and 26.3 (Tahoe) - for both Intel and ARM processors. While you can install Redis Open Source on any of the platforms listed below, you might also consider using Redis Cloud by creating a [free account](https://redis.com/try-free/?utm_source=redisio&utm_medium=referral&utm_campaign=2023-09-try_free&utm_content=cu-redis_cloud_users). diff --git a/content/operate/oss_and_stack/install/version-mgmt.md b/content/operate/oss_and_stack/install/version-mgmt.md index 4c29f0d3a2..3c980f942e 100644 --- a/content/operate/oss_and_stack/install/version-mgmt.md +++ b/content/operate/oss_and_stack/install/version-mgmt.md @@ -17,9 +17,9 @@ Redis Open Source provides comprehensive version management that prioritizes cus Redis uses a **MAJOR.MINOR.PATCH** versioning scheme: -- **Major versions**: Significant changes that may include breaking changes (e.g., Redis 7 → Redis 8) -- **Minor versions**: New features and improvements within a major version (e.g., 8.2 → 8.4 → 8.6) -- **Patch versions**: Bug fixes and security updates (e.g., 8.2.1 → 8.2.2) +- **Major versions**: Significant changes that may include breaking changes (for example, Redis 7 → Redis 8). +- **Minor versions**: New features and improvements within a major version (for example, 8.2 → 8.4 → 8.6 → 8.8). +- **Patch versions**: Bug fixes and security updates (for example, 8.6.1 → 8.6.2). ## Supported versions @@ -29,6 +29,8 @@ Redis uses a **MAJOR.MINOR.PATCH** versioning scheme: | Version | Status | EOL Date | |---------|--------|----------| +| **Redis 8.8** | GA | TBD | +| **Redis 8.6** | GA | TBD | | **Redis 8.4** | GA | TBD | | **Redis 8.2** | GA | TBD | | **Redis 8.0** | GA | TBD | diff --git a/content/operate/oss_and_stack/management/config.md b/content/operate/oss_and_stack/management/config.md index 9cb25a7e4f..2bd2ad372e 100644 --- a/content/operate/oss_and_stack/management/config.md +++ b/content/operate/oss_and_stack/management/config.md @@ -43,6 +43,7 @@ backslashed hexadecimal notation "\\xff". The list of configuration directives, along with comments describing their meaning and intended usage, is available in the self-documented sample files `redis.conf` and `redis-full.conf` files shipped with the Redis distributions. +* Configuration files for Redis 8.8: [redis-full.conf](https://raw.githubusercontent.com/redis/redis/8.8/redis-full.conf) and [redis.conf](https://raw.githubusercontent.com/redis/redis/8.8/redis.conf). * Configuration files for Redis 8.6: [redis-full.conf](https://raw.githubusercontent.com/redis/redis/8.6/redis-full.conf) and [redis.conf](https://raw.githubusercontent.com/redis/redis/8.6/redis.conf). * Configuration files for Redis 8.4: [redis-full.conf](https://raw.githubusercontent.com/redis/redis/8.4/redis-full.conf) and [redis.conf](https://raw.githubusercontent.com/redis/redis/8.4/redis.conf). * Configuration files for Redis 8.2: [redis-full.conf](https://raw.githubusercontent.com/redis/redis/8.2/redis-full.conf) and [redis.conf](https://raw.githubusercontent.com/redis/redis/8.2/redis.conf). diff --git a/content/operate/oss_and_stack/management/security/acl.md b/content/operate/oss_and_stack/management/security/acl.md index 7247e5868f..093067a591 100644 --- a/content/operate/oss_and_stack/management/security/acl.md +++ b/content/operate/oss_and_stack/management/security/acl.md @@ -573,6 +573,8 @@ The external ACL file however is more powerful. You can do the following: Note that [`CONFIG REWRITE`](/commands/config-rewrite) does not also trigger [`ACL SAVE`](/commands/acl-save). When you use an ACL file, the configuration and the ACLs are handled separately. +Starting with Redis 8.8, the `ACL LOAD` command will allow comment lines starting with the `#` character. Any such comment lines are stripped when the ACL file is loaded and they are not persisted across `ACL LOAD`/`ACL SAVE` commands. + ## ACL rules for Sentinel and Replicas In case you don't want to provide Redis replicas and Redis Sentinel instances diff --git a/content/operate/oss_and_stack/stack-with-enterprise/release-notes/redisce/redisos-8.8-release-notes.md b/content/operate/oss_and_stack/stack-with-enterprise/release-notes/redisce/redisos-8.8-release-notes.md new file mode 100644 index 0000000000..faba96526d --- /dev/null +++ b/content/operate/oss_and_stack/stack-with-enterprise/release-notes/redisce/redisos-8.8-release-notes.md @@ -0,0 +1,166 @@ +--- +Title: Redis Open Source 8.8 release notes +alwaysopen: false +categories: +- docs +- operate +- stack +description: Redis Open Source 8.8 release notes. +linkTitle: v8.8.0 (May 2026) +min-version-db: blah +min-version-rs: blah +weight: 15 +--- + +## Redis Open Source 8.8.0 (May 2026) + +This is the General Availability release of Redis 8.8 in Redis Open Source. + +### Major changes compared to 8.6 + +- New data structure: Array (@antirez) +- Subkey notification for hash fields - field-level notifications +- `INCREX`: a window counter rate limiter combining `INCR`, `INCRBY`, `INCRBYFLOAT`, bounds, and expiration (@raffertyyu + Redis team) +- `XNACK`: a new streams command - allow consumers to explicitly release pending messages +- `ZUNION`, `ZINTER`, `ZUNIONSTORE`, `ZINTERSTORE`: new `COUNT` aggregator +- `JSON.SET`: new `FPHA` argument to specify the FP type for homogeneous FP arrays +- `TS.RANGE`, `TS.REVRANGE`, `TS.MRANGE`, `TS.MREVRANGE`: multiple aggregators in a single command +- `FT.HYBRID` `KNN` clause: new argument to request fewer candidates per shard +- `FT.PROFILE` `HYBRID`: profiling support for `FT.HYBRID` +- Performance improvements + +### Binary distributions + +- Alpine and Debian Docker images - https://hub.docker.com/_/redis +- Install using snap - see https://github.com/redis/redis-snap +- Install using brew - see https://github.com/redis/homebrew-redis +- Install using RPM - see https://github.com/redis/redis-rpm +- Install using Debian APT - see https://github.com/redis/redis-debian + +### Operating systems we test Redis 8.8 on + +- Ubuntu 22.04 (Jammy Jellyfish), 24.04 (Noble Numbat), 26.04 (Resolute Raccoon) +- Rocky Linux 8.10, 9.7, 10.1 +- AlmaLinux 8.10, 9.7, 10.1 +- Debian 12.13 (Bookworm), Debian 13.4 (Trixie) +- Alpine 3.23 +- macOS 14.8.4 (Sonoma), 15.7.4 (Sequoia), 26.3 (Tahoe) - for both Intel and ARM + +### Bug fixes (compared to 8.8-RC1) + +- [#15237](https://github.com/redis/redis/pull/15237) `INCREX` syntax update. +- [#15005](https://github.com/redis/redis/pull/15005) Memory tracking can be enabled at runtime in non-clustered mode . +- RedisTimeSeries/RedisTimeSeries[#1930](https://github.com/redistimeseries/redistimeseries/pull/1930) Cluster topology changes during a multi-shard command are not handled (MOD-14439). +- RedisBloom/RedisBloom[#1007](https://github.com/redisbloom/redisbloom/pull/1007) Memory leak on RDB load (MOD-15418). + +## Redis Open Source 8.8-RC1 (May 2026) + +This is the first Release Candidate of Redis 8.8 in Redis Open Source. + +Release Candidates are feature-complete pre-releases. Pre-releases are not suitable for production use. + +### Headlines: + +Redis 8.8 introduces new features and performance improvements. + +### Operating systems we test Redis 8.8 on + +- Ubuntu 22.04 (Jammy Jellyfish), 24.04 (Noble Numbat), 26.04 (Resolute Raccoon) +- Rocky Linux 8.10, 9.7, 10.1 +- AlmaLinux 8.10, 9.7, 10.1 +- Debian 12.13 (Bookworm), Debian 13.4 (Trixie) +- Alpine 3.23 +- macOS 14.8.4 (Sonoma), 15.7.4 (Sequoia), 26.3 (Tahoe) - for both Intel and ARM + +### Security fixes (compared to 8.8-M03) + +- (CVE-2026-23479) Use-After-Free in unblock client flow may lead to Remote Code Execution. +- (CVE-2026-25243) Invalid memory access in `RESTORE` may lead to Remote Code Execution. +- (CVE-2026-23631) Lua Use-After-Free may lead to remote code execution. +- (CVE-2026-25588) Invalid memory access in `RESTORE` may lead to Remote Code Execution (Time Series). +- (CVE-2026-25589) Invalid memory access in `RESTORE` may lead to Remote Code Execution (Probabilistic). + +### New Features (compared to 8.8-M03) + +- [#15162](https://github.com/redis/redis/pull/15162) New data structure: Array (@antirez) +- [#15045](https://github.com/redis/redis/pull/15045) `INCREX`: a window counter rate limiter combining `INCR`,`INCRBY`,`INCRBYFLOAT`, bounds, and expiration (@raffertyyu + Redis team) +- In group sorting new reducer, allowing unwind grouped documents (after `GROUPBY`) and sort them + +### Removed Features (compared to 8.8-M03) + +- [#15191](https://github.com/redis/redis/pull/15191) Remove GCRA rate limiter + +### Bug fixes (compared to 8.8-M03) + +- `SUBSCRIBE`, `PSUBSCRIBE`, `SSUBSCRIBE`: crash on OOM (RED-167788) +- `CONFIG SET`: some settings allow invalid characters (RED-167787) +- `SCRIPT DEBUG`: potential crash on scripts (RED-175507) +- `VADD`: crash or buffer overflow on large `REDUCE` value (RED-170921) +- `VSET`: crash on huge allocations (MOD-12678) +- [#15188](https://github.com/redis/redis/pull/15188) `cluster-announce-ip` rejecting hostnames (regression) +- [#15095](https://github.com/redis/redis/pull/15095) Double free when loading streams with duplicate consumer PEL entries +- [#15124](https://github.com/redis/redis/pull/15124) Issues processing corrupt Streams RDB data +- [#15111](https://github.com/redis/redis/pull/15111) `fast_float_strtod` rounding mismatch +- [#15190](https://github.com/redis/redis/pull/15190) `vecClear` reset the logical size without releasing element ownership +- [#15163](https://github.com/redis/redis/pull/15163) `MULTI` queue memory incorrect memory accounting +- [#15094](https://github.com/redis/redis/pull/15094) Cluster crash when `CLIENT KILL` unsubscribes `SSUBSCRIBE` client inside `EXEC` +- [#15151](https://github.com/redis/redis/pull/15151) Listpack backlength encoding thresholds off-by-one +- [#15115](https://github.com/redis/redis/pull/15115) Under-copy in the Lua debugger +- [#14970](https://github.com/redis/redis/pull/14970) Sentinel config injection via `SENTINEL SET` +- [#14934](https://github.com/redis/redis/pull/14934) Client output buffer memory tracking not accounting for copy-avoided bulk string references +- RediSearch/RediSearch[#9182](https://github.com/redisearch/redisearch/pull/9182) `FT.PROFILE HYBRID` returns an empty reply (MOD-14778) +- RediSearch/RediSearch[#9079](https://github.com/redisearch/redisearch/pull/9079) `FT.SPELLCHECK` treats `PARAMS` placeholders as literal terms instead of resolving them (MOD-10596) +- RediSearch/RediSearch[#9047](https://github.com/redisearch/redisearch/pull/9047) `FT.PROFILE` output is inconsistent when a profiled value is missing (MOD-10560) +- RediSearch/RediSearch[#9078](https://github.com/redisearch/redisearch/pull/9078) `FT.CREATE` now rejects schema definitions with invalid option combinations at creation time (MOD-14655) +- RediSearch/RediSearch[#9012](https://github.com/redisearch/redisearch/pull/9012) `PERSIST` and `HPERSIST` notifications are not reflected in index expiration tracking (MOD-14800) +- RediSearch/RediSearch[#9066](https://github.com/redisearch/redisearch/pull/9066) Race condition in `FT.HYBRID` causes intermittent failures under concurrent hybrid query load (MOD-14732) +- RediSearch/RediSearch[#9163](https://github.com/redisearch/redisearch/pull/9163) Crash on `FT.SEARCH` when topology validation fails (for example, some nodes unreachable) (MOD-14475) +- RediSearch/RediSearch[#9031](https://github.com/redisearch/redisearch/pull/9031), RediSearch/RediSearch[#9473](https://github.com/redisearch/redisearch/pull/9473) Coordinator deadlock under mixed `FT.SEARCH` and `FT.AGGREGATE` load (MOD-14268) +- RediSearch/RediSearch[#9028](https://github.com/redisearch/redisearch/pull/9028) Memory leak when `FT.DROPINDEX` runs concurrently with in-flight hybrid queries (MOD-14135) +- RediSearch/RediSearch[#9310](https://github.com/redisearch/redisearch/pull/9310), RediSearch/RediSearch[#9350](https://github.com/redisearch/redisearch/pull/9350) `FT.CURSOR READ` timeout and `ON_TIMEOUT FAIL` not enforced on coordinator and shard (MOD-14284, MOD-14998) +- RediSearch/RediSearch[#9425](https://github.com/redisearch/redisearch/pull/9425) Cursors not cleaned up after `MAXIDLE`, causing resource exhaustion (MOD-6430) +- RediSearch/RediSearch[#9234](https://github.com/redisearch/redisearch/pull/9234), RediSearch/RediSearch[#9404](https://github.com/redisearch/redisearch/pull/9404) Coordinator `RETURN_STRICT` returns wrong data on partial results, including `SORTBY` pipeline (MOD-13617) +- RediSearch/RediSearch[#9382](https://github.com/redisearch/redisearch/pull/9382) `MAXPREFIXEXPANSION` warnings not propagated to clients in cluster mode (MOD-13804) +- RediSearch/RediSearch[#9218](https://github.com/redisearch/redisearch/pull/9218) Search commands fail when no worker thread is available instead of falling back to main thread (MOD-14921) +- RediSearch/RediSearch[#9448](https://github.com/redisearch/redisearch/pull/9448) RDB load missing validation of `FT.CREATE` arguments, allowing corrupt index state on load (MOD-13118) +- RediSearch/RediSearch[#9377](https://github.com/redisearch/redisearch/pull/9377) Use-after-move in `Indexer_Process` causes crash during indexing (MOD-14980) +- RediSearch/RediSearch[#9408](https://github.com/redisearch/redisearch/pull/9408) Deadlock between background query and main-thread writer (MOD-15364) +- RediSearch/RediSearch[#9114](https://github.com/redisearch/redisearch/pull/9114) `FT.PROFILE` prints output using wrong iterator type (MOD-14678) +- RediSearch/RediSearch[#9421](https://github.com/redisearch/redisearch/pull/9421) Confusing error returned when `DEBUG_PARAMS_COUNT` is zero (MOD-15118) +- RediSearch/RediSearch[#9045](https://github.com/redisearch/redisearch/pull/9045) Stack-smashing error in coordinator code path (MOD-14649) +- RedisJSON/RedisJSON[#1554](https://github.com/redisjson/redisjson/pull/1554) Trailing chars are ignored (MOD-7266); Fixes RedisJSON/RedisJSON[#976](https://github.com/redisjson/redisjson/pull/976) +- RedisJSON/RedisJSON[#1543](https://github.com/redisjson/redisjson/pull/1543) Wrong mutation ordering for array commands with recursive paths (MOD-6722) +- RedisJSON/RedisJSON[#1542](https://github.com/redisjson/redisjson/pull/1542) JSONPath evaluation issues (MOD-14664); Fixes RedisJSON/RedisJSON[#968](https://github.com/redisjson/redisjson/pull/968) (MOD-7264), RedisJSON/RedisJSON[#962](https://github.com/redisjson/redisjson/pull/962) (MOD-7272), RedisJSON/RedisJSON[#963](https://github.com/redisjson/redisjson/pull/963) (MOD-7270), RedisJSON/RedisJSON[#1089](https://github.com/redisjson/redisjson/pull/1089) (MOD-7268) +- RedisTimeSeries/RedisTimeSeries[#2003](https://github.com/redistimeseries/redistimeseries/pull/2003) Potential crash on disconnections and TLS failures (MOD-14850) +- RedisTimeSeries/RedisTimeSeries[#2013](https://github.com/redistimeseries/redistimeseries/pull/2013) `count`, `countNaN`, `countAll` reducers return NaN when all values are NaN (MOD-14420) + +### Performance and resource utilization improvements (compared to 8.8-M03) + +- [#15049](https://github.com/redis/redis/pull/15049) Hyperloglog: 4 independent accumulators that are merged at the end +- [#15133](https://github.com/redis/redis/pull/15133) Batched prefetch for `MGET` and `MSET` +- [#14988](https://github.com/redis/redis/pull/14988) Batched prefetch for `HGETALL` on hashtable-encoded hashes +- [#15071](https://github.com/redis/redis/pull/15071) Pass size hint to jemalloc for faster deallocation +- [#15096](https://github.com/redis/redis/pull/15096) Reduces allocator and accounting overhead by adding compile-time jemalloc tuning +- RediSearch/RediSearch[#9197](https://github.com/redisearch/redisearch/pull/9197) Vector index hot path (HNSW and brute-force) devirtualized, reducing per-query latency (MOD-14916) +- RediSearch/RediSearch[#9262](https://github.com/redisearch/redisearch/pull/9262), RediSearch/RediSearch[#9476](https://github.com/redisearch/redisearch/pull/9476) Inline LSE atomics enabled on AArch64, improving atomic operation throughput on ARM64 (MOD-14916, MOD-15419) +- RediSearch/RediSearch[#9293](https://github.com/redisearch/redisearch/pull/9293) Expiration handling overhead reduced when many keys expire simultaneously (MOD-14916) +- RediSearch/RediSearch[#9017](https://github.com/redisearch/redisearch/pull/9017) LTO (link-time optimization) enabled for x86_64 release builds (MOD-14700) +- RediSearch/RediSearch[#8765](https://github.com/redisearch/redisearch/pull/8765) Shard-level timeout adjusted to coordinator dispatch time for more accurate accounting (MOD-13189) +- RediSearch/RediSearch[#8790](https://github.com/redisearch/redisearch/pull/8790), RediSearch/RediSearch[#8900](https://github.com/redisearch/redisearch/pull/8900), RediSearch/RediSearch[#8827](https://github.com/redisearch/redisearch/pull/8827), RediSearch/RediSearch[#8971](https://github.com/redisearch/redisearch/pull/8971), RediSearch/RediSearch[#8966](https://github.com/redisearch/redisearch/pull/8966), RediSearch/RediSearch[#8762](https://github.com/redisearch/redisearch/pull/8762), RediSearch/RediSearch[#8678](https://github.com/redisearch/redisearch/pull/8678), RediSearch/RediSearch[#8915](https://github.com/redisearch/redisearch/pull/8915), RediSearch/RediSearch[#8653](https://github.com/redisearch/redisearch/pull/8653), RediSearch/RediSearch[#9085](https://github.com/redisearch/redisearch/pull/9085), RediSearch/RediSearch[#8751](https://github.com/redisearch/redisearch/pull/8751), RediSearch/RediSearch[#8692](https://github.com/redisearch/redisearch/pull/8692), RediSearch/RediSearch[#9224](https://github.com/redisearch/redisearch/pull/9224) Iterators ported to Rust, reducing FFI overhead +- RediSearch/RediSearch[#9500](https://github.com/redisearch/redisearch/pull/9500) `numRecords` no longer updated for vector fields, removing unnecessary write overhead on ingest (MOD-15487) +- VecSim SVS thread pool integrated with the worker pool for better thread utilization (MOD-9881) + +### Configuration parameters + +- [#15182](https://github.com/redis/redis/pull/15182) Slowlog entry truncation limits: + - `slowlog-entry-max-argc`: maximum number of command arguments kept in a slowlog entry + - `slowlog-entry-max-string-len`: maximum length of a command argument in a slowlog entry +- RediSearch/RediSearch[#8876](https://github.com/redisearch/redisearch/pull/8876), RediSearch/RediSearch[#8960](https://github.com/redisearch/redisearch/pull/8960) Default maximum worker threads value updated; `MAX_WORKER_THREADS` is now a string config (MOD-14486, MOD-14763) + +### Metrics (compared to 8.8-M03) + +- RediSearch/RediSearch[#8210](https://github.com/redisearch/redisearch/pull/8210), RediSearch/RediSearch[#8231](https://github.com/redisearch/redisearch/pull/8231) `FT.PROFILE`: added queue time tracking (MOD-13602) + +### CLI tools + +- [#15150](https://github.com/redis/redis/pull/15150) Memory leak on malformed legacy help entry in redis-cli diff --git a/content/operate/rs/references/compatibility/commands/data-types.md b/content/operate/rs/references/compatibility/commands/data-types.md index 24b377bf1c..6a1e6b3eae 100644 --- a/content/operate/rs/references/compatibility/commands/data-types.md +++ b/content/operate/rs/references/compatibility/commands/data-types.md @@ -15,6 +15,29 @@ weight: 10 The following tables show which Redis Open Source data type commands are compatible with standard and Active-Active databases in Redis Software and Redis Cloud. +## Array commands + +| Command | Redis
Software | Redis
Cloud | Notes | +|:--------|:----------------------|:-----------------|:------| +| [ARCOUNT]({{< relref "/commands/arcount" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | +| [ARDEL]({{< relref "/commands/ardel" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | +| [ARDELRANGE]({{< relref "/commands/ardelrange" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | +| [ARGET]({{< relref "/commands/arget" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | +| [ARGETRANGE]({{< relref "/commands/argetrange" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | +| [ARGREP]({{< relref "/commands/argrep" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | +| [ARINFO]({{< relref "/commands/arinfo" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | +| [ARINSERT]({{< relref "/commands/arinsert" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | +| [ARLASTITEMS]({{< relref "/commands/arlastitems" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | +| [ARLEN]({{< relref "/commands/arlen" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | +| [ARMGET]({{< relref "/commands/armget" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | +| [ARMSET]({{< relref "/commands/armset" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | +| [ARNEXT]({{< relref "/commands/arnext" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | +| [AROP]({{< relref "/commands/arop" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | +| [ARRING]({{< relref "/commands/arring" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | +| [ARSCAN]({{< relref "/commands/arscan" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | +| [ARSEEK]({{< relref "/commands/arseek" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | +| [ARSET]({{< relref "/commands/arset" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | + ## Bitmap commands | Command | Redis
Software | Redis
Cloud | Notes | @@ -194,8 +217,10 @@ The following tables show which Redis Open Source data type commands are compati | [XDEL]({{< relref "/commands/xdel" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | | | [XDELEX]({{< relref "/commands/xdelex" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | | | [XGROUP]({{< relref "/commands/xgroup" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | | +| [XIDMPRECORD]({{< relref "/commands/xidmprecord" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [XINFO]({{< relref "/commands/xinfo" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | | | [XLEN]({{< relref "/commands/xlen" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | | +| [XNACK]({{< relref "/commands/xnack" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [XPENDING]({{< relref "/commands/xpending" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | | | [XRANGE]({{< relref "/commands/xrange" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | | | [XREAD]({{< relref "/commands/xread" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | | @@ -220,6 +245,7 @@ The following tables show which Redis Open Source data type commands are compati | [INCR]({{< relref "/commands/incr" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | | | [INCRBY]({{< relref "/commands/incrby" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | | | [INCRBYFLOAT]({{< relref "/commands/incrbyfloat" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | | +| [INCREX]({{< relref "/commands/increx" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [LCS]({{< relref "/commands/lcs" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | | | [MGET]({{< relref "/commands/mget" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | | | [MSET]({{< relref "/commands/mset" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | | diff --git a/data/commands.json b/data/commands.json index 89a6283c9f..3fc9a464ae 100644 --- a/data/commands.json +++ b/data/commands.json @@ -402,126 +402,111 @@ "fast" ] }, - "ASKING": { - "summary": "Signals that a cluster client is following an -ASK redirect.", - "since": "3.0.0", - "group": "cluster", + "ARCOUNT": { + "summary": "Returns the number of non-empty elements in an array.", + "since": "8.8.0", + "group": "array", "complexity": "O(1)", "acl_categories": [ - "@fast", - "@connection" - ], - "arity": 1, - "command_flags": [ - "fast" - ] - }, - "AUTH": { - "summary": "Authenticates the connection.", - "since": "1.0.0", - "group": "connection", - "complexity": "O(N) where N is the number of passwords defined for the user", - "history": [ - [ - "6.0.0", - "Added ACL style (username and password)." - ] + "@read", + "@array", + "@fast" ], - "acl_categories": [ - "@fast", - "@connection" + "arity": 2, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } ], - "arity": -2, "arguments": [ { - "name": "username", - "type": "string", - "display_text": "username", - "since": "6.0.0", - "optional": true - }, - { - "name": "password", - "type": "string", - "display_text": "password" + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 } ], "command_flags": [ - "noscript", - "loading", - "stale", - "fast", - "no_auth", - "allow_busy" + "readonly", + "fast" ] }, - "BGREWRITEAOF": { - "summary": "Asynchronously rewrites the append-only file to disk.", - "since": "1.0.0", - "group": "server", - "complexity": "O(1)", + "ARDEL": { + "summary": "Deletes elements at the specified indices in an array.", + "since": "8.8.0", + "group": "array", + "complexity": "O(N) where N is the number of indices to delete", "acl_categories": [ - "@admin", - "@slow", - "@dangerous" - ], - "arity": 1, - "command_flags": [ - "admin", - "noscript", - "no_async_loading" - ] - }, - "BGSAVE": { - "summary": "Asynchronously saves the database(s) to disk.", - "since": "1.0.0", - "group": "server", - "complexity": "O(1)", - "history": [ - [ - "3.2.2", - "Added the `SCHEDULE` option." - ] + "@write", + "@array", + "@fast" ], - "acl_categories": [ - "@admin", - "@slow", - "@dangerous" + "arity": -3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "delete": true + } ], - "arity": -1, "arguments": [ { - "name": "schedule", - "type": "pure-token", - "display_text": "schedule", - "token": "SCHEDULE", - "since": "3.2.2", - "optional": true + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "index", + "type": "integer", + "display_text": "index", + "multiple": true } ], "command_flags": [ - "admin", - "noscript", - "no_async_loading" + "write", + "fast" ] }, - "BITCOUNT": { - "summary": "Counts the number of set bits (population counting) in a string.", - "since": "2.6.0", - "group": "bitmap", - "complexity": "O(N)", - "history": [ - [ - "7.0.0", - "Added the `BYTE|BIT` option." - ] - ], + "ARDELRANGE": { + "summary": "Deletes elements in one or more ranges.", + "since": "8.8.0", + "group": "array", + "complexity": "Proportional to the number of existing elements / slices touched, not to the numeric span of the requested ranges", "acl_categories": [ - "@read", - "@bitmap", + "@write", + "@array", "@slow" ], - "arity": -2, + "arity": -4, "key_specs": [ { "begin_search": { @@ -538,8 +523,8 @@ "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "delete": true } ], "arguments": [ @@ -552,7 +537,7 @@ { "name": "range", "type": "block", - "optional": true, + "multiple": true, "arguments": [ { "name": "start", @@ -563,48 +548,76 @@ "name": "end", "type": "integer", "display_text": "end" - }, - { - "name": "unit", - "type": "oneof", - "since": "7.0.0", - "optional": true, - "arguments": [ - { - "name": "byte", - "type": "pure-token", - "display_text": "byte", - "token": "BYTE" - }, - { - "name": "bit", - "type": "pure-token", - "display_text": "bit", - "token": "BIT" - } - ] } ] } ], "command_flags": [ - "readonly" + "write" ] }, - "BITFIELD": { - "summary": "Performs arbitrary bitfield integer operations on strings.", - "since": "3.2.0", - "group": "bitmap", - "complexity": "O(1) for each subcommand specified", + "ARGET": { + "summary": "Gets the value at an index in an array.", + "since": "8.8.0", + "group": "array", + "complexity": "O(1)", "acl_categories": [ - "@write", - "@bitmap", + "@read", + "@array", + "@fast" + ], + "arity": 3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "index", + "type": "integer", + "display_text": "index" + } + ], + "command_flags": [ + "readonly", + "fast" + ] + }, + "ARGETRANGE": { + "summary": "Gets values in a range of indices.", + "since": "8.8.0", + "group": "array", + "complexity": "O(N) where N is the range length", + "acl_categories": [ + "@read", + "@array", "@slow" ], - "arity": -2, + "arity": 4, "key_specs": [ { - "notes": "This command allows both access and modification of the key", "begin_search": { "type": "index", "spec": { @@ -619,10 +632,8 @@ "limit": 0 } }, - "RW": true, - "access": true, - "update": true, - "variable_flags": true + "RO": true, + "access": true } ], "arguments": [ @@ -633,129 +644,31 @@ "key_spec_index": 0 }, { - "name": "operation", - "type": "oneof", - "optional": true, - "multiple": true, - "arguments": [ - { - "name": "get-block", - "type": "block", - "token": "GET", - "arguments": [ - { - "name": "encoding", - "type": "string", - "display_text": "encoding" - }, - { - "name": "offset", - "type": "integer", - "display_text": "offset" - } - ] - }, - { - "name": "write", - "type": "block", - "arguments": [ - { - "name": "overflow-block", - "type": "oneof", - "token": "OVERFLOW", - "optional": true, - "arguments": [ - { - "name": "wrap", - "type": "pure-token", - "display_text": "wrap", - "token": "WRAP" - }, - { - "name": "sat", - "type": "pure-token", - "display_text": "sat", - "token": "SAT" - }, - { - "name": "fail", - "type": "pure-token", - "display_text": "fail", - "token": "FAIL" - } - ] - }, - { - "name": "write-operation", - "type": "oneof", - "arguments": [ - { - "name": "set-block", - "type": "block", - "token": "SET", - "arguments": [ - { - "name": "encoding", - "type": "string", - "display_text": "encoding" - }, - { - "name": "offset", - "type": "integer", - "display_text": "offset" - }, - { - "name": "value", - "type": "integer", - "display_text": "value" - } - ] - }, - { - "name": "incrby-block", - "type": "block", - "token": "INCRBY", - "arguments": [ - { - "name": "encoding", - "type": "string", - "display_text": "encoding" - }, - { - "name": "offset", - "type": "integer", - "display_text": "offset" - }, - { - "name": "increment", - "type": "integer", - "display_text": "increment" - } - ] - } - ] - } - ] - } - ] + "name": "start", + "type": "integer", + "display_text": "start" + }, + { + "name": "end", + "type": "integer", + "display_text": "end" } ], "command_flags": [ - "write", - "denyoom" + "readonly" ] }, - "BITFIELD_RO": { - "summary": "Performs arbitrary read-only bitfield integer operations on strings.", - "since": "6.0.0", - "group": "bitmap", - "complexity": "O(1) for each subcommand specified", + "ARGREP": { + "summary": "Searches array elements in a range using textual predicates.", + "since": "8.8.0", + "group": "array", + "complexity": "O(P * C) where P is the number of visited positions in touched slices and C is the cost of evaluating the predicates on one existing element.", "acl_categories": [ "@read", - "@bitmap", - "@fast" + "@array", + "@slow" ], - "arity": -2, + "arity": -6, "key_specs": [ { "begin_search": { @@ -784,48 +697,150 @@ "key_spec_index": 0 }, { - "name": "get-block", - "type": "block", - "token": "GET", + "name": "start", + "type": "string", + "display_text": "start" + }, + { + "name": "end", + "type": "string", + "display_text": "end" + }, + { + "name": "predicate", + "type": "oneof", + "multiple": true, + "arguments": [ + { + "name": "exact", + "type": "block", + "arguments": [ + { + "name": "exact", + "type": "pure-token", + "display_text": "exact", + "token": "EXACT" + }, + { + "name": "string", + "type": "string", + "display_text": "string" + } + ] + }, + { + "name": "match", + "type": "block", + "arguments": [ + { + "name": "match", + "type": "pure-token", + "display_text": "match", + "token": "MATCH" + }, + { + "name": "string", + "type": "string", + "display_text": "string" + } + ] + }, + { + "name": "glob", + "type": "block", + "arguments": [ + { + "name": "glob", + "type": "pure-token", + "display_text": "glob", + "token": "GLOB" + }, + { + "name": "pattern", + "type": "string", + "display_text": "pattern" + } + ] + }, + { + "name": "re", + "type": "block", + "arguments": [ + { + "name": "re", + "type": "pure-token", + "display_text": "re", + "token": "RE" + }, + { + "name": "pattern", + "type": "string", + "display_text": "pattern" + } + ] + } + ] + }, + { + "name": "options", + "type": "oneof", "optional": true, "multiple": true, - "multiple_token": true, "arguments": [ { - "name": "encoding", - "type": "string", - "display_text": "encoding" + "name": "and", + "type": "pure-token", + "display_text": "and", + "token": "AND" }, { - "name": "offset", + "name": "or", + "type": "pure-token", + "display_text": "or", + "token": "OR" + }, + { + "name": "limit", "type": "integer", - "display_text": "offset" + "display_text": "limit", + "token": "LIMIT" + }, + { + "name": "withvalues", + "type": "pure-token", + "display_text": "withvalues", + "token": "WITHVALUES" + }, + { + "name": "nocase", + "type": "pure-token", + "display_text": "nocase", + "token": "NOCASE" } ] } ], "command_flags": [ - "readonly", - "fast" + "readonly" ] }, - "BITOP": { - "summary": "Performs bitwise operations on multiple strings, and stores the result.", - "since": "2.6.0", - "group": "bitmap", - "complexity": "O(N)", + "ARINFO": { + "summary": "Returns metadata about an array.", + "since": "8.8.0", + "group": "array", + "complexity": "O(1), or O(N) with FULL option where N is the number of slices.", "acl_categories": [ - "@write", - "@bitmap", + "@read", + "@array", "@slow" ], - "arity": -4, + "arity": -2, "key_specs": [ { "begin_search": { "type": "index", "spec": { - "index": 2 + "index": 1 } }, "find_keys": { @@ -836,92 +851,88 @@ "limit": 0 } }, - "OW": true, - "update": true + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 }, + { + "name": "full", + "type": "pure-token", + "display_text": "full", + "token": "FULL", + "optional": true + } + ], + "command_flags": [ + "readonly" + ] + }, + "ARINSERT": { + "summary": "Inserts one or more values at consecutive indices.", + "since": "8.8.0", + "group": "array", + "complexity": "O(N) where N is the number of values", + "acl_categories": [ + "@write", + "@array", + "@fast" + ], + "arity": -3, + "key_specs": [ { "begin_search": { "type": "index", "spec": { - "index": 3 + "index": 1 } }, "find_keys": { "type": "range", "spec": { - "lastkey": -1, + "lastkey": 0, "keystep": 1, "limit": 0 } }, - "RO": true, - "access": true - } + "RW": true, + "update": true + } ], "arguments": [ { - "name": "operation", - "type": "oneof", - "arguments": [ - { - "name": "and", - "type": "pure-token", - "display_text": "and", - "token": "AND" - }, - { - "name": "or", - "type": "pure-token", - "display_text": "or", - "token": "OR" - }, - { - "name": "xor", - "type": "pure-token", - "display_text": "xor", - "token": "XOR" - }, - { - "name": "not", - "type": "pure-token", - "display_text": "not", - "token": "NOT" - } - ] - }, - { - "name": "destkey", + "name": "key", "type": "key", - "display_text": "destkey", + "display_text": "key", "key_spec_index": 0 }, { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 1, + "name": "value", + "type": "string", + "display_text": "value", "multiple": true } ], "command_flags": [ "write", - "denyoom" + "denyoom", + "fast" ] }, - "BITPOS": { - "summary": "Finds the first set (1) or clear (0) bit in a string.", - "since": "2.8.7", - "group": "bitmap", - "complexity": "O(N)", - "history": [ - [ - "7.0.0", - "Added the `BYTE|BIT` option." - ] - ], + "ARLASTITEMS": { + "summary": "Returns the most recently inserted elements.", + "since": "8.8.0", + "group": "array", + "complexity": "O(N) where N is the count", "acl_categories": [ "@read", - "@bitmap", + "@array", "@slow" ], "arity": -3, @@ -953,71 +964,33 @@ "key_spec_index": 0 }, { - "name": "bit", + "name": "count", "type": "integer", - "display_text": "bit" + "display_text": "count" }, { - "name": "range", - "type": "block", - "optional": true, - "arguments": [ - { - "name": "start", - "type": "integer", - "display_text": "start" - }, - { - "name": "end-unit-block", - "type": "block", - "optional": true, - "arguments": [ - { - "name": "end", - "type": "integer", - "display_text": "end" - }, - { - "name": "unit", - "type": "oneof", - "since": "7.0.0", - "optional": true, - "arguments": [ - { - "name": "byte", - "type": "pure-token", - "display_text": "byte", - "token": "BYTE" - }, - { - "name": "bit", - "type": "pure-token", - "display_text": "bit", - "token": "BIT" - } - ] - } - ] - } - ] + "name": "rev", + "type": "pure-token", + "display_text": "rev", + "token": "REV", + "optional": true } ], "command_flags": [ "readonly" ] }, - "BLMOVE": { - "summary": "Pops an element from a list, pushes it to another list and returns it. Blocks until an element is available otherwise. Deletes the list if the last element was moved.", - "since": "6.2.0", - "group": "list", + "ARLEN": { + "summary": "Returns the length of an array (max index + 1).", + "since": "8.8.0", + "group": "array", "complexity": "O(1)", "acl_categories": [ - "@write", - "@list", - "@slow", - "@blocking" + "@read", + "@array", + "@fast" ], - "arity": 6, + "arity": 2, "key_specs": [ { "begin_search": { @@ -1034,15 +1007,40 @@ "limit": 0 } }, - "RW": true, - "access": true, - "delete": true - }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + } + ], + "command_flags": [ + "readonly", + "fast" + ] + }, + "ARMGET": { + "summary": "Gets values at multiple indices in an array.", + "since": "8.8.0", + "group": "array", + "complexity": "O(N) where N is the number of indices", + "acl_categories": [ + "@read", + "@array", + "@fast" + ], + "arity": -3, + "key_specs": [ { "begin_search": { "type": "index", "spec": { - "index": 2 + "index": 1 } }, "find_keys": { @@ -1053,172 +1051,102 @@ "limit": 0 } }, - "RW": true, - "insert": true + "RO": true, + "access": true } ], "arguments": [ { - "name": "source", + "name": "key", "type": "key", - "display_text": "source", + "display_text": "key", "key_spec_index": 0 }, { - "name": "destination", - "type": "key", - "display_text": "destination", - "key_spec_index": 1 - }, - { - "name": "wherefrom", - "type": "oneof", - "arguments": [ - { - "name": "left", - "type": "pure-token", - "display_text": "left", - "token": "LEFT" - }, - { - "name": "right", - "type": "pure-token", - "display_text": "right", - "token": "RIGHT" - } - ] - }, - { - "name": "whereto", - "type": "oneof", - "arguments": [ - { - "name": "left", - "type": "pure-token", - "display_text": "left", - "token": "LEFT" - }, - { - "name": "right", - "type": "pure-token", - "display_text": "right", - "token": "RIGHT" - } - ] - }, - { - "name": "timeout", - "type": "double", - "display_text": "timeout" + "name": "index", + "type": "integer", + "display_text": "index", + "multiple": true } ], "command_flags": [ - "write", - "denyoom", - "blocking" + "readonly", + "fast" ] }, - "BLMPOP": { - "summary": "Pops the first element from one of multiple lists. Blocks until an element is available otherwise. Deletes the list if the last element was popped.", - "since": "7.0.0", - "group": "list", - "complexity": "O(N+M) where N is the number of provided keys and M is the number of elements returned.", + "ARMSET": { + "summary": "Sets multiple index-value pairs in an array.", + "since": "8.8.0", + "group": "array", + "complexity": "O(N) where N is the number of pairs", "acl_categories": [ "@write", - "@list", - "@slow", - "@blocking" + "@array", + "@fast" ], - "arity": -5, + "arity": -4, "key_specs": [ { "begin_search": { "type": "index", "spec": { - "index": 2 + "index": 1 } }, "find_keys": { - "type": "keynum", + "type": "range", "spec": { - "keynumidx": 0, - "firstkey": 1, - "keystep": 1 + "lastkey": 0, + "keystep": 1, + "limit": 0 } }, "RW": true, - "access": true, - "delete": true + "update": true } ], "arguments": [ - { - "name": "timeout", - "type": "double", - "display_text": "timeout" - }, - { - "name": "numkeys", - "type": "integer", - "display_text": "numkeys" - }, { "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0, - "multiple": true + "key_spec_index": 0 }, { - "name": "where", - "type": "oneof", + "name": "data", + "type": "block", + "multiple": true, "arguments": [ { - "name": "left", - "type": "pure-token", - "display_text": "left", - "token": "LEFT" + "name": "index", + "type": "integer", + "display_text": "index" }, { - "name": "right", - "type": "pure-token", - "display_text": "right", - "token": "RIGHT" + "name": "value", + "type": "string", + "display_text": "value" } ] - }, - { - "name": "count", - "type": "integer", - "display_text": "count", - "token": "COUNT", - "optional": true } ], "command_flags": [ "write", - "blocking", - "movablekeys" + "denyoom", + "fast" ] }, - "BLPOP": { - "summary": "Removes and returns the first element in a list. Blocks until an element is available otherwise. Deletes the list if the last element was popped.", - "since": "2.0.0", - "group": "list", - "complexity": "O(N) where N is the number of provided keys.", - "history": [ - [ - "6.0.0", - "`timeout` is interpreted as a double instead of an integer." - ] - ], + "ARNEXT": { + "summary": "Returns the next index ARINSERT would use.", + "since": "8.8.0", + "group": "array", + "complexity": "O(1)", "acl_categories": [ - "@write", - "@list", - "@slow", - "@blocking" + "@read", + "@array", + "@fast" ], - "arity": -3, + "arity": 2, "key_specs": [ { "begin_search": { @@ -1230,14 +1158,13 @@ "find_keys": { "type": "range", "spec": { - "lastkey": -2, + "lastkey": 0, "keystep": 1, "limit": 0 } }, - "RW": true, - "access": true, - "delete": true + "RO": true, + "access": true } ], "arguments": [ @@ -1245,38 +1172,25 @@ "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0, - "multiple": true - }, - { - "name": "timeout", - "type": "double", - "display_text": "timeout" + "key_spec_index": 0 } ], "command_flags": [ - "write", - "blocking" + "readonly", + "fast" ] }, - "BRPOP": { - "summary": "Removes and returns the last element in a list. Blocks until an element is available otherwise. Deletes the list if the last element was popped.", - "since": "2.0.0", - "group": "list", - "complexity": "O(N) where N is the number of provided keys.", - "history": [ - [ - "6.0.0", - "`timeout` is interpreted as a double instead of an integer." - ] - ], + "AROP": { + "summary": "Performs aggregate operations on array elements in a range.", + "since": "8.8.0", + "group": "array", + "complexity": "O(P) where P is visited positions in touched slices (dense scanned slots + sparse entries), with worst-case O(|end-start|+1) and typical case close to O(N), where N is the number of existing elements in range.", "acl_categories": [ - "@write", - "@list", - "@slow", - "@blocking" + "@read", + "@array", + "@slow" ], - "arity": -3, + "arity": -5, "key_specs": [ { "begin_search": { @@ -1288,14 +1202,13 @@ "find_keys": { "type": "range", "spec": { - "lastkey": -2, + "lastkey": 0, "keystep": 1, "limit": 0 } }, - "RW": true, - "access": true, - "delete": true + "RO": true, + "access": true } ], "arguments": [ @@ -1303,40 +1216,99 @@ "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0, - "multiple": true + "key_spec_index": 0 }, { - "name": "timeout", - "type": "double", - "display_text": "timeout" + "name": "start", + "type": "integer", + "display_text": "start" + }, + { + "name": "end", + "type": "integer", + "display_text": "end" + }, + { + "name": "operation", + "type": "oneof", + "arguments": [ + { + "name": "sum", + "type": "pure-token", + "display_text": "sum", + "token": "SUM" + }, + { + "name": "min", + "type": "pure-token", + "display_text": "min", + "token": "MIN" + }, + { + "name": "max", + "type": "pure-token", + "display_text": "max", + "token": "MAX" + }, + { + "name": "and", + "type": "pure-token", + "display_text": "and", + "token": "AND" + }, + { + "name": "or", + "type": "pure-token", + "display_text": "or", + "token": "OR" + }, + { + "name": "xor", + "type": "pure-token", + "display_text": "xor", + "token": "XOR" + }, + { + "name": "match", + "type": "block", + "arguments": [ + { + "name": "match", + "type": "pure-token", + "display_text": "match", + "token": "MATCH" + }, + { + "name": "value", + "type": "string", + "display_text": "value" + } + ] + }, + { + "name": "used", + "type": "pure-token", + "display_text": "used", + "token": "USED" + } + ] } ], "command_flags": [ - "write", - "blocking" + "readonly" ] }, - "BRPOPLPUSH": { - "summary": "Pops an element from a list, pushes it to another list and returns it. Block until an element is available otherwise. Deletes the list if the last element was popped.", - "since": "2.2.0", - "group": "list", - "complexity": "O(1)", - "deprecated_since": "6.2.0", - "replaced_by": "`BLMOVE` with the `RIGHT` and `LEFT` arguments", - "history": [ - [ - "6.0.0", - "`timeout` is interpreted as a double instead of an integer." - ] - ], + "ARRING": { + "summary": "Inserts values into a ring buffer of specified size, wrapping and truncating as needed.", + "since": "8.8.0", + "group": "array", + "complexity": "O(M) normally, O(N+M) on ring resize, where N is the maximum of the old and new ring size and M is the number of inserted values", "acl_categories": [ "@write", - "@list", - "@slow", - "@blocking" + "@array", + "@slow" ], - "arity": 4, + "arity": -4, "key_specs": [ { "begin_search": { @@ -1354,157 +1326,104 @@ } }, "RW": true, - "access": true, - "delete": true - }, - { - "begin_search": { - "type": "index", - "spec": { - "index": 2 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "RW": true, - "insert": true + "update": true } ], "arguments": [ { - "name": "source", + "name": "key", "type": "key", - "display_text": "source", + "display_text": "key", "key_spec_index": 0 }, { - "name": "destination", - "type": "key", - "display_text": "destination", - "key_spec_index": 1 + "name": "size", + "type": "integer", + "display_text": "size" }, { - "name": "timeout", - "type": "double", - "display_text": "timeout" + "name": "value", + "type": "string", + "display_text": "value", + "multiple": true } ], "command_flags": [ "write", - "denyoom", - "blocking" - ], - "doc_flags": [ - "deprecated" + "denyoom" ] }, - "BZMPOP": { - "summary": "Removes and returns a member by score from one or more sorted sets. Blocks until a member is available otherwise. Deletes the sorted set if the last element was popped.", - "since": "7.0.0", - "group": "sorted-set", - "complexity": "O(K) + O(M*log(N)) where K is the number of provided keys, N being the number of elements in the sorted set, and M being the number of elements popped.", + "ARSCAN": { + "summary": "Iterates existing elements in a range, returning index-value pairs.", + "since": "8.8.0", + "group": "array", + "complexity": "O(P) where P is visited positions in touched slices (dense scanned slots + sparse entries), with worst-case O(|end-start|+1) and typical case close to O(N), where N is the number of existing elements in range.", "acl_categories": [ - "@write", - "@sortedset", - "@slow", - "@blocking" + "@read", + "@array", + "@slow" ], - "arity": -5, + "arity": -4, "key_specs": [ { "begin_search": { "type": "index", "spec": { - "index": 2 + "index": 1 } }, "find_keys": { - "type": "keynum", + "type": "range", "spec": { - "keynumidx": 0, - "firstkey": 1, - "keystep": 1 + "lastkey": 0, + "keystep": 1, + "limit": 0 } }, - "RW": true, - "access": true, - "delete": true + "RO": true, + "access": true } ], "arguments": [ { - "name": "timeout", - "type": "double", - "display_text": "timeout" + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 }, { - "name": "numkeys", + "name": "start", "type": "integer", - "display_text": "numkeys" - }, - { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0, - "multiple": true + "display_text": "start" }, { - "name": "where", - "type": "oneof", - "arguments": [ - { - "name": "min", - "type": "pure-token", - "display_text": "min", - "token": "MIN" - }, - { - "name": "max", - "type": "pure-token", - "display_text": "max", - "token": "MAX" - } - ] + "name": "end", + "type": "integer", + "display_text": "end" }, { - "name": "count", + "name": "limit", "type": "integer", - "display_text": "count", - "token": "COUNT", + "display_text": "limit", + "token": "LIMIT", "optional": true } ], "command_flags": [ - "write", - "blocking", - "movablekeys" + "readonly" ] }, - "BZPOPMAX": { - "summary": "Removes and returns the member with the highest score from one or more sorted sets. Blocks until a member available otherwise. Deletes the sorted set if the last element was popped.", - "since": "5.0.0", - "group": "sorted-set", - "complexity": "O(log(N)) with N being the number of elements in the sorted set.", - "history": [ - [ - "6.0.0", - "`timeout` is interpreted as a double instead of an integer." - ] - ], + "ARSEEK": { + "summary": "Sets the ARINSERT / ARRING cursor to a specific index.", + "since": "8.8.0", + "group": "array", + "complexity": "O(1)", "acl_categories": [ "@write", - "@sortedset", - "@fast", - "@blocking" + "@array", + "@fast" ], - "arity": -3, + "arity": 3, "key_specs": [ { "begin_search": { @@ -1516,14 +1435,13 @@ "find_keys": { "type": "range", "spec": { - "lastkey": -2, + "lastkey": 0, "keystep": 1, "limit": 0 } }, "RW": true, - "access": true, - "delete": true + "update": true } ], "arguments": [ @@ -1531,39 +1449,30 @@ "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0, - "multiple": true + "key_spec_index": 0 }, { - "name": "timeout", - "type": "double", - "display_text": "timeout" + "name": "index", + "type": "integer", + "display_text": "index" } ], "command_flags": [ "write", - "blocking", "fast" ] }, - "BZPOPMIN": { - "summary": "Removes and returns the member with the lowest score from one or more sorted sets. Blocks until a member is available otherwise. Deletes the sorted set if the last element was popped.", - "since": "5.0.0", - "group": "sorted-set", - "complexity": "O(log(N)) with N being the number of elements in the sorted set.", - "history": [ - [ - "6.0.0", - "`timeout` is interpreted as a double instead of an integer." - ] - ], + "ARSET": { + "summary": "Sets one or more contiguous values starting at an index in an array.", + "since": "8.8.0", + "group": "array", + "complexity": "O(N) where N is the number of values", "acl_categories": [ "@write", - "@sortedset", - "@fast", - "@blocking" + "@array", + "@fast" ], - "arity": -3, + "arity": -4, "key_specs": [ { "begin_search": { @@ -1575,14 +1484,13 @@ "find_keys": { "type": "range", "spec": { - "lastkey": -2, + "lastkey": 0, "keystep": 1, "limit": 0 } }, "RW": true, - "access": true, - "delete": true + "update": true } ], "arguments": [ @@ -1590,301 +1498,358 @@ "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0, - "multiple": true + "key_spec_index": 0 }, { - "name": "timeout", - "type": "double", - "display_text": "timeout" + "name": "index", + "type": "integer", + "display_text": "index" + }, + { + "name": "value", + "type": "string", + "display_text": "value", + "multiple": true } ], "command_flags": [ "write", - "blocking", + "denyoom", "fast" ] }, - "CLIENT": { - "summary": "A container for client connection commands.", - "since": "2.4.0", - "group": "connection", - "complexity": "Depends on subcommand.", + "ASKING": { + "summary": "Signals that a cluster client is following an -ASK redirect.", + "since": "3.0.0", + "group": "cluster", + "complexity": "O(1)", "acl_categories": [ - "@slow" + "@fast", + "@connection" ], - "arity": -2 + "arity": 1, + "command_flags": [ + "fast" + ] }, - "CLIENT CACHING": { - "summary": "Instructs the server whether to track the keys in the next request.", - "since": "6.0.0", + "AUTH": { + "summary": "Authenticates the connection.", + "since": "1.0.0", "group": "connection", - "complexity": "O(1)", + "complexity": "O(N) where N is the number of passwords defined for the user", + "history": [ + [ + "6.0.0", + "Added ACL style (username and password)." + ] + ], "acl_categories": [ - "@slow", + "@fast", "@connection" ], - "arity": 3, + "arity": -2, "arguments": [ { - "name": "mode", - "type": "oneof", - "arguments": [ - { - "name": "yes", - "type": "pure-token", - "display_text": "yes", - "token": "YES" - }, - { - "name": "no", - "type": "pure-token", - "display_text": "no", - "token": "NO" - } - ] + "name": "username", + "type": "string", + "display_text": "username", + "since": "6.0.0", + "optional": true + }, + { + "name": "password", + "type": "string", + "display_text": "password" } ], "command_flags": [ "noscript", "loading", - "stale" + "stale", + "fast", + "no_auth", + "allow_busy" ] }, - "CLIENT GETNAME": { - "summary": "Returns the name of the connection.", - "since": "2.6.9", - "group": "connection", + "BGREWRITEAOF": { + "summary": "Asynchronously rewrites the append-only file to disk.", + "since": "1.0.0", + "group": "server", "complexity": "O(1)", "acl_categories": [ + "@admin", "@slow", - "@connection" + "@dangerous" ], - "arity": 2, + "arity": 1, "command_flags": [ + "admin", "noscript", - "loading", - "stale" + "no_async_loading" ] }, - "CLIENT GETREDIR": { - "summary": "Returns the client ID to which the connection's tracking notifications are redirected.", - "since": "6.0.0", - "group": "connection", + "BGSAVE": { + "summary": "Asynchronously saves the database(s) to disk.", + "since": "1.0.0", + "group": "server", "complexity": "O(1)", - "acl_categories": [ - "@slow", - "@connection" + "history": [ + [ + "3.2.2", + "Added the `SCHEDULE` option." + ] ], - "arity": 2, - "command_flags": [ - "noscript", - "loading", - "stale" - ] - }, - "CLIENT HELP": { - "summary": "Returns helpful text about the different subcommands.", - "since": "5.0.0", - "group": "connection", - "complexity": "O(1)", "acl_categories": [ + "@admin", "@slow", - "@connection" + "@dangerous" ], - "arity": 2, - "command_flags": [ - "loading", - "stale" - ] - }, - "CLIENT ID": { - "summary": "Returns the unique client ID of the connection.", - "since": "5.0.0", - "group": "connection", - "complexity": "O(1)", - "acl_categories": [ - "@slow", - "@connection" + "arity": -1, + "arguments": [ + { + "name": "schedule", + "type": "pure-token", + "display_text": "schedule", + "token": "SCHEDULE", + "since": "3.2.2", + "optional": true + } ], - "arity": 2, "command_flags": [ + "admin", "noscript", - "loading", - "stale" + "no_async_loading" ] }, - "CLIENT INFO": { - "summary": "Returns information about the connection.", - "since": "6.2.0", - "group": "connection", - "complexity": "O(1)", - "acl_categories": [ - "@slow", - "@connection" - ], - "arity": 2, - "command_flags": [ - "noscript", - "loading", - "stale" - ], - "hints": [ - "nondeterministic_output" - ] - }, - "CLIENT KILL": { - "summary": "Terminates open connections.", - "since": "2.4.0", - "group": "connection", - "complexity": "O(N) where N is the number of client connections", + "BITCOUNT": { + "summary": "Counts the number of set bits (population counting) in a string.", + "since": "2.6.0", + "group": "bitmap", + "complexity": "O(N)", "history": [ [ - "2.8.12", - "Added new filter format." - ], - [ - "2.8.12", - "`ID` option." - ], - [ - "3.2.0", - "Added `master` type in for `TYPE` option." - ], - [ - "5.0.0", - "Replaced `slave` `TYPE` with `replica`. `slave` still supported for backward compatibility." - ], - [ - "6.2.0", - "`LADDR` option." - ], - [ - "8.0.0", - "`MAXAGE` option." + "7.0.0", + "Added the `BYTE|BIT` option." ] ], "acl_categories": [ - "@admin", - "@slow", - "@dangerous", - "@connection" + "@read", + "@bitmap", + "@slow" + ], + "arity": -2, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } ], - "arity": -3, "arguments": [ { - "name": "filter", - "type": "oneof", + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "range", + "type": "block", + "optional": true, "arguments": [ { - "name": "old-format", - "type": "string", - "display_text": "ip:port", - "deprecated_since": "2.8.12" + "name": "start", + "type": "integer", + "display_text": "start" }, { - "name": "new-format", + "name": "end", + "type": "integer", + "display_text": "end" + }, + { + "name": "unit", "type": "oneof", - "multiple": true, + "since": "7.0.0", + "optional": true, "arguments": [ { - "name": "client-id", - "type": "integer", - "display_text": "client-id", - "token": "ID", - "since": "2.8.12", - "optional": true + "name": "byte", + "type": "pure-token", + "display_text": "byte", + "token": "BYTE" }, { - "name": "client-type", + "name": "bit", + "type": "pure-token", + "display_text": "bit", + "token": "BIT" + } + ] + } + ] + } + ], + "command_flags": [ + "readonly" + ] + }, + "BITFIELD": { + "summary": "Performs arbitrary bitfield integer operations on strings.", + "since": "3.2.0", + "group": "bitmap", + "complexity": "O(1) for each subcommand specified", + "acl_categories": [ + "@write", + "@bitmap", + "@slow" + ], + "arity": -2, + "key_specs": [ + { + "notes": "This command allows both access and modification of the key", + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "access": true, + "update": true, + "variable_flags": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "operation", + "type": "oneof", + "optional": true, + "multiple": true, + "arguments": [ + { + "name": "get-block", + "type": "block", + "token": "GET", + "arguments": [ + { + "name": "encoding", + "type": "string", + "display_text": "encoding" + }, + { + "name": "offset", + "type": "integer", + "display_text": "offset" + } + ] + }, + { + "name": "write", + "type": "block", + "arguments": [ + { + "name": "overflow-block", "type": "oneof", - "token": "TYPE", - "since": "2.8.12", + "token": "OVERFLOW", "optional": true, "arguments": [ { - "name": "normal", - "type": "pure-token", - "display_text": "normal", - "token": "NORMAL" - }, - { - "name": "master", - "type": "pure-token", - "display_text": "master", - "token": "MASTER", - "since": "3.2.0" - }, - { - "name": "slave", + "name": "wrap", "type": "pure-token", - "display_text": "slave", - "token": "SLAVE" + "display_text": "wrap", + "token": "WRAP" }, { - "name": "replica", + "name": "sat", "type": "pure-token", - "display_text": "replica", - "token": "REPLICA", - "since": "5.0.0" + "display_text": "sat", + "token": "SAT" }, { - "name": "pubsub", + "name": "fail", "type": "pure-token", - "display_text": "pubsub", - "token": "PUBSUB" + "display_text": "fail", + "token": "FAIL" } ] }, { - "name": "username", - "type": "string", - "display_text": "username", - "token": "USER", - "optional": true - }, - { - "name": "addr", - "type": "string", - "display_text": "ip:port", - "token": "ADDR", - "optional": true - }, - { - "name": "laddr", - "type": "string", - "display_text": "ip:port", - "token": "LADDR", - "since": "6.2.0", - "optional": true - }, - { - "name": "skipme", + "name": "write-operation", "type": "oneof", - "token": "SKIPME", - "optional": true, "arguments": [ { - "name": "yes", - "type": "pure-token", - "display_text": "yes", - "token": "YES" + "name": "set-block", + "type": "block", + "token": "SET", + "arguments": [ + { + "name": "encoding", + "type": "string", + "display_text": "encoding" + }, + { + "name": "offset", + "type": "integer", + "display_text": "offset" + }, + { + "name": "value", + "type": "integer", + "display_text": "value" + } + ] }, { - "name": "no", - "type": "pure-token", - "display_text": "no", - "token": "NO" + "name": "incrby-block", + "type": "block", + "token": "INCRBY", + "arguments": [ + { + "name": "encoding", + "type": "string", + "display_text": "encoding" + }, + { + "name": "offset", + "type": "integer", + "display_text": "offset" + }, + { + "name": "increment", + "type": "integer", + "display_text": "increment" + } + ] } ] - }, - { - "name": "maxage", - "type": "integer", - "display_text": "maxage", - "token": "MAXAGE", - "since": "8.0.0", - "optional": true } ] } @@ -1892,812 +1857,980 @@ } ], "command_flags": [ - "admin", - "noscript", - "loading", - "stale" + "write", + "denyoom" ] }, - "CLIENT LIST": { - "summary": "Lists open connections.", - "since": "2.4.0", - "group": "connection", - "complexity": "O(N) where N is the number of client connections", - "history": [ - [ - "2.8.12", - "Added unique client `id` field." - ], - [ - "5.0.0", - "Added optional `TYPE` filter." - ], - [ - "6.0.0", - "Added `user` field." - ], - [ - "6.2.0", - "Added `argv-mem`, `tot-mem`, `laddr` and `redir` fields and the optional `ID` filter." - ], - [ - "7.0.0", - "Added `resp`, `multi-mem`, `rbs` and `rbp` fields." - ], - [ - "7.0.3", - "Added `ssub` field." - ] - ], + "BITFIELD_RO": { + "summary": "Performs arbitrary read-only bitfield integer operations on strings.", + "since": "6.0.0", + "group": "bitmap", + "complexity": "O(1) for each subcommand specified", "acl_categories": [ - "@admin", - "@slow", - "@dangerous", - "@connection" + "@read", + "@bitmap", + "@fast" ], "arity": -2, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], "arguments": [ { - "name": "client-type", - "type": "oneof", - "token": "TYPE", - "since": "5.0.0", + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "get-block", + "type": "block", + "token": "GET", "optional": true, + "multiple": true, + "multiple_token": true, "arguments": [ { - "name": "normal", - "type": "pure-token", - "display_text": "normal", - "token": "NORMAL" - }, - { - "name": "master", - "type": "pure-token", - "display_text": "master", - "token": "MASTER" - }, - { - "name": "replica", - "type": "pure-token", - "display_text": "replica", - "token": "REPLICA" + "name": "encoding", + "type": "string", + "display_text": "encoding" }, { - "name": "pubsub", - "type": "pure-token", - "display_text": "pubsub", - "token": "PUBSUB" + "name": "offset", + "type": "integer", + "display_text": "offset" } ] - }, - { - "name": "client-id", - "type": "integer", - "display_text": "client-id", - "token": "ID", - "since": "6.2.0", - "optional": true, - "multiple": true } ], "command_flags": [ - "admin", - "noscript", - "loading", - "stale" - ], - "hints": [ - "nondeterministic_output" + "readonly", + "fast" ] }, - "CLIENT NO-EVICT": { - "summary": "Sets the client eviction mode of the connection.", - "since": "7.0.0", - "group": "connection", - "complexity": "O(1)", + "BITOP": { + "summary": "Performs bitwise operations on multiple strings, and stores the result.", + "since": "2.6.0", + "group": "bitmap", + "complexity": "O(N)", "acl_categories": [ - "@admin", - "@slow", - "@dangerous", - "@connection" + "@write", + "@bitmap", + "@slow" + ], + "arity": -4, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 2 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "OW": true, + "update": true + }, + { + "begin_search": { + "type": "index", + "spec": { + "index": 3 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": -1, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } ], - "arity": 3, "arguments": [ { - "name": "enabled", + "name": "operation", "type": "oneof", "arguments": [ { - "name": "on", + "name": "and", "type": "pure-token", - "display_text": "on", - "token": "ON" + "display_text": "and", + "token": "AND" }, { - "name": "off", + "name": "or", "type": "pure-token", - "display_text": "off", - "token": "OFF" - } - ] - } - ], - "command_flags": [ - "admin", - "noscript", - "loading", - "stale" - ] - }, - "CLIENT NO-TOUCH": { - "summary": "Controls whether commands sent by the client affect the LRU/LFU of accessed keys.", - "since": "7.2.0", - "group": "connection", - "complexity": "O(1)", - "acl_categories": [ - "@slow", - "@connection" - ], - "arity": 3, - "arguments": [ - { - "name": "enabled", - "type": "oneof", - "arguments": [ + "display_text": "or", + "token": "OR" + }, { - "name": "on", + "name": "xor", "type": "pure-token", - "display_text": "on", - "token": "ON" + "display_text": "xor", + "token": "XOR" }, { - "name": "off", + "name": "not", "type": "pure-token", - "display_text": "off", - "token": "OFF" + "display_text": "not", + "token": "NOT" + }, + { + "name": "diff", + "type": "pure-token", + "display_text": "diff", + "token": "DIFF" + }, + { + "name": "diff1", + "type": "pure-token", + "display_text": "diff1", + "token": "DIFF1" + }, + { + "name": "andor", + "type": "pure-token", + "display_text": "andor", + "token": "ANDOR" + }, + { + "name": "one", + "type": "pure-token", + "display_text": "one", + "token": "ONE" } ] + }, + { + "name": "destkey", + "type": "key", + "display_text": "destkey", + "key_spec_index": 0 + }, + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 1, + "multiple": true } ], "command_flags": [ - "noscript", - "loading", - "stale" + "write", + "denyoom" ] }, - "CLIENT PAUSE": { - "summary": "Suspends commands processing.", - "since": "3.0.0", - "group": "connection", - "complexity": "O(1)", + "BITPOS": { + "summary": "Finds the first set (1) or clear (0) bit in a string.", + "since": "2.8.7", + "group": "bitmap", + "complexity": "O(N)", "history": [ [ - "6.2.0", - "`CLIENT PAUSE WRITE` mode added along with the `mode` option." + "7.0.0", + "Added the `BYTE|BIT` option." ] ], "acl_categories": [ - "@admin", - "@slow", - "@dangerous", - "@connection" + "@read", + "@bitmap", + "@slow" ], "arity": -3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], "arguments": [ { - "name": "timeout", + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "bit", "type": "integer", - "display_text": "timeout" + "display_text": "bit" }, { - "name": "mode", - "type": "oneof", - "since": "6.2.0", + "name": "range", + "type": "block", "optional": true, "arguments": [ { - "name": "write", - "type": "pure-token", - "display_text": "write", - "token": "WRITE" + "name": "start", + "type": "integer", + "display_text": "start" }, { - "name": "all", - "type": "pure-token", - "display_text": "all", - "token": "ALL" + "name": "end-unit-block", + "type": "block", + "optional": true, + "arguments": [ + { + "name": "end", + "type": "integer", + "display_text": "end" + }, + { + "name": "unit", + "type": "oneof", + "since": "7.0.0", + "optional": true, + "arguments": [ + { + "name": "byte", + "type": "pure-token", + "display_text": "byte", + "token": "BYTE" + }, + { + "name": "bit", + "type": "pure-token", + "display_text": "bit", + "token": "BIT" + } + ] + } + ] } ] } ], "command_flags": [ - "admin", - "noscript", - "loading", - "stale" + "readonly" ] }, - "CLIENT REPLY": { - "summary": "Instructs the server whether to reply to commands.", - "since": "3.2.0", - "group": "connection", + "BLMOVE": { + "summary": "Pops an element from a list, pushes it to another list and returns it. Blocks until an element is available otherwise. Deletes the list if the last element was moved.", + "since": "6.2.0", + "group": "list", "complexity": "O(1)", "acl_categories": [ + "@write", + "@list", "@slow", - "@connection" + "@blocking" + ], + "arity": 6, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "access": true, + "delete": true + }, + { + "begin_search": { + "type": "index", + "spec": { + "index": 2 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "insert": true + } ], - "arity": 3, "arguments": [ { - "name": "action", + "name": "source", + "type": "key", + "display_text": "source", + "key_spec_index": 0 + }, + { + "name": "destination", + "type": "key", + "display_text": "destination", + "key_spec_index": 1 + }, + { + "name": "wherefrom", "type": "oneof", "arguments": [ { - "name": "on", + "name": "left", "type": "pure-token", - "display_text": "on", - "token": "ON" + "display_text": "left", + "token": "LEFT" }, { - "name": "off", + "name": "right", "type": "pure-token", - "display_text": "off", - "token": "OFF" - }, - { - "name": "skip", - "type": "pure-token", - "display_text": "skip", - "token": "SKIP" + "display_text": "right", + "token": "RIGHT" } ] - } - ], - "command_flags": [ - "noscript", - "loading", - "stale" - ] - }, - "CLIENT SETINFO": { - "summary": "Sets information specific to the client or connection.", - "since": "7.2.0", - "group": "connection", - "complexity": "O(1)", - "acl_categories": [ - "@slow", - "@connection" - ], - "arity": 4, - "arguments": [ + }, { - "name": "attr", + "name": "whereto", "type": "oneof", "arguments": [ { - "name": "libname", - "type": "string", - "display_text": "libname", - "token": "LIB-NAME" + "name": "left", + "type": "pure-token", + "display_text": "left", + "token": "LEFT" }, { - "name": "libver", - "type": "string", - "display_text": "libver", - "token": "LIB-VER" + "name": "right", + "type": "pure-token", + "display_text": "right", + "token": "RIGHT" } ] + }, + { + "name": "timeout", + "type": "double", + "display_text": "timeout" } ], "command_flags": [ - "noscript", - "loading", - "stale" - ], - "hints": [ - "request_policy:all_nodes", - "response_policy:all_succeeded" + "write", + "denyoom", + "blocking" ] }, - "CLIENT SETNAME": { - "summary": "Sets the connection name.", - "since": "2.6.9", - "group": "connection", - "complexity": "O(1)", + "BLMPOP": { + "summary": "Pops the first element from one of multiple lists. Blocks until an element is available otherwise. Deletes the list if the last element was popped.", + "since": "7.0.0", + "group": "list", + "complexity": "O(N+M) where N is the number of provided keys and M is the number of elements returned.", "acl_categories": [ + "@write", + "@list", "@slow", - "@connection" + "@blocking" ], - "arity": 3, - "arguments": [ + "arity": -5, + "key_specs": [ { - "name": "connection-name", - "type": "string", - "display_text": "connection-name" + "begin_search": { + "type": "index", + "spec": { + "index": 2 + } + }, + "find_keys": { + "type": "keynum", + "spec": { + "keynumidx": 0, + "firstkey": 1, + "keystep": 1 + } + }, + "RW": true, + "access": true, + "delete": true } ], - "command_flags": [ - "noscript", - "loading", - "stale" - ], - "hints": [ - "request_policy:all_nodes", - "response_policy:all_succeeded" - ] - }, - "CLIENT TRACKING": { - "summary": "Controls server-assisted client-side caching for the connection.", - "since": "6.0.0", - "group": "connection", - "complexity": "O(1). Some options may introduce additional complexity.", - "acl_categories": [ - "@slow", - "@connection" - ], - "arity": -3, "arguments": [ { - "name": "status", + "name": "timeout", + "type": "double", + "display_text": "timeout" + }, + { + "name": "numkeys", + "type": "integer", + "display_text": "numkeys" + }, + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0, + "multiple": true + }, + { + "name": "where", "type": "oneof", "arguments": [ { - "name": "on", + "name": "left", "type": "pure-token", - "display_text": "on", - "token": "ON" + "display_text": "left", + "token": "LEFT" }, { - "name": "off", + "name": "right", "type": "pure-token", - "display_text": "off", - "token": "OFF" + "display_text": "right", + "token": "RIGHT" } ] }, { - "name": "client-id", + "name": "count", "type": "integer", - "display_text": "client-id", - "token": "REDIRECT", - "optional": true - }, - { - "name": "prefix", - "type": "string", - "display_text": "prefix", - "token": "PREFIX", - "optional": true, - "multiple": true, - "multiple_token": true - }, - { - "name": "bcast", - "type": "pure-token", - "display_text": "bcast", - "token": "BCAST", - "optional": true - }, - { - "name": "optin", - "type": "pure-token", - "display_text": "optin", - "token": "OPTIN", - "optional": true - }, - { - "name": "optout", - "type": "pure-token", - "display_text": "optout", - "token": "OPTOUT", - "optional": true - }, - { - "name": "noloop", - "type": "pure-token", - "display_text": "noloop", - "token": "NOLOOP", + "display_text": "count", + "token": "COUNT", "optional": true } ], "command_flags": [ - "noscript", - "loading", - "stale" + "write", + "blocking", + "movablekeys" ] }, - "CLIENT TRACKINGINFO": { - "summary": "Returns information about server-assisted client-side caching for the connection.", - "since": "6.2.0", - "group": "connection", - "complexity": "O(1)", - "acl_categories": [ - "@slow", - "@connection" + "BLPOP": { + "summary": "Removes and returns the first element in a list. Blocks until an element is available otherwise. Deletes the list if the last element was popped.", + "since": "2.0.0", + "group": "list", + "complexity": "O(N) where N is the number of provided keys.", + "history": [ + [ + "6.0.0", + "`timeout` is interpreted as a double instead of an integer." + ] ], - "arity": 2, - "command_flags": [ - "noscript", - "loading", - "stale" - ] - }, - "CLIENT UNBLOCK": { - "summary": "Unblocks a client blocked by a blocking command from a different connection.", - "since": "5.0.0", - "group": "connection", - "complexity": "O(log N) where N is the number of client connections", "acl_categories": [ - "@admin", + "@write", + "@list", "@slow", - "@dangerous", - "@connection" + "@blocking" ], "arity": -3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": -2, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "access": true, + "delete": true + } + ], "arguments": [ { - "name": "client-id", - "type": "integer", - "display_text": "client-id" + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0, + "multiple": true }, { - "name": "unblock-type", - "type": "oneof", - "optional": true, - "arguments": [ - { - "name": "timeout", - "type": "pure-token", - "display_text": "timeout", - "token": "TIMEOUT" - }, - { - "name": "error", - "type": "pure-token", - "display_text": "error", - "token": "ERROR" - } - ] + "name": "timeout", + "type": "double", + "display_text": "timeout" } ], "command_flags": [ - "admin", - "noscript", - "loading", - "stale" - ] - }, - "CLIENT UNPAUSE": { - "summary": "Resumes processing commands from paused clients.", - "since": "6.2.0", - "group": "connection", - "complexity": "O(N) Where N is the number of paused clients", - "acl_categories": [ - "@admin", - "@slow", - "@dangerous", - "@connection" - ], - "arity": 2, - "command_flags": [ - "admin", - "noscript", - "loading", - "stale" + "write", + "blocking" ] }, - "CLUSTER": { - "summary": "A container for Redis Cluster commands.", - "since": "3.0.0", - "group": "cluster", - "complexity": "Depends on subcommand.", - "acl_categories": [ - "@slow" + "BRPOP": { + "summary": "Removes and returns the last element in a list. Blocks until an element is available otherwise. Deletes the list if the last element was popped.", + "since": "2.0.0", + "group": "list", + "complexity": "O(N) where N is the number of provided keys.", + "history": [ + [ + "6.0.0", + "`timeout` is interpreted as a double instead of an integer." + ] ], - "arity": -2 - }, - "CLUSTER ADDSLOTS": { - "summary": "Assigns new hash slots to a node.", - "since": "3.0.0", - "group": "cluster", - "complexity": "O(N) where N is the total number of hash slot arguments", "acl_categories": [ - "@admin", + "@write", + "@list", "@slow", - "@dangerous" + "@blocking" ], "arity": -3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": -2, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "access": true, + "delete": true + } + ], "arguments": [ { - "name": "slot", - "type": "integer", - "display_text": "slot", + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0, "multiple": true + }, + { + "name": "timeout", + "type": "double", + "display_text": "timeout" } ], "command_flags": [ - "admin", - "stale", - "no_async_loading" + "write", + "blocking" ] }, - "CLUSTER ADDSLOTSRANGE": { - "summary": "Assigns new hash slot ranges to a node.", - "since": "7.0.0", - "group": "cluster", - "complexity": "O(N) where N is the total number of the slots between the start slot and end slot arguments.", + "BRPOPLPUSH": { + "summary": "Pops an element from a list, pushes it to another list and returns it. Block until an element is available otherwise. Deletes the list if the last element was popped.", + "since": "2.2.0", + "group": "list", + "complexity": "O(1)", + "deprecated_since": "6.2.0", + "replaced_by": "`BLMOVE` with the `RIGHT` and `LEFT` arguments", + "history": [ + [ + "6.0.0", + "`timeout` is interpreted as a double instead of an integer." + ] + ], "acl_categories": [ - "@admin", + "@write", + "@list", "@slow", - "@dangerous" + "@blocking" ], - "arity": -4, - "arguments": [ + "arity": 4, + "key_specs": [ { - "name": "range", - "type": "block", - "multiple": true, - "arguments": [ - { - "name": "start-slot", - "type": "integer", - "display_text": "start-slot" - }, - { - "name": "end-slot", - "type": "integer", - "display_text": "end-slot" + "begin_search": { + "type": "index", + "spec": { + "index": 1 } - ] + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "access": true, + "delete": true + }, + { + "begin_search": { + "type": "index", + "spec": { + "index": 2 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "insert": true } ], - "command_flags": [ - "admin", - "stale", - "no_async_loading" - ] - }, - "CLUSTER BUMPEPOCH": { - "summary": "Advances the cluster config epoch.", - "since": "3.0.0", - "group": "cluster", - "complexity": "O(1)", - "acl_categories": [ - "@admin", - "@slow", - "@dangerous" + "arguments": [ + { + "name": "source", + "type": "key", + "display_text": "source", + "key_spec_index": 0 + }, + { + "name": "destination", + "type": "key", + "display_text": "destination", + "key_spec_index": 1 + }, + { + "name": "timeout", + "type": "double", + "display_text": "timeout" + } ], - "arity": 2, "command_flags": [ - "admin", - "stale", - "no_async_loading" + "write", + "denyoom", + "blocking" ], - "hints": [ - "nondeterministic_output" + "doc_flags": [ + "deprecated" ] }, - "CLUSTER COUNT-FAILURE-REPORTS": { - "summary": "Returns the number of active failure reports active for a node.", - "since": "3.0.0", - "group": "cluster", - "complexity": "O(N) where N is the number of failure reports", + "BZMPOP": { + "summary": "Removes and returns a member by score from one or more sorted sets. Blocks until a member is available otherwise. Deletes the sorted set if the last element was popped.", + "since": "7.0.0", + "group": "sorted-set", + "complexity": "O(K) + O(M*log(N)) where K is the number of provided keys, N being the number of elements in the sorted set, and M being the number of elements popped.", "acl_categories": [ - "@admin", + "@write", + "@sortedset", "@slow", - "@dangerous" + "@blocking" ], - "arity": 3, - "arguments": [ + "arity": -5, + "key_specs": [ { - "name": "node-id", - "type": "string", - "display_text": "node-id" + "begin_search": { + "type": "index", + "spec": { + "index": 2 + } + }, + "find_keys": { + "type": "keynum", + "spec": { + "keynumidx": 0, + "firstkey": 1, + "keystep": 1 + } + }, + "RW": true, + "access": true, + "delete": true } ], - "command_flags": [ - "admin", - "stale" + "arguments": [ + { + "name": "timeout", + "type": "double", + "display_text": "timeout" + }, + { + "name": "numkeys", + "type": "integer", + "display_text": "numkeys" + }, + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0, + "multiple": true + }, + { + "name": "where", + "type": "oneof", + "arguments": [ + { + "name": "min", + "type": "pure-token", + "display_text": "min", + "token": "MIN" + }, + { + "name": "max", + "type": "pure-token", + "display_text": "max", + "token": "MAX" + } + ] + }, + { + "name": "count", + "type": "integer", + "display_text": "count", + "token": "COUNT", + "optional": true + } ], - "hints": [ - "nondeterministic_output" + "command_flags": [ + "write", + "blocking", + "movablekeys" ] }, - "CLUSTER COUNTKEYSINSLOT": { - "summary": "Returns the number of keys in a hash slot.", - "since": "3.0.0", - "group": "cluster", - "complexity": "O(1)", + "BZPOPMAX": { + "summary": "Removes and returns the member with the highest score from one or more sorted sets. Blocks until a member available otherwise. Deletes the sorted set if the last element was popped.", + "since": "5.0.0", + "group": "sorted-set", + "complexity": "O(log(N)) with N being the number of elements in the sorted set.", + "history": [ + [ + "6.0.0", + "`timeout` is interpreted as a double instead of an integer." + ] + ], "acl_categories": [ - "@slow" + "@write", + "@sortedset", + "@fast", + "@blocking" + ], + "arity": -3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": -2, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "access": true, + "delete": true + } ], - "arity": 3, "arguments": [ { - "name": "slot", - "type": "integer", - "display_text": "slot" + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0, + "multiple": true + }, + { + "name": "timeout", + "type": "double", + "display_text": "timeout" } ], "command_flags": [ - "stale" + "write", + "blocking", + "fast" ] }, - "CLUSTER DELSLOTS": { - "summary": "Sets hash slots as unbound for a node.", - "since": "3.0.0", - "group": "cluster", - "complexity": "O(N) where N is the total number of hash slot arguments", + "BZPOPMIN": { + "summary": "Removes and returns the member with the lowest score from one or more sorted sets. Blocks until a member is available otherwise. Deletes the sorted set if the last element was popped.", + "since": "5.0.0", + "group": "sorted-set", + "complexity": "O(log(N)) with N being the number of elements in the sorted set.", + "history": [ + [ + "6.0.0", + "`timeout` is interpreted as a double instead of an integer." + ] + ], "acl_categories": [ - "@admin", - "@slow", - "@dangerous" + "@write", + "@sortedset", + "@fast", + "@blocking" ], "arity": -3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": -2, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "access": true, + "delete": true + } + ], "arguments": [ { - "name": "slot", - "type": "integer", - "display_text": "slot", + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0, "multiple": true + }, + { + "name": "timeout", + "type": "double", + "display_text": "timeout" } ], "command_flags": [ - "admin", - "stale", - "no_async_loading" + "write", + "blocking", + "fast" ] }, - "CLUSTER DELSLOTSRANGE": { - "summary": "Sets hash slot ranges as unbound for a node.", - "since": "7.0.0", - "group": "cluster", - "complexity": "O(N) where N is the total number of the slots between the start slot and end slot arguments.", + "CLIENT": { + "summary": "A container for client connection commands.", + "since": "2.4.0", + "group": "connection", + "complexity": "Depends on subcommand.", + "acl_categories": [ + "@slow" + ], + "arity": -2 + }, + "CLIENT CACHING": { + "summary": "Instructs the server whether to track the keys in the next request.", + "since": "6.0.0", + "group": "connection", + "complexity": "O(1)", "acl_categories": [ - "@admin", "@slow", - "@dangerous" + "@connection" ], - "arity": -4, + "arity": 3, "arguments": [ { - "name": "range", - "type": "block", - "multiple": true, + "name": "mode", + "type": "oneof", "arguments": [ { - "name": "start-slot", - "type": "integer", - "display_text": "start-slot" + "name": "yes", + "type": "pure-token", + "display_text": "yes", + "token": "YES" }, { - "name": "end-slot", - "type": "integer", - "display_text": "end-slot" + "name": "no", + "type": "pure-token", + "display_text": "no", + "token": "NO" } ] } ], "command_flags": [ - "admin", - "stale", - "no_async_loading" + "noscript", + "loading", + "stale" ] }, - "CLUSTER FAILOVER": { - "summary": "Forces a replica to perform a manual failover of its master.", - "since": "3.0.0", - "group": "cluster", + "CLIENT GETNAME": { + "summary": "Returns the name of the connection.", + "since": "2.6.9", + "group": "connection", "complexity": "O(1)", "acl_categories": [ - "@admin", "@slow", - "@dangerous" - ], - "arity": -2, - "arguments": [ - { - "name": "options", - "type": "oneof", - "optional": true, - "arguments": [ - { - "name": "force", - "type": "pure-token", - "display_text": "force", - "token": "FORCE" - }, - { - "name": "takeover", - "type": "pure-token", - "display_text": "takeover", - "token": "TAKEOVER" - } - ] - } - ], - "command_flags": [ - "admin", - "stale", - "no_async_loading" - ] - }, - "CLUSTER FLUSHSLOTS": { - "summary": "Deletes all slots information from a node.", - "since": "3.0.0", - "group": "cluster", - "complexity": "O(1)", - "acl_categories": [ - "@admin", - "@slow", - "@dangerous" + "@connection" ], "arity": 2, "command_flags": [ - "admin", - "stale", - "no_async_loading" + "noscript", + "loading", + "stale" ] }, - "CLUSTER FORGET": { - "summary": "Removes a node from the nodes table.", - "since": "3.0.0", - "group": "cluster", + "CLIENT GETREDIR": { + "summary": "Returns the client ID to which the connection's tracking notifications are redirected.", + "since": "6.0.0", + "group": "connection", "complexity": "O(1)", "acl_categories": [ - "@admin", "@slow", - "@dangerous" - ], - "arity": 3, - "arguments": [ - { - "name": "node-id", - "type": "string", - "display_text": "node-id" - } - ], - "command_flags": [ - "admin", - "stale", - "no_async_loading" - ] - }, - "CLUSTER GETKEYSINSLOT": { - "summary": "Returns the key names in a hash slot.", - "since": "3.0.0", - "group": "cluster", - "complexity": "O(N) where N is the number of requested keys", - "acl_categories": [ - "@slow" - ], - "arity": 4, - "arguments": [ - { - "name": "slot", - "type": "integer", - "display_text": "slot" - }, - { - "name": "count", - "type": "integer", - "display_text": "count" - } + "@connection" ], + "arity": 2, "command_flags": [ + "noscript", + "loading", "stale" - ], - "hints": [ - "nondeterministic_output" ] }, - "CLUSTER HELP": { + "CLIENT HELP": { "summary": "Returns helpful text about the different subcommands.", "since": "5.0.0", - "group": "cluster", + "group": "connection", "complexity": "O(1)", "acl_categories": [ - "@slow" + "@slow", + "@connection" ], "arity": 2, "command_flags": [ @@ -2705,1279 +2838,5223 @@ "stale" ] }, - "CLUSTER INFO": { - "summary": "Returns information about the state of a node.", - "since": "3.0.0", - "group": "cluster", + "CLIENT ID": { + "summary": "Returns the unique client ID of the connection.", + "since": "5.0.0", + "group": "connection", "complexity": "O(1)", "acl_categories": [ - "@slow" + "@slow", + "@connection" ], "arity": 2, "command_flags": [ - "stale" - ], - "hints": [ - "nondeterministic_output" - ] - }, - "CLUSTER KEYSLOT": { - "summary": "Returns the hash slot for a key.", - "since": "3.0.0", - "group": "cluster", - "complexity": "O(N) where N is the number of bytes in the key", - "acl_categories": [ - "@slow" - ], - "arity": 3, - "arguments": [ - { - "name": "key", - "type": "string", - "display_text": "key" - } - ], - "command_flags": [ + "noscript", + "loading", "stale" ] }, - "CLUSTER LINKS": { - "summary": "Returns a list of all TCP links to and from peer nodes.", - "since": "7.0.0", - "group": "cluster", - "complexity": "O(N) where N is the total number of Cluster nodes", + "CLIENT INFO": { + "summary": "Returns information about the connection.", + "since": "6.2.0", + "group": "connection", + "complexity": "O(1)", "acl_categories": [ - "@slow" + "@slow", + "@connection" ], "arity": 2, "command_flags": [ + "noscript", + "loading", "stale" ], "hints": [ "nondeterministic_output" ] }, - "CLUSTER MEET": { - "summary": "Forces a node to handshake with another node.", - "since": "3.0.0", - "group": "cluster", - "complexity": "O(1)", + "CLIENT KILL": { + "summary": "Terminates open connections.", + "since": "2.4.0", + "group": "connection", + "complexity": "O(N) where N is the number of client connections", "history": [ [ - "4.0.0", - "Added the optional `cluster_bus_port` argument." + "2.8.12", + "Added new filter format." + ], + [ + "2.8.12", + "`ID` option." + ], + [ + "3.2.0", + "Added `master` type in for `TYPE` option." + ], + [ + "5.0.0", + "Replaced `slave` `TYPE` with `replica`. `slave` still supported for backward compatibility." + ], + [ + "6.2.0", + "`LADDR` option." + ], + [ + "7.4.0", + "`MAXAGE` option." ] ], "acl_categories": [ "@admin", "@slow", - "@dangerous" + "@dangerous", + "@connection" ], - "arity": -4, + "arity": -3, "arguments": [ { - "name": "ip", - "type": "string", - "display_text": "ip" - }, - { - "name": "port", - "type": "integer", - "display_text": "port" - }, - { - "name": "cluster-bus-port", - "type": "integer", - "display_text": "cluster-bus-port", - "since": "4.0.0", - "optional": true - } - ], - "command_flags": [ - "admin", - "stale", - "no_async_loading" - ] - }, - "CLUSTER MYID": { - "summary": "Returns the ID of a node.", - "since": "3.0.0", - "group": "cluster", - "complexity": "O(1)", - "acl_categories": [ - "@slow" - ], - "arity": 2, - "command_flags": [ - "stale" - ] - }, - "CLUSTER MYSHARDID": { - "summary": "Returns the shard ID of a node.", - "since": "7.2.0", - "group": "cluster", - "complexity": "O(1)", - "acl_categories": [ - "@slow" - ], - "arity": 2, - "command_flags": [ - "stale" - ], - "hints": [ - "nondeterministic_output" - ] - }, - "CLUSTER NODES": { - "summary": "Returns the cluster configuration for a node.", - "since": "3.0.0", - "group": "cluster", - "complexity": "O(N) where N is the total number of Cluster nodes", - "acl_categories": [ - "@slow" - ], - "arity": 2, - "command_flags": [ - "stale" - ], - "hints": [ - "nondeterministic_output" - ] - }, - "CLUSTER REPLICAS": { - "summary": "Lists the replica nodes of a master node.", - "since": "5.0.0", - "group": "cluster", - "complexity": "O(N) where N is the number of replicas.", - "acl_categories": [ - "@admin", - "@slow", - "@dangerous" - ], - "arity": 3, - "arguments": [ - { - "name": "node-id", - "type": "string", - "display_text": "node-id" + "name": "filter", + "type": "oneof", + "arguments": [ + { + "name": "old-format", + "type": "string", + "display_text": "ip:port", + "deprecated_since": "2.8.12" + }, + { + "name": "new-format", + "type": "oneof", + "multiple": true, + "arguments": [ + { + "name": "client-id", + "type": "integer", + "display_text": "client-id", + "token": "ID", + "since": "2.8.12", + "optional": true + }, + { + "name": "client-type", + "type": "oneof", + "token": "TYPE", + "since": "2.8.12", + "optional": true, + "arguments": [ + { + "name": "normal", + "type": "pure-token", + "display_text": "normal", + "token": "NORMAL" + }, + { + "name": "master", + "type": "pure-token", + "display_text": "master", + "token": "MASTER", + "since": "3.2.0" + }, + { + "name": "slave", + "type": "pure-token", + "display_text": "slave", + "token": "SLAVE" + }, + { + "name": "replica", + "type": "pure-token", + "display_text": "replica", + "token": "REPLICA", + "since": "5.0.0" + }, + { + "name": "pubsub", + "type": "pure-token", + "display_text": "pubsub", + "token": "PUBSUB" + } + ] + }, + { + "name": "username", + "type": "string", + "display_text": "username", + "token": "USER", + "optional": true + }, + { + "name": "addr", + "type": "string", + "display_text": "ip:port", + "token": "ADDR", + "optional": true + }, + { + "name": "laddr", + "type": "string", + "display_text": "ip:port", + "token": "LADDR", + "since": "6.2.0", + "optional": true + }, + { + "name": "skipme", + "type": "oneof", + "token": "SKIPME", + "optional": true, + "arguments": [ + { + "name": "yes", + "type": "pure-token", + "display_text": "yes", + "token": "YES" + }, + { + "name": "no", + "type": "pure-token", + "display_text": "no", + "token": "NO" + } + ] + }, + { + "name": "maxage", + "type": "integer", + "display_text": "maxage", + "token": "MAXAGE", + "since": "7.4.0", + "optional": true + } + ] + } + ] } ], "command_flags": [ "admin", + "noscript", + "loading", "stale" - ], - "hints": [ - "nondeterministic_output" ] }, - "CLUSTER REPLICATE": { - "summary": "Configure a node as replica of a master node.", - "since": "3.0.0", - "group": "cluster", - "complexity": "O(1)", - "acl_categories": [ - "@admin", - "@slow", - "@dangerous" - ], - "arity": 3, - "arguments": [ - { - "name": "node-id", - "type": "string", - "display_text": "node-id" - } + "CLIENT LIST": { + "summary": "Lists open connections.", + "since": "2.4.0", + "group": "connection", + "complexity": "O(N) where N is the number of client connections", + "history": [ + [ + "2.8.12", + "Added unique client `id` field." + ], + [ + "5.0.0", + "Added optional `TYPE` filter." + ], + [ + "6.0.0", + "Added `user` field." + ], + [ + "6.2.0", + "Added `argv-mem`, `tot-mem`, `laddr` and `redir` fields and the optional `ID` filter." + ], + [ + "7.0.0", + "Added `resp`, `multi-mem`, `rbs` and `rbp` fields." + ], + [ + "7.0.3", + "Added `ssub` field." + ], + [ + "7.2.0", + "Added `lib-name` and `lib-ver` fields." + ], + [ + "7.4.0", + "Added `watch` field." + ], + [ + "8.0.0", + "Added `io-thread` field." + ] ], - "command_flags": [ - "admin", - "stale", - "no_async_loading" - ] - }, - "CLUSTER RESET": { - "summary": "Resets a node.", - "since": "3.0.0", - "group": "cluster", - "complexity": "O(N) where N is the number of known nodes. The command may execute a FLUSHALL as a side effect.", "acl_categories": [ "@admin", "@slow", - "@dangerous" + "@dangerous", + "@connection" ], "arity": -2, "arguments": [ { - "name": "reset-type", + "name": "client-type", "type": "oneof", + "token": "TYPE", + "since": "5.0.0", "optional": true, "arguments": [ { - "name": "hard", + "name": "normal", "type": "pure-token", - "display_text": "hard", - "token": "HARD" + "display_text": "normal", + "token": "NORMAL" }, { - "name": "soft", + "name": "master", "type": "pure-token", - "display_text": "soft", - "token": "SOFT" + "display_text": "master", + "token": "MASTER" + }, + { + "name": "replica", + "type": "pure-token", + "display_text": "replica", + "token": "REPLICA" + }, + { + "name": "pubsub", + "type": "pure-token", + "display_text": "pubsub", + "token": "PUBSUB" } ] + }, + { + "name": "client-id", + "type": "integer", + "display_text": "client-id", + "token": "ID", + "since": "6.2.0", + "optional": true, + "multiple": true } ], "command_flags": [ "admin", "noscript", + "loading", "stale" + ], + "hints": [ + "nondeterministic_output" ] }, - "CLUSTER SAVECONFIG": { - "summary": "Forces a node to save the cluster configuration to disk.", - "since": "3.0.0", - "group": "cluster", - "complexity": "O(1)", - "acl_categories": [ - "@admin", + "CLIENT NO-EVICT": { + "summary": "Sets the client eviction mode of the connection.", + "since": "7.0.0", + "group": "connection", + "complexity": "O(1)", + "acl_categories": [ + "@admin", "@slow", - "@dangerous" + "@dangerous", + "@connection" + ], + "arity": 3, + "arguments": [ + { + "name": "enabled", + "type": "oneof", + "arguments": [ + { + "name": "on", + "type": "pure-token", + "display_text": "on", + "token": "ON" + }, + { + "name": "off", + "type": "pure-token", + "display_text": "off", + "token": "OFF" + } + ] + } ], - "arity": 2, "command_flags": [ "admin", - "stale", - "no_async_loading" + "noscript", + "loading", + "stale" ] }, - "CLUSTER SET-CONFIG-EPOCH": { - "summary": "Sets the configuration epoch for a new node.", - "since": "3.0.0", - "group": "cluster", + "CLIENT NO-TOUCH": { + "summary": "Controls whether commands sent by the client affect the LRU/LFU of accessed keys.", + "since": "7.2.0", + "group": "connection", "complexity": "O(1)", "acl_categories": [ - "@admin", "@slow", - "@dangerous" + "@connection" ], "arity": 3, "arguments": [ { - "name": "config-epoch", - "type": "integer", - "display_text": "config-epoch" + "name": "enabled", + "type": "oneof", + "arguments": [ + { + "name": "on", + "type": "pure-token", + "display_text": "on", + "token": "ON" + }, + { + "name": "off", + "type": "pure-token", + "display_text": "off", + "token": "OFF" + } + ] } ], "command_flags": [ - "admin", - "stale", - "no_async_loading" + "noscript", + "loading", + "stale" ] }, - "CLUSTER SETSLOT": { - "summary": "Binds a hash slot to a node.", + "CLIENT PAUSE": { + "summary": "Suspends commands processing.", "since": "3.0.0", - "group": "cluster", + "group": "connection", "complexity": "O(1)", + "history": [ + [ + "6.2.0", + "`CLIENT PAUSE WRITE` mode added along with the `mode` option." + ] + ], "acl_categories": [ "@admin", "@slow", - "@dangerous" + "@dangerous", + "@connection" ], - "arity": -4, + "arity": -3, "arguments": [ { - "name": "slot", + "name": "timeout", "type": "integer", - "display_text": "slot" + "display_text": "timeout" }, { - "name": "subcommand", + "name": "mode", "type": "oneof", + "since": "6.2.0", + "optional": true, "arguments": [ { - "name": "importing", - "type": "string", - "display_text": "node-id", - "token": "IMPORTING" + "name": "write", + "type": "pure-token", + "display_text": "write", + "token": "WRITE" }, { - "name": "migrating", - "type": "string", - "display_text": "node-id", - "token": "MIGRATING" + "name": "all", + "type": "pure-token", + "display_text": "all", + "token": "ALL" + } + ] + } + ], + "command_flags": [ + "admin", + "noscript", + "loading", + "stale" + ] + }, + "CLIENT REPLY": { + "summary": "Instructs the server whether to reply to commands.", + "since": "3.2.0", + "group": "connection", + "complexity": "O(1)", + "acl_categories": [ + "@slow", + "@connection" + ], + "arity": 3, + "arguments": [ + { + "name": "action", + "type": "oneof", + "arguments": [ + { + "name": "on", + "type": "pure-token", + "display_text": "on", + "token": "ON" }, { - "name": "node", - "type": "string", - "display_text": "node-id", - "token": "NODE" + "name": "off", + "type": "pure-token", + "display_text": "off", + "token": "OFF" }, { - "name": "stable", + "name": "skip", "type": "pure-token", - "display_text": "stable", - "token": "STABLE" + "display_text": "skip", + "token": "SKIP" } ] } ], "command_flags": [ - "admin", - "stale", - "no_async_loading" + "noscript", + "loading", + "stale" ] }, - "CLUSTER SHARDS": { - "summary": "Returns the mapping of cluster slots to shards.", - "since": "7.0.0", - "group": "cluster", - "complexity": "O(N) where N is the total number of cluster nodes", + "CLIENT SETINFO": { + "summary": "Sets information specific to the client or connection.", + "since": "7.2.0", + "group": "connection", + "complexity": "O(1)", "acl_categories": [ - "@slow" + "@slow", + "@connection" + ], + "arity": 4, + "arguments": [ + { + "name": "attr", + "type": "oneof", + "arguments": [ + { + "name": "libname", + "type": "string", + "display_text": "libname", + "token": "LIB-NAME" + }, + { + "name": "libver", + "type": "string", + "display_text": "libver", + "token": "LIB-VER" + } + ] + } ], - "arity": 2, "command_flags": [ + "noscript", "loading", "stale" ], "hints": [ - "nondeterministic_output" + "request_policy:all_nodes", + "response_policy:all_succeeded" ] }, - "CLUSTER SLAVES": { - "summary": "Lists the replica nodes of a master node.", - "since": "3.0.0", - "group": "cluster", - "complexity": "O(N) where N is the number of replicas.", - "deprecated_since": "5.0.0", - "replaced_by": "`CLUSTER REPLICAS`", + "CLIENT SETNAME": { + "summary": "Sets the connection name.", + "since": "2.6.9", + "group": "connection", + "complexity": "O(1)", "acl_categories": [ - "@admin", "@slow", - "@dangerous" + "@connection" ], "arity": 3, "arguments": [ { - "name": "node-id", + "name": "connection-name", "type": "string", - "display_text": "node-id" + "display_text": "connection-name" } ], "command_flags": [ - "admin", + "noscript", + "loading", "stale" ], - "doc_flags": [ - "deprecated" - ], "hints": [ - "nondeterministic_output" + "request_policy:all_nodes", + "response_policy:all_succeeded" ] }, - "CLUSTER SLOTS": { - "summary": "Returns the mapping of cluster slots to nodes.", - "since": "3.0.0", - "group": "cluster", - "complexity": "O(N) where N is the total number of Cluster nodes", - "deprecated_since": "7.0.0", - "replaced_by": "`CLUSTER SHARDS`", - "history": [ - [ - "4.0.0", - "Added node IDs." - ], - [ - "7.0.0", - "Added additional networking metadata field." - ] - ], - "acl_categories": [ - "@slow" - ], - "arity": 2, - "command_flags": [ - "loading", - "stale" - ], - "doc_flags": [ - "deprecated" - ], - "hints": [ - "nondeterministic_output" - ] - }, - "COMMAND": { - "summary": "Returns detailed information about all commands.", - "since": "2.8.13", - "group": "server", - "complexity": "O(N) where N is the total number of Redis commands", - "acl_categories": [ - "@slow", - "@connection" - ], - "arity": -1, - "command_flags": [ - "loading", - "stale" - ], - "hints": [ - "nondeterministic_output_order" - ] - }, - "COMMAND COUNT": { - "summary": "Returns a count of commands.", - "since": "2.8.13", - "group": "server", - "complexity": "O(1)", - "acl_categories": [ - "@slow", - "@connection" - ], - "arity": 2, - "command_flags": [ - "loading", - "stale" - ] - }, - "COMMAND DOCS": { - "summary": "Returns documentary information about one, multiple or all commands.", - "since": "7.0.0", - "group": "server", - "complexity": "O(N) where N is the number of commands to look up", + "CLIENT TRACKING": { + "summary": "Controls server-assisted client-side caching for the connection.", + "since": "6.0.0", + "group": "connection", + "complexity": "O(1). Some options may introduce additional complexity.", "acl_categories": [ "@slow", "@connection" ], - "arity": -2, + "arity": -3, "arguments": [ { - "name": "command-name", + "name": "status", + "type": "oneof", + "arguments": [ + { + "name": "on", + "type": "pure-token", + "display_text": "on", + "token": "ON" + }, + { + "name": "off", + "type": "pure-token", + "display_text": "off", + "token": "OFF" + } + ] + }, + { + "name": "client-id", + "type": "integer", + "display_text": "client-id", + "token": "REDIRECT", + "optional": true + }, + { + "name": "prefix", "type": "string", - "display_text": "command-name", + "display_text": "prefix", + "token": "PREFIX", "optional": true, - "multiple": true + "multiple": true, + "multiple_token": true + }, + { + "name": "bcast", + "type": "pure-token", + "display_text": "bcast", + "token": "BCAST", + "optional": true + }, + { + "name": "optin", + "type": "pure-token", + "display_text": "optin", + "token": "OPTIN", + "optional": true + }, + { + "name": "optout", + "type": "pure-token", + "display_text": "optout", + "token": "OPTOUT", + "optional": true + }, + { + "name": "noloop", + "type": "pure-token", + "display_text": "noloop", + "token": "NOLOOP", + "optional": true } ], "command_flags": [ + "noscript", "loading", "stale" - ], - "hints": [ - "nondeterministic_output_order" ] }, - "COMMAND GETKEYS": { - "summary": "Extracts the key names from an arbitrary command.", - "since": "2.8.13", - "group": "server", - "complexity": "O(N) where N is the number of arguments to the command", + "CLIENT TRACKINGINFO": { + "summary": "Returns information about server-assisted client-side caching for the connection.", + "since": "6.2.0", + "group": "connection", + "complexity": "O(1)", "acl_categories": [ "@slow", "@connection" ], - "arity": -3, - "arguments": [ - { - "name": "command", - "type": "string", - "display_text": "command" - }, - { - "name": "arg", - "type": "string", - "display_text": "arg", - "optional": true, - "multiple": true - } - ], + "arity": 2, "command_flags": [ + "noscript", "loading", "stale" ] }, - "COMMAND GETKEYSANDFLAGS": { - "summary": "Extracts the key names and access flags for an arbitrary command.", - "since": "7.0.0", - "group": "server", - "complexity": "O(N) where N is the number of arguments to the command", + "CLIENT UNBLOCK": { + "summary": "Unblocks a client blocked by a blocking command from a different connection.", + "since": "5.0.0", + "group": "connection", + "complexity": "O(log N) where N is the number of client connections", "acl_categories": [ + "@admin", "@slow", + "@dangerous", "@connection" ], "arity": -3, "arguments": [ { - "name": "command", - "type": "string", - "display_text": "command" + "name": "client-id", + "type": "integer", + "display_text": "client-id" }, { - "name": "arg", - "type": "string", - "display_text": "arg", + "name": "unblock-type", + "type": "oneof", "optional": true, - "multiple": true + "arguments": [ + { + "name": "timeout", + "type": "pure-token", + "display_text": "timeout", + "token": "TIMEOUT" + }, + { + "name": "error", + "type": "pure-token", + "display_text": "error", + "token": "ERROR" + } + ] } ], "command_flags": [ + "admin", + "noscript", "loading", "stale" ] }, - "COMMAND HELP": { - "summary": "Returns helpful text about the different subcommands.", - "since": "5.0.0", - "group": "server", - "complexity": "O(1)", + "CLIENT UNPAUSE": { + "summary": "Resumes processing commands from paused clients.", + "since": "6.2.0", + "group": "connection", + "complexity": "O(N) Where N is the number of paused clients", "acl_categories": [ + "@admin", "@slow", + "@dangerous", "@connection" ], "arity": 2, "command_flags": [ + "admin", + "noscript", "loading", "stale" ] }, - "COMMAND INFO": { - "summary": "Returns information about one, multiple or all commands.", - "since": "2.8.13", - "group": "server", - "complexity": "O(N) where N is the number of commands to look up", - "history": [ - [ - "7.0.0", - "Allowed to be called with no argument to get info on all commands." - ] + "CLUSTER": { + "summary": "A container for Redis Cluster commands.", + "since": "3.0.0", + "group": "cluster", + "complexity": "Depends on subcommand.", + "acl_categories": [ + "@slow" ], + "arity": -2 + }, + "CLUSTER ADDSLOTS": { + "summary": "Assigns new hash slots to a node.", + "since": "3.0.0", + "group": "cluster", + "complexity": "O(N) where N is the total number of hash slot arguments", "acl_categories": [ + "@admin", "@slow", - "@connection" + "@dangerous" ], - "arity": -2, + "arity": -3, "arguments": [ { - "name": "command-name", - "type": "string", - "display_text": "command-name", - "optional": true, + "name": "slot", + "type": "integer", + "display_text": "slot", "multiple": true } ], "command_flags": [ - "loading", - "stale" - ], - "hints": [ - "nondeterministic_output_order" + "admin", + "stale", + "no_async_loading" ] }, - "COMMAND LIST": { - "summary": "Returns a list of command names.", + "CLUSTER ADDSLOTSRANGE": { + "summary": "Assigns new hash slot ranges to a node.", "since": "7.0.0", - "group": "server", - "complexity": "O(N) where N is the total number of Redis commands", + "group": "cluster", + "complexity": "O(N) where N is the total number of the slots between the start slot and end slot arguments.", "acl_categories": [ + "@admin", "@slow", - "@connection" + "@dangerous" ], - "arity": -2, + "arity": -4, "arguments": [ { - "name": "filterby", - "type": "oneof", - "token": "FILTERBY", - "optional": true, + "name": "range", + "type": "block", + "multiple": true, "arguments": [ { - "name": "module-name", - "type": "string", - "display_text": "module-name", - "token": "MODULE" - }, - { - "name": "category", - "type": "string", - "display_text": "category", - "token": "ACLCAT" + "name": "start-slot", + "type": "integer", + "display_text": "start-slot" }, { - "name": "pattern", - "type": "pattern", - "display_text": "pattern", - "token": "PATTERN" + "name": "end-slot", + "type": "integer", + "display_text": "end-slot" } ] } ], "command_flags": [ - "loading", - "stale" - ], - "hints": [ - "nondeterministic_output_order" + "admin", + "stale", + "no_async_loading" ] }, - "CONFIG": { - "summary": "A container for server configuration commands.", - "since": "2.0.0", - "group": "server", - "complexity": "Depends on subcommand.", + "CLUSTER BUMPEPOCH": { + "summary": "Advances the cluster config epoch.", + "since": "3.0.0", + "group": "cluster", + "complexity": "O(1)", "acl_categories": [ - "@slow" + "@admin", + "@slow", + "@dangerous" ], - "arity": -2 - }, - "CONFIG GET": { - "summary": "Returns the effective values of configuration parameters.", - "since": "2.0.0", - "group": "server", - "complexity": "O(N) when N is the number of configuration parameters provided", - "history": [ - [ - "7.0.0", - "Added the ability to pass multiple pattern parameters in one call" - ] + "arity": 2, + "command_flags": [ + "admin", + "stale", + "no_async_loading" ], + "hints": [ + "nondeterministic_output" + ] + }, + "CLUSTER COUNT-FAILURE-REPORTS": { + "summary": "Returns the number of active failure reports active for a node.", + "since": "3.0.0", + "group": "cluster", + "complexity": "O(N) where N is the number of failure reports", "acl_categories": [ "@admin", "@slow", "@dangerous" ], - "arity": -3, + "arity": 3, "arguments": [ { - "name": "parameter", + "name": "node-id", "type": "string", - "display_text": "parameter", - "multiple": true + "display_text": "node-id" } ], "command_flags": [ "admin", - "noscript", "loading", "stale" + ], + "hints": [ + "nondeterministic_output" ] }, - "CONFIG HELP": { - "summary": "Returns helpful text about the different subcommands.", - "since": "5.0.0", - "group": "server", + "CLUSTER COUNTKEYSINSLOT": { + "summary": "Returns the number of keys in a hash slot.", + "since": "3.0.0", + "group": "cluster", "complexity": "O(1)", "acl_categories": [ "@slow" ], - "arity": 2, + "arity": 3, + "arguments": [ + { + "name": "slot", + "type": "integer", + "display_text": "slot" + } + ], "command_flags": [ - "loading", "stale" ] }, - "CONFIG RESETSTAT": { - "summary": "Resets the server's statistics.", - "since": "2.0.0", - "group": "server", - "complexity": "O(1)", + "CLUSTER DELSLOTS": { + "summary": "Sets hash slots as unbound for a node.", + "since": "3.0.0", + "group": "cluster", + "complexity": "O(N) where N is the total number of hash slot arguments", "acl_categories": [ "@admin", "@slow", "@dangerous" ], - "arity": 2, + "arity": -3, + "arguments": [ + { + "name": "slot", + "type": "integer", + "display_text": "slot", + "multiple": true + } + ], "command_flags": [ "admin", - "noscript", - "loading", - "stale" - ], - "hints": [ - "request_policy:all_nodes", - "response_policy:all_succeeded" + "stale", + "no_async_loading" ] }, - "CONFIG REWRITE": { - "summary": "Persists the effective configuration to file.", - "since": "2.8.0", - "group": "server", - "complexity": "O(1)", + "CLUSTER DELSLOTSRANGE": { + "summary": "Sets hash slot ranges as unbound for a node.", + "since": "7.0.0", + "group": "cluster", + "complexity": "O(N) where N is the total number of the slots between the start slot and end slot arguments.", "acl_categories": [ "@admin", "@slow", "@dangerous" ], - "arity": 2, + "arity": -4, + "arguments": [ + { + "name": "range", + "type": "block", + "multiple": true, + "arguments": [ + { + "name": "start-slot", + "type": "integer", + "display_text": "start-slot" + }, + { + "name": "end-slot", + "type": "integer", + "display_text": "end-slot" + } + ] + } + ], "command_flags": [ "admin", - "noscript", - "loading", - "stale" - ], - "hints": [ - "request_policy:all_nodes", - "response_policy:all_succeeded" + "stale", + "no_async_loading" ] }, - "CONFIG SET": { - "summary": "Sets configuration parameters in-flight.", - "since": "2.0.0", - "group": "server", - "complexity": "O(N) when N is the number of configuration parameters provided", - "history": [ - [ - "7.0.0", - "Added the ability to set multiple parameters in one call." - ] - ], + "CLUSTER FAILOVER": { + "summary": "Forces a replica to perform a manual failover of its master.", + "since": "3.0.0", + "group": "cluster", + "complexity": "O(1)", "acl_categories": [ "@admin", "@slow", "@dangerous" ], - "arity": -4, + "arity": -2, "arguments": [ { - "name": "data", - "type": "block", - "multiple": true, + "name": "options", + "type": "oneof", + "optional": true, "arguments": [ { - "name": "parameter", - "type": "string", - "display_text": "parameter" + "name": "force", + "type": "pure-token", + "display_text": "force", + "token": "FORCE" }, { - "name": "value", - "type": "string", - "display_text": "value" + "name": "takeover", + "type": "pure-token", + "display_text": "takeover", + "token": "TAKEOVER" } ] } ], "command_flags": [ "admin", - "noscript", - "loading", - "stale" + "stale", + "no_async_loading" + ] + }, + "CLUSTER FLUSHSLOTS": { + "summary": "Deletes all slots information from a node.", + "since": "3.0.0", + "group": "cluster", + "complexity": "O(1)", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" ], - "hints": [ - "request_policy:all_nodes", - "response_policy:all_succeeded" + "arity": 2, + "command_flags": [ + "admin", + "stale", + "no_async_loading" ] }, - "COPY": { - "summary": "Copies the value of a key to a new key.", - "since": "6.2.0", - "group": "generic", - "complexity": "O(N) worst case for collections, where N is the number of nested items. O(1) for string values.", + "CLUSTER FORGET": { + "summary": "Removes a node from the nodes table.", + "since": "3.0.0", + "group": "cluster", + "complexity": "O(1)", "acl_categories": [ - "@keyspace", - "@write", - "@slow" + "@admin", + "@slow", + "@dangerous" ], - "arity": -3, - "key_specs": [ + "arity": 3, + "arguments": [ { - "begin_search": { - "type": "index", - "spec": { - "index": 1 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "RO": true, - "access": true - }, - { - "begin_search": { - "type": "index", - "spec": { - "index": 2 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "OW": true, - "update": true + "name": "node-id", + "type": "string", + "display_text": "node-id" } ], + "command_flags": [ + "admin", + "stale", + "no_async_loading" + ] + }, + "CLUSTER GETKEYSINSLOT": { + "summary": "Returns the key names in a hash slot.", + "since": "3.0.0", + "group": "cluster", + "complexity": "O(N) where N is the number of requested keys", + "acl_categories": [ + "@slow" + ], + "arity": 4, "arguments": [ { - "name": "source", - "type": "key", - "display_text": "source", - "key_spec_index": 0 - }, - { - "name": "destination", - "type": "key", - "display_text": "destination", - "key_spec_index": 1 - }, - { - "name": "destination-db", + "name": "slot", "type": "integer", - "display_text": "destination-db", - "token": "DB", - "optional": true + "display_text": "slot" }, { - "name": "replace", - "type": "pure-token", - "display_text": "replace", - "token": "REPLACE", - "optional": true + "name": "count", + "type": "integer", + "display_text": "count" } ], "command_flags": [ - "write", - "denyoom" + "stale" + ], + "hints": [ + "nondeterministic_output" ] }, - "DBSIZE": { - "summary": "Returns the number of keys in the database.", - "since": "1.0.0", - "group": "server", + "CLUSTER HELP": { + "summary": "Returns helpful text about the different subcommands.", + "since": "5.0.0", + "group": "cluster", "complexity": "O(1)", "acl_categories": [ - "@keyspace", - "@read", - "@fast" + "@slow" ], - "arity": 1, + "arity": 2, "command_flags": [ - "readonly", - "fast" - ], - "hints": [ - "request_policy:all_shards", - "response_policy:agg_sum" + "loading", + "stale" ] }, - "DEBUG": { - "summary": "A container for debugging commands.", - "since": "1.0.0", - "group": "server", - "complexity": "Depends on subcommand.", + "CLUSTER INFO": { + "summary": "Returns information about the state of a node.", + "since": "3.0.0", + "group": "cluster", + "complexity": "O(1)", "acl_categories": [ - "@admin", - "@slow", - "@dangerous" + "@slow" ], - "arity": -2, + "arity": 2, "command_flags": [ - "admin", - "noscript", "loading", "stale" ], - "doc_flags": [ - "syscmd" + "hints": [ + "nondeterministic_output" ] }, - "DECR": { - "summary": "Decrements the integer value of a key by one. Uses 0 as initial value if the key doesn't exist.", - "since": "1.0.0", - "group": "string", - "complexity": "O(1)", + "CLUSTER KEYSLOT": { + "summary": "Returns the hash slot for a key.", + "since": "3.0.0", + "group": "cluster", + "complexity": "O(N) where N is the number of bytes in the key", "acl_categories": [ - "@write", - "@string", - "@fast" - ], - "arity": 2, - "key_specs": [ - { - "begin_search": { - "type": "index", - "spec": { - "index": 1 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "RW": true, - "access": true, - "update": true - } + "@slow" ], + "arity": 3, "arguments": [ { "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 + "type": "string", + "display_text": "key" } ], "command_flags": [ - "write", - "denyoom", - "fast" + "loading", + "stale" ] }, - "DECRBY": { - "summary": "Decrements a number from the integer value of a key. Uses 0 as initial value if the key doesn't exist.", - "since": "1.0.0", - "group": "string", - "complexity": "O(1)", + "CLUSTER LINKS": { + "summary": "Returns a list of all TCP links to and from peer nodes.", + "since": "7.0.0", + "group": "cluster", + "complexity": "O(N) where N is the total number of Cluster nodes", "acl_categories": [ - "@write", - "@string", - "@fast" + "@slow" ], - "arity": 3, - "key_specs": [ - { - "begin_search": { - "type": "index", - "spec": { - "index": 1 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "RW": true, - "access": true, - "update": true - } + "arity": 2, + "command_flags": [ + "loading", + "stale" + ], + "hints": [ + "nondeterministic_output" + ] + }, + "CLUSTER MEET": { + "summary": "Forces a node to handshake with another node.", + "since": "3.0.0", + "group": "cluster", + "complexity": "O(1)", + "history": [ + [ + "4.0.0", + "Added the optional `cluster_bus_port` argument." + ] + ], + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" ], + "arity": -4, "arguments": [ { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 + "name": "ip", + "type": "string", + "display_text": "ip" }, { - "name": "decrement", + "name": "port", "type": "integer", - "display_text": "decrement" + "display_text": "port" + }, + { + "name": "cluster-bus-port", + "type": "integer", + "display_text": "cluster-bus-port", + "since": "4.0.0", + "optional": true } ], "command_flags": [ - "write", - "denyoom", - "fast" - ] + "admin", + "stale", + "no_async_loading" + ] }, - "DEL": { - "summary": "Deletes one or more keys.", - "since": "1.0.0", - "group": "generic", - "complexity": "O(N) where N is the number of keys that will be removed. When a key to remove holds a value other than a string, the individual complexity for this key is O(M) where M is the number of elements in the list, set, sorted set or hash. Removing a single key that holds a string value is O(1).", + "CLUSTER MIGRATION": { + "summary": "Start, monitor and cancel slot migration.", + "since": "8.4.0", + "group": "cluster", + "complexity": "O(N) where N is the total number of the slots between the start slot and end slot arguments.", "acl_categories": [ - "@keyspace", - "@write", - "@slow" - ], - "arity": -2, - "key_specs": [ - { - "begin_search": { - "type": "index", - "spec": { - "index": 1 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": -1, - "keystep": 1, - "limit": 0 - } - }, - "RM": true, - "delete": true - } + "@admin", + "@slow", + "@dangerous" ], + "arity": -4, "arguments": [ { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0, - "multiple": true + "name": "subcommand", + "type": "oneof", + "arguments": [ + { + "name": "import", + "type": "block", + "token": "IMPORT", + "multiple": true, + "arguments": [ + { + "name": "start-slot", + "type": "integer", + "display_text": "start-slot" + }, + { + "name": "end-slot", + "type": "integer", + "display_text": "end-slot" + } + ] + }, + { + "name": "cancel", + "type": "oneof", + "token": "CANCEL", + "arguments": [ + { + "name": "task-id", + "type": "string", + "display_text": "task-id", + "token": "ID" + }, + { + "name": "all", + "type": "pure-token", + "display_text": "all", + "token": "ALL" + } + ] + }, + { + "name": "status", + "type": "oneof", + "token": "STATUS", + "arguments": [ + { + "name": "task-id", + "type": "string", + "display_text": "task-id", + "token": "ID", + "optional": true + }, + { + "name": "all", + "type": "pure-token", + "display_text": "all", + "token": "ALL", + "optional": true + } + ] + } + ] } ], "command_flags": [ - "write" + "admin", + "stale", + "no_async_loading" + ] + }, + "CLUSTER MYID": { + "summary": "Returns the ID of a node.", + "since": "3.0.0", + "group": "cluster", + "complexity": "O(1)", + "acl_categories": [ + "@slow" ], - "hints": [ - "request_policy:multi_shard", - "response_policy:agg_sum" + "arity": 2, + "command_flags": [ + "loading", + "stale" ] }, - "DISCARD": { - "summary": "Discards a transaction.", - "since": "2.0.0", - "group": "transactions", - "complexity": "O(N), when N is the number of queued commands", + "CLUSTER MYSHARDID": { + "summary": "Returns the shard ID of a node.", + "since": "7.2.0", + "group": "cluster", + "complexity": "O(1)", "acl_categories": [ - "@fast", - "@transaction" + "@slow" ], - "arity": 1, + "arity": 2, "command_flags": [ - "noscript", "loading", - "stale", - "fast", - "allow_busy" + "stale" + ], + "hints": [ + "nondeterministic_output" ] }, - "DUMP": { - "summary": "Returns a serialized representation of the value stored at a key.", - "since": "2.6.0", - "group": "generic", - "complexity": "O(1) to access the key and additional O(N*M) to serialize it, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1).", + "CLUSTER NODES": { + "summary": "Returns the cluster configuration for a node.", + "since": "3.0.0", + "group": "cluster", + "complexity": "O(N) where N is the total number of Cluster nodes", "acl_categories": [ - "@keyspace", - "@read", "@slow" ], "arity": 2, - "key_specs": [ - { - "begin_search": { - "type": "index", - "spec": { - "index": 1 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "RO": true, - "access": true - } + "command_flags": [ + "loading", + "stale" + ], + "hints": [ + "nondeterministic_output" + ] + }, + "CLUSTER REPLICAS": { + "summary": "Lists the replica nodes of a master node.", + "since": "5.0.0", + "group": "cluster", + "complexity": "O(N) where N is the number of replicas.", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" ], + "arity": 3, "arguments": [ { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 + "name": "node-id", + "type": "string", + "display_text": "node-id" } ], "command_flags": [ - "readonly" + "admin", + "loading", + "stale" ], "hints": [ "nondeterministic_output" ] }, - "ECHO": { - "summary": "Returns the given string.", - "since": "1.0.0", - "group": "connection", + "CLUSTER REPLICATE": { + "summary": "Configure a node as replica of a master node.", + "since": "3.0.0", + "group": "cluster", "complexity": "O(1)", "acl_categories": [ - "@fast", - "@connection" + "@admin", + "@slow", + "@dangerous" ], - "arity": 2, + "arity": 3, "arguments": [ { - "name": "message", + "name": "node-id", "type": "string", - "display_text": "message" + "display_text": "node-id" } ], "command_flags": [ - "loading", + "admin", "stale", - "fast" + "no_async_loading" ] }, - "EVAL": { - "summary": "Executes a server-side Lua script.", - "since": "2.6.0", - "group": "scripting", - "complexity": "Depends on the script that is executed.", + "CLUSTER RESET": { + "summary": "Resets a node.", + "since": "3.0.0", + "group": "cluster", + "complexity": "O(N) where N is the number of known nodes. The command may execute a FLUSHALL as a side effect.", "acl_categories": [ + "@admin", "@slow", - "@scripting" - ], - "arity": -3, - "key_specs": [ - { - "notes": "We cannot tell how the keys will be used so we assume the worst, RW and UPDATE", - "begin_search": { - "type": "index", - "spec": { - "index": 2 - } - }, - "find_keys": { - "type": "keynum", - "spec": { - "keynumidx": 0, - "firstkey": 1, - "keystep": 1 - } - }, - "RW": true, - "access": true, - "update": true - } + "@dangerous" ], + "arity": -2, "arguments": [ { - "name": "script", - "type": "string", - "display_text": "script" - }, - { - "name": "numkeys", - "type": "integer", - "display_text": "numkeys" + "name": "reset-type", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "hard", + "type": "pure-token", + "display_text": "hard", + "token": "HARD" + }, + { + "name": "soft", + "type": "pure-token", + "display_text": "soft", + "token": "SOFT" + } + ] + } + ], + "command_flags": [ + "admin", + "noscript", + "stale" + ] + }, + "CLUSTER SAVECONFIG": { + "summary": "Forces a node to save the cluster configuration to disk.", + "since": "3.0.0", + "group": "cluster", + "complexity": "O(1)", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" + ], + "arity": 2, + "command_flags": [ + "admin", + "stale", + "no_async_loading" + ] + }, + "CLUSTER SET-CONFIG-EPOCH": { + "summary": "Sets the configuration epoch for a new node.", + "since": "3.0.0", + "group": "cluster", + "complexity": "O(1)", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" + ], + "arity": 3, + "arguments": [ + { + "name": "config-epoch", + "type": "integer", + "display_text": "config-epoch" + } + ], + "command_flags": [ + "admin", + "stale", + "no_async_loading" + ] + }, + "CLUSTER SETSLOT": { + "summary": "Binds a hash slot to a node.", + "since": "3.0.0", + "group": "cluster", + "complexity": "O(1)", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" + ], + "arity": -4, + "arguments": [ + { + "name": "slot", + "type": "integer", + "display_text": "slot" + }, + { + "name": "subcommand", + "type": "oneof", + "arguments": [ + { + "name": "importing", + "type": "string", + "display_text": "node-id", + "token": "IMPORTING" + }, + { + "name": "migrating", + "type": "string", + "display_text": "node-id", + "token": "MIGRATING" + }, + { + "name": "node", + "type": "string", + "display_text": "node-id", + "token": "NODE" + }, + { + "name": "stable", + "type": "pure-token", + "display_text": "stable", + "token": "STABLE" + } + ] + } + ], + "command_flags": [ + "admin", + "stale", + "no_async_loading" + ] + }, + "CLUSTER SHARDS": { + "summary": "Returns the mapping of cluster slots to shards.", + "since": "7.0.0", + "group": "cluster", + "complexity": "O(N) where N is the total number of cluster nodes", + "acl_categories": [ + "@slow" + ], + "arity": 2, + "command_flags": [ + "loading", + "stale" + ], + "hints": [ + "nondeterministic_output" + ] + }, + "CLUSTER SLAVES": { + "summary": "Lists the replica nodes of a master node.", + "since": "3.0.0", + "group": "cluster", + "complexity": "O(N) where N is the number of replicas.", + "deprecated_since": "5.0.0", + "replaced_by": "`CLUSTER REPLICAS`", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" + ], + "arity": 3, + "arguments": [ + { + "name": "node-id", + "type": "string", + "display_text": "node-id" + } + ], + "command_flags": [ + "admin", + "loading", + "stale" + ], + "doc_flags": [ + "deprecated" + ], + "hints": [ + "nondeterministic_output" + ] + }, + "CLUSTER SLOT-STATS": { + "summary": "Return an array of slot usage statistics for slots assigned to the current node.", + "since": "8.2.0", + "group": "cluster", + "complexity": "O(N) where N is the total number of slots based on arguments. O(N*log(N)) with ORDERBY subcommand.", + "acl_categories": [ + "@slow" + ], + "arity": -4, + "arguments": [ + { + "name": "filter", + "type": "oneof", + "arguments": [ + { + "name": "slotsrange", + "type": "block", + "token": "SLOTSRANGE", + "arguments": [ + { + "name": "start-slot", + "type": "integer", + "display_text": "start-slot" + }, + { + "name": "end-slot", + "type": "integer", + "display_text": "end-slot" + } + ] + }, + { + "name": "orderby", + "type": "block", + "token": "ORDERBY", + "arguments": [ + { + "name": "metric", + "type": "string", + "display_text": "metric" + }, + { + "name": "limit", + "type": "integer", + "display_text": "limit", + "token": "LIMIT", + "optional": true + }, + { + "name": "order", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "asc", + "type": "pure-token", + "display_text": "asc", + "token": "ASC" + }, + { + "name": "desc", + "type": "pure-token", + "display_text": "desc", + "token": "DESC" + } + ] + } + ] + } + ] + } + ], + "command_flags": [ + "loading", + "stale" + ], + "hints": [ + "nondeterministic_output", + "request_policy:all_shards" + ] + }, + "CLUSTER SLOTS": { + "summary": "Returns the mapping of cluster slots to nodes.", + "since": "3.0.0", + "group": "cluster", + "complexity": "O(N) where N is the total number of Cluster nodes", + "deprecated_since": "7.0.0", + "replaced_by": "`CLUSTER SHARDS`", + "history": [ + [ + "4.0.0", + "Added node IDs." + ], + [ + "7.0.0", + "Added additional networking metadata field." + ] + ], + "acl_categories": [ + "@slow" + ], + "arity": 2, + "command_flags": [ + "loading", + "stale" + ], + "doc_flags": [ + "deprecated" + ], + "hints": [ + "nondeterministic_output" + ] + }, + "CLUSTER SYNCSLOTS": { + "summary": "Internal command for atomic slot migration protocol between cluster nodes.", + "since": "8.4.0", + "group": "cluster", + "complexity": "O(1)", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" + ], + "arity": -3, + "arguments": [ + { + "name": "subcommand", + "type": "oneof", + "arguments": [ + { + "name": "sync", + "type": "block", + "token": "SYNC", + "arguments": [ + { + "name": "task-id", + "type": "string", + "display_text": "task-id" + }, + { + "name": "slot-range", + "type": "block", + "multiple": true, + "arguments": [ + { + "name": "start-slot", + "type": "integer", + "display_text": "start-slot" + }, + { + "name": "end-slot", + "type": "integer", + "display_text": "end-slot" + } + ] + } + ] + }, + { + "name": "task-id", + "type": "string", + "display_text": "task-id", + "token": "RDBCHANNEL" + }, + { + "name": "snapshot-eof", + "type": "pure-token", + "display_text": "snapshot-eof", + "token": "SNAPSHOT-EOF" + }, + { + "name": "stream-eof", + "type": "pure-token", + "display_text": "stream-eof", + "token": "STREAM-EOF" + }, + { + "name": "ack", + "type": "block", + "token": "ACK", + "arguments": [ + { + "name": "state", + "type": "string", + "display_text": "state" + }, + { + "name": "offset", + "type": "integer", + "display_text": "offset" + } + ] + }, + { + "name": "error", + "type": "string", + "display_text": "error", + "token": "FAIL" + }, + { + "name": "conf", + "type": "block", + "token": "CONF", + "arguments": [ + { + "name": "option", + "type": "string", + "display_text": "option", + "multiple": true + }, + { + "name": "value", + "type": "string", + "display_text": "value", + "multiple": true + } + ] + } + ] + } + ], + "command_flags": [ + "admin", + "stale", + "no_async_loading" + ], + "hints": [ + "nondeterministic_output" + ] + }, + "COMMAND": { + "summary": "Returns detailed information about all commands.", + "since": "2.8.13", + "group": "server", + "complexity": "O(N) where N is the total number of Redis commands", + "acl_categories": [ + "@slow", + "@connection" + ], + "arity": -1, + "command_flags": [ + "loading", + "stale" + ], + "hints": [ + "nondeterministic_output_order" + ] + }, + "COMMAND COUNT": { + "summary": "Returns a count of commands.", + "since": "2.8.13", + "group": "server", + "complexity": "O(1)", + "acl_categories": [ + "@slow", + "@connection" + ], + "arity": 2, + "command_flags": [ + "loading", + "stale" + ] + }, + "COMMAND DOCS": { + "summary": "Returns documentary information about one, multiple or all commands.", + "since": "7.0.0", + "group": "server", + "complexity": "O(N) where N is the number of commands to look up", + "acl_categories": [ + "@slow", + "@connection" + ], + "arity": -2, + "arguments": [ + { + "name": "command-name", + "type": "string", + "display_text": "command-name", + "optional": true, + "multiple": true + } + ], + "command_flags": [ + "loading", + "stale" + ], + "hints": [ + "nondeterministic_output_order" + ] + }, + "COMMAND GETKEYS": { + "summary": "Extracts the key names from an arbitrary command.", + "since": "2.8.13", + "group": "server", + "complexity": "O(N) where N is the number of arguments to the command", + "acl_categories": [ + "@slow", + "@connection" + ], + "arity": -3, + "arguments": [ + { + "name": "command", + "type": "string", + "display_text": "command" + }, + { + "name": "arg", + "type": "string", + "display_text": "arg", + "optional": true, + "multiple": true + } + ], + "command_flags": [ + "loading", + "stale" + ] + }, + "COMMAND GETKEYSANDFLAGS": { + "summary": "Extracts the key names and access flags for an arbitrary command.", + "since": "7.0.0", + "group": "server", + "complexity": "O(N) where N is the number of arguments to the command", + "acl_categories": [ + "@slow", + "@connection" + ], + "arity": -3, + "arguments": [ + { + "name": "command", + "type": "string", + "display_text": "command" + }, + { + "name": "arg", + "type": "string", + "display_text": "arg", + "optional": true, + "multiple": true + } + ], + "command_flags": [ + "loading", + "stale" + ] + }, + "COMMAND HELP": { + "summary": "Returns helpful text about the different subcommands.", + "since": "5.0.0", + "group": "server", + "complexity": "O(1)", + "acl_categories": [ + "@slow", + "@connection" + ], + "arity": 2, + "command_flags": [ + "loading", + "stale" + ] + }, + "COMMAND INFO": { + "summary": "Returns information about one, multiple or all commands.", + "since": "2.8.13", + "group": "server", + "complexity": "O(N) where N is the number of commands to look up", + "history": [ + [ + "7.0.0", + "Allowed to be called with no argument to get info on all commands." + ] + ], + "acl_categories": [ + "@slow", + "@connection" + ], + "arity": -2, + "arguments": [ + { + "name": "command-name", + "type": "string", + "display_text": "command-name", + "optional": true, + "multiple": true + } + ], + "command_flags": [ + "loading", + "stale" + ], + "hints": [ + "nondeterministic_output_order" + ] + }, + "COMMAND LIST": { + "summary": "Returns a list of command names.", + "since": "7.0.0", + "group": "server", + "complexity": "O(N) where N is the total number of Redis commands", + "acl_categories": [ + "@slow", + "@connection" + ], + "arity": -2, + "arguments": [ + { + "name": "filterby", + "type": "oneof", + "token": "FILTERBY", + "optional": true, + "arguments": [ + { + "name": "module-name", + "type": "string", + "display_text": "module-name", + "token": "MODULE" + }, + { + "name": "category", + "type": "string", + "display_text": "category", + "token": "ACLCAT" + }, + { + "name": "pattern", + "type": "pattern", + "display_text": "pattern", + "token": "PATTERN" + } + ] + } + ], + "command_flags": [ + "loading", + "stale" + ], + "hints": [ + "nondeterministic_output_order" + ] + }, + "CONFIG": { + "summary": "A container for server configuration commands.", + "since": "2.0.0", + "group": "server", + "complexity": "Depends on subcommand.", + "acl_categories": [ + "@slow" + ], + "arity": -2 + }, + "CONFIG GET": { + "summary": "Returns the effective values of configuration parameters.", + "since": "2.0.0", + "group": "server", + "complexity": "O(N) when N is the number of configuration parameters provided", + "history": [ + [ + "7.0.0", + "Added the ability to pass multiple pattern parameters in one call" + ] + ], + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" + ], + "arity": -3, + "arguments": [ + { + "name": "parameter", + "type": "string", + "display_text": "parameter", + "multiple": true + } + ], + "command_flags": [ + "admin", + "noscript", + "loading", + "stale" + ] + }, + "CONFIG HELP": { + "summary": "Returns helpful text about the different subcommands.", + "since": "5.0.0", + "group": "server", + "complexity": "O(1)", + "acl_categories": [ + "@slow" + ], + "arity": 2, + "command_flags": [ + "loading", + "stale" + ] + }, + "CONFIG RESETSTAT": { + "summary": "Resets the server's statistics.", + "since": "2.0.0", + "group": "server", + "complexity": "O(1)", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" + ], + "arity": 2, + "command_flags": [ + "admin", + "noscript", + "loading", + "stale" + ], + "hints": [ + "request_policy:all_nodes", + "response_policy:all_succeeded" + ] + }, + "CONFIG REWRITE": { + "summary": "Persists the effective configuration to file.", + "since": "2.8.0", + "group": "server", + "complexity": "O(1)", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" + ], + "arity": 2, + "command_flags": [ + "admin", + "noscript", + "loading", + "stale" + ], + "hints": [ + "request_policy:all_nodes", + "response_policy:all_succeeded" + ] + }, + "CONFIG SET": { + "summary": "Sets configuration parameters in-flight.", + "since": "2.0.0", + "group": "server", + "complexity": "O(N) when N is the number of configuration parameters provided", + "history": [ + [ + "7.0.0", + "Added the ability to set multiple parameters in one call." + ] + ], + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" + ], + "arity": -4, + "arguments": [ + { + "name": "data", + "type": "block", + "multiple": true, + "arguments": [ + { + "name": "parameter", + "type": "string", + "display_text": "parameter" + }, + { + "name": "value", + "type": "string", + "display_text": "value" + } + ] + } + ], + "command_flags": [ + "admin", + "noscript", + "loading", + "stale" + ], + "hints": [ + "request_policy:all_nodes", + "response_policy:all_succeeded" + ] + }, + "COPY": { + "summary": "Copies the value of a key to a new key.", + "since": "6.2.0", + "group": "generic", + "complexity": "O(N) worst case for collections, where N is the number of nested items. O(1) for string values.", + "acl_categories": [ + "@keyspace", + "@write", + "@slow" + ], + "arity": -3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + }, + { + "begin_search": { + "type": "index", + "spec": { + "index": 2 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "OW": true, + "update": true + } + ], + "arguments": [ + { + "name": "source", + "type": "key", + "display_text": "source", + "key_spec_index": 0 + }, + { + "name": "destination", + "type": "key", + "display_text": "destination", + "key_spec_index": 1 + }, + { + "name": "destination-db", + "type": "integer", + "display_text": "destination-db", + "token": "DB", + "optional": true + }, + { + "name": "replace", + "type": "pure-token", + "display_text": "replace", + "token": "REPLACE", + "optional": true + } + ], + "command_flags": [ + "write", + "denyoom" + ] + }, + "DBSIZE": { + "summary": "Returns the number of keys in the database.", + "since": "1.0.0", + "group": "server", + "complexity": "O(1)", + "acl_categories": [ + "@keyspace", + "@read", + "@fast" + ], + "arity": 1, + "command_flags": [ + "readonly", + "fast" + ], + "hints": [ + "request_policy:all_shards", + "response_policy:agg_sum" + ] + }, + "DEBUG": { + "summary": "A container for debugging commands.", + "since": "1.0.0", + "group": "server", + "complexity": "Depends on subcommand.", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" + ], + "arity": -2, + "command_flags": [ + "admin", + "noscript", + "loading", + "stale" + ], + "doc_flags": [ + "syscmd" + ] + }, + "DECR": { + "summary": "Decrements the integer value of a key by one. Uses 0 as initial value if the key doesn't exist.", + "since": "1.0.0", + "group": "string", + "complexity": "O(1)", + "acl_categories": [ + "@write", + "@string", + "@fast" + ], + "arity": 2, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "access": true, + "update": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + } + ], + "command_flags": [ + "write", + "denyoom", + "fast" + ] + }, + "DECRBY": { + "summary": "Decrements a number from the integer value of a key. Uses 0 as initial value if the key doesn't exist.", + "since": "1.0.0", + "group": "string", + "complexity": "O(1)", + "acl_categories": [ + "@write", + "@string", + "@fast" + ], + "arity": 3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "access": true, + "update": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "decrement", + "type": "integer", + "display_text": "decrement" + } + ], + "command_flags": [ + "write", + "denyoom", + "fast" + ] + }, + "DEL": { + "summary": "Deletes one or more keys.", + "since": "1.0.0", + "group": "generic", + "complexity": "O(N) where N is the number of keys that will be removed. When a key to remove holds a value other than a string, the individual complexity for this key is O(M) where M is the number of elements in the list, set, sorted set or hash. Removing a single key that holds a string value is O(1).", + "acl_categories": [ + "@keyspace", + "@write", + "@slow" + ], + "arity": -2, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": -1, + "keystep": 1, + "limit": 0 + } + }, + "RM": true, + "delete": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0, + "multiple": true + } + ], + "command_flags": [ + "write" + ], + "hints": [ + "request_policy:multi_shard", + "response_policy:agg_sum" + ] + }, + "DELEX": { + "summary": "Conditionally removes the specified key based on value or digest comparison.", + "since": "8.4.0", + "group": "string", + "complexity": "O(1) for IFEQ/IFNE, O(N) for IFDEQ/IFDNE where N is the length of the string value.", + "acl_categories": [ + "@write", + "@string", + "@fast" + ], + "arity": -2, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "delete": true, + "variable_flags": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "condition", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "ifeq-value", + "type": "string", + "display_text": "ifeq-value", + "token": "IFEQ" + }, + { + "name": "ifne-value", + "type": "string", + "display_text": "ifne-value", + "token": "IFNE" + }, + { + "name": "ifdeq-digest", + "type": "integer", + "display_text": "ifdeq-digest", + "token": "IFDEQ" + }, + { + "name": "ifdne-digest", + "type": "integer", + "display_text": "ifdne-digest", + "token": "IFDNE" + } + ] + } + ], + "command_flags": [ + "write", + "fast" + ] + }, + "DIGEST": { + "summary": "Returns the XXH3 hash of a string value.", + "since": "8.4.0", + "group": "string", + "complexity": "O(N) where N is the length of the string value.", + "acl_categories": [ + "@read", + "@string", + "@fast" + ], + "arity": 2, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + } + ], + "command_flags": [ + "readonly", + "fast" + ] + }, + "DISCARD": { + "summary": "Discards a transaction.", + "since": "2.0.0", + "group": "transactions", + "complexity": "O(N), when N is the number of queued commands", + "acl_categories": [ + "@fast", + "@transaction" + ], + "arity": 1, + "command_flags": [ + "noscript", + "loading", + "stale", + "fast", + "allow_busy" + ] + }, + "DUMP": { + "summary": "Returns a serialized representation of the value stored at a key.", + "since": "2.6.0", + "group": "generic", + "complexity": "O(1) to access the key and additional O(N*M) to serialize it, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1).", + "acl_categories": [ + "@keyspace", + "@read", + "@slow" + ], + "arity": 2, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + } + ], + "command_flags": [ + "readonly" + ], + "hints": [ + "nondeterministic_output" + ] + }, + "ECHO": { + "summary": "Returns the given string.", + "since": "1.0.0", + "group": "connection", + "complexity": "O(1)", + "acl_categories": [ + "@fast", + "@connection" + ], + "arity": 2, + "arguments": [ + { + "name": "message", + "type": "string", + "display_text": "message" + } + ], + "command_flags": [ + "loading", + "stale", + "fast" + ] + }, + "EVAL": { + "summary": "Executes a server-side Lua script.", + "since": "2.6.0", + "group": "scripting", + "complexity": "Depends on the script that is executed.", + "acl_categories": [ + "@slow", + "@scripting" + ], + "arity": -3, + "key_specs": [ + { + "notes": "We cannot tell how the keys will be used so we assume the worst, RW and UPDATE", + "begin_search": { + "type": "index", + "spec": { + "index": 2 + } + }, + "find_keys": { + "type": "keynum", + "spec": { + "keynumidx": 0, + "firstkey": 1, + "keystep": 1 + } + }, + "RW": true, + "access": true, + "update": true + } + ], + "arguments": [ + { + "name": "script", + "type": "string", + "display_text": "script" + }, + { + "name": "numkeys", + "type": "integer", + "display_text": "numkeys" + }, + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0, + "optional": true, + "multiple": true + }, + { + "name": "arg", + "type": "string", + "display_text": "arg", + "optional": true, + "multiple": true + } + ], + "command_flags": [ + "noscript", + "stale", + "skip_monitor", + "no_mandatory_keys", + "movablekeys" + ] + }, + "EVALSHA": { + "summary": "Executes a server-side Lua script by SHA1 digest.", + "since": "2.6.0", + "group": "scripting", + "complexity": "Depends on the script that is executed.", + "acl_categories": [ + "@slow", + "@scripting" + ], + "arity": -3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 2 + } + }, + "find_keys": { + "type": "keynum", + "spec": { + "keynumidx": 0, + "firstkey": 1, + "keystep": 1 + } + }, + "RW": true, + "access": true, + "update": true + } + ], + "arguments": [ + { + "name": "sha1", + "type": "string", + "display_text": "sha1" + }, + { + "name": "numkeys", + "type": "integer", + "display_text": "numkeys" + }, + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0, + "optional": true, + "multiple": true + }, + { + "name": "arg", + "type": "string", + "display_text": "arg", + "optional": true, + "multiple": true + } + ], + "command_flags": [ + "noscript", + "stale", + "skip_monitor", + "no_mandatory_keys", + "movablekeys" + ] + }, + "EVALSHA_RO": { + "summary": "Executes a read-only server-side Lua script by SHA1 digest.", + "since": "7.0.0", + "group": "scripting", + "complexity": "Depends on the script that is executed.", + "acl_categories": [ + "@slow", + "@scripting" + ], + "arity": -3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 2 + } + }, + "find_keys": { + "type": "keynum", + "spec": { + "keynumidx": 0, + "firstkey": 1, + "keystep": 1 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "sha1", + "type": "string", + "display_text": "sha1" + }, + { + "name": "numkeys", + "type": "integer", + "display_text": "numkeys" + }, + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0, + "optional": true, + "multiple": true + }, + { + "name": "arg", + "type": "string", + "display_text": "arg", + "optional": true, + "multiple": true + } + ], + "command_flags": [ + "readonly", + "noscript", + "stale", + "skip_monitor", + "no_mandatory_keys", + "movablekeys" + ] + }, + "EVAL_RO": { + "summary": "Executes a read-only server-side Lua script.", + "since": "7.0.0", + "group": "scripting", + "complexity": "Depends on the script that is executed.", + "acl_categories": [ + "@slow", + "@scripting" + ], + "arity": -3, + "key_specs": [ + { + "notes": "We cannot tell how the keys will be used so we assume the worst, RO and ACCESS", + "begin_search": { + "type": "index", + "spec": { + "index": 2 + } + }, + "find_keys": { + "type": "keynum", + "spec": { + "keynumidx": 0, + "firstkey": 1, + "keystep": 1 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "script", + "type": "string", + "display_text": "script" + }, + { + "name": "numkeys", + "type": "integer", + "display_text": "numkeys" + }, + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0, + "optional": true, + "multiple": true + }, + { + "name": "arg", + "type": "string", + "display_text": "arg", + "optional": true, + "multiple": true + } + ], + "command_flags": [ + "readonly", + "noscript", + "stale", + "skip_monitor", + "no_mandatory_keys", + "movablekeys" + ] + }, + "EXEC": { + "summary": "Executes all commands in a transaction.", + "since": "1.2.0", + "group": "transactions", + "complexity": "Depends on commands in the transaction", + "acl_categories": [ + "@slow", + "@transaction" + ], + "arity": 1, + "command_flags": [ + "noscript", + "loading", + "stale", + "skip_slowlog" + ] + }, + "EXISTS": { + "summary": "Determines whether one or more keys exist.", + "since": "1.0.0", + "group": "generic", + "complexity": "O(N) where N is the number of keys to check.", + "history": [ + [ + "3.0.3", + "Accepts multiple `key` arguments." + ] + ], + "acl_categories": [ + "@keyspace", + "@read", + "@fast" + ], + "arity": -2, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": -1, + "keystep": 1, + "limit": 0 + } + }, + "RO": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0, + "multiple": true + } + ], + "command_flags": [ + "readonly", + "fast" + ], + "hints": [ + "request_policy:multi_shard", + "response_policy:agg_sum" + ] + }, + "EXPIRE": { + "summary": "Sets the expiration time of a key in seconds.", + "since": "1.0.0", + "group": "generic", + "complexity": "O(1)", + "history": [ + [ + "7.0.0", + "Added options: `NX`, `XX`, `GT` and `LT`." + ] + ], + "acl_categories": [ + "@keyspace", + "@write", + "@fast" + ], + "arity": -3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "update": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "seconds", + "type": "integer", + "display_text": "seconds" + }, + { + "name": "condition", + "type": "oneof", + "since": "7.0.0", + "optional": true, + "arguments": [ + { + "name": "nx", + "type": "pure-token", + "display_text": "nx", + "token": "NX" + }, + { + "name": "xx", + "type": "pure-token", + "display_text": "xx", + "token": "XX" + }, + { + "name": "gt", + "type": "pure-token", + "display_text": "gt", + "token": "GT" + }, + { + "name": "lt", + "type": "pure-token", + "display_text": "lt", + "token": "LT" + } + ] + } + ], + "command_flags": [ + "write", + "fast" + ] + }, + "EXPIREAT": { + "summary": "Sets the expiration time of a key to a Unix timestamp.", + "since": "1.2.0", + "group": "generic", + "complexity": "O(1)", + "history": [ + [ + "7.0.0", + "Added options: `NX`, `XX`, `GT` and `LT`." + ] + ], + "acl_categories": [ + "@keyspace", + "@write", + "@fast" + ], + "arity": -3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "update": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "unix-time-seconds", + "type": "unix-time", + "display_text": "unix-time-seconds" + }, + { + "name": "condition", + "type": "oneof", + "since": "7.0.0", + "optional": true, + "arguments": [ + { + "name": "nx", + "type": "pure-token", + "display_text": "nx", + "token": "NX" + }, + { + "name": "xx", + "type": "pure-token", + "display_text": "xx", + "token": "XX" + }, + { + "name": "gt", + "type": "pure-token", + "display_text": "gt", + "token": "GT" + }, + { + "name": "lt", + "type": "pure-token", + "display_text": "lt", + "token": "LT" + } + ] + } + ], + "command_flags": [ + "write", + "fast" + ] + }, + "EXPIRETIME": { + "summary": "Returns the expiration time of a key as a Unix timestamp.", + "since": "7.0.0", + "group": "generic", + "complexity": "O(1)", + "acl_categories": [ + "@keyspace", + "@read", + "@fast" + ], + "arity": 2, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + } + ], + "command_flags": [ + "readonly", + "fast" + ] + }, + "FAILOVER": { + "summary": "Starts a coordinated failover from a server to one of its replicas.", + "since": "6.2.0", + "group": "server", + "complexity": "O(1)", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" + ], + "arity": -1, + "arguments": [ + { + "name": "target", + "type": "block", + "token": "TO", + "optional": true, + "arguments": [ + { + "name": "host", + "type": "string", + "display_text": "host" + }, + { + "name": "port", + "type": "integer", + "display_text": "port" + }, + { + "name": "force", + "type": "pure-token", + "display_text": "force", + "token": "FORCE", + "optional": true + } + ] + }, + { + "name": "abort", + "type": "pure-token", + "display_text": "abort", + "token": "ABORT", + "optional": true + }, + { + "name": "milliseconds", + "type": "integer", + "display_text": "milliseconds", + "token": "TIMEOUT", + "optional": true + } + ], + "command_flags": [ + "admin", + "noscript", + "stale" + ] + }, + "FCALL": { + "summary": "Invokes a function.", + "since": "7.0.0", + "group": "scripting", + "complexity": "Depends on the function that is executed.", + "acl_categories": [ + "@slow", + "@scripting" + ], + "arity": -3, + "key_specs": [ + { + "notes": "We cannot tell how the keys will be used so we assume the worst, RW and UPDATE", + "begin_search": { + "type": "index", + "spec": { + "index": 2 + } + }, + "find_keys": { + "type": "keynum", + "spec": { + "keynumidx": 0, + "firstkey": 1, + "keystep": 1 + } + }, + "RW": true, + "access": true, + "update": true + } + ], + "arguments": [ + { + "name": "function", + "type": "string", + "display_text": "function" + }, + { + "name": "numkeys", + "type": "integer", + "display_text": "numkeys" + }, + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0, + "optional": true, + "multiple": true + }, + { + "name": "arg", + "type": "string", + "display_text": "arg", + "optional": true, + "multiple": true + } + ], + "command_flags": [ + "noscript", + "stale", + "skip_monitor", + "no_mandatory_keys", + "movablekeys" + ] + }, + "FCALL_RO": { + "summary": "Invokes a read-only function.", + "since": "7.0.0", + "group": "scripting", + "complexity": "Depends on the function that is executed.", + "acl_categories": [ + "@slow", + "@scripting" + ], + "arity": -3, + "key_specs": [ + { + "notes": "We cannot tell how the keys will be used so we assume the worst, RO and ACCESS", + "begin_search": { + "type": "index", + "spec": { + "index": 2 + } + }, + "find_keys": { + "type": "keynum", + "spec": { + "keynumidx": 0, + "firstkey": 1, + "keystep": 1 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "function", + "type": "string", + "display_text": "function" + }, + { + "name": "numkeys", + "type": "integer", + "display_text": "numkeys" + }, + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0, + "optional": true, + "multiple": true + }, + { + "name": "arg", + "type": "string", + "display_text": "arg", + "optional": true, + "multiple": true + } + ], + "command_flags": [ + "readonly", + "noscript", + "stale", + "skip_monitor", + "no_mandatory_keys", + "movablekeys" + ] + }, + "FLUSHALL": { + "summary": "Removes all keys from all databases.", + "since": "1.0.0", + "group": "server", + "complexity": "O(N) where N is the total number of keys in all databases", + "history": [ + [ + "4.0.0", + "Added the `ASYNC` flushing mode modifier." + ], + [ + "6.2.0", + "Added the `SYNC` flushing mode modifier." + ] + ], + "acl_categories": [ + "@keyspace", + "@write", + "@slow", + "@dangerous" + ], + "arity": -1, + "arguments": [ + { + "name": "flush-type", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "async", + "type": "pure-token", + "display_text": "async", + "token": "ASYNC", + "since": "4.0.0" + }, + { + "name": "sync", + "type": "pure-token", + "display_text": "sync", + "token": "SYNC", + "since": "6.2.0" + } + ] + } + ], + "command_flags": [ + "write" + ], + "hints": [ + "request_policy:all_shards", + "response_policy:all_succeeded" + ] + }, + "FLUSHDB": { + "summary": "Remove all keys from the current database.", + "since": "1.0.0", + "group": "server", + "complexity": "O(N) where N is the number of keys in the selected database", + "history": [ + [ + "4.0.0", + "Added the `ASYNC` flushing mode modifier." + ], + [ + "6.2.0", + "Added the `SYNC` flushing mode modifier." + ] + ], + "acl_categories": [ + "@keyspace", + "@write", + "@slow", + "@dangerous" + ], + "arity": -1, + "arguments": [ + { + "name": "flush-type", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "async", + "type": "pure-token", + "display_text": "async", + "token": "ASYNC", + "since": "4.0.0" + }, + { + "name": "sync", + "type": "pure-token", + "display_text": "sync", + "token": "SYNC", + "since": "6.2.0" + } + ] + } + ], + "command_flags": [ + "write" + ], + "hints": [ + "request_policy:all_shards", + "response_policy:all_succeeded" + ] + }, + "FUNCTION": { + "summary": "A container for function commands.", + "since": "7.0.0", + "group": "scripting", + "complexity": "Depends on subcommand.", + "acl_categories": [ + "@slow" + ], + "arity": -2 + }, + "FUNCTION DELETE": { + "summary": "Deletes a library and its functions.", + "since": "7.0.0", + "group": "scripting", + "complexity": "O(1)", + "acl_categories": [ + "@write", + "@slow", + "@scripting" + ], + "arity": 3, + "arguments": [ + { + "name": "library-name", + "type": "string", + "display_text": "library-name" + } + ], + "command_flags": [ + "write", + "noscript" + ], + "hints": [ + "request_policy:all_shards", + "response_policy:all_succeeded" + ] + }, + "FUNCTION DUMP": { + "summary": "Dumps all libraries into a serialized binary payload.", + "since": "7.0.0", + "group": "scripting", + "complexity": "O(N) where N is the number of functions", + "acl_categories": [ + "@slow", + "@scripting" + ], + "arity": 2, + "command_flags": [ + "noscript" + ] + }, + "FUNCTION FLUSH": { + "summary": "Deletes all libraries and functions.", + "since": "7.0.0", + "group": "scripting", + "complexity": "O(N) where N is the number of functions deleted", + "acl_categories": [ + "@write", + "@slow", + "@scripting" + ], + "arity": -2, + "arguments": [ + { + "name": "flush-type", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "async", + "type": "pure-token", + "display_text": "async", + "token": "ASYNC" + }, + { + "name": "sync", + "type": "pure-token", + "display_text": "sync", + "token": "SYNC" + } + ] + } + ], + "command_flags": [ + "write", + "noscript" + ], + "hints": [ + "request_policy:all_shards", + "response_policy:all_succeeded" + ] + }, + "FUNCTION HELP": { + "summary": "Returns helpful text about the different subcommands.", + "since": "7.0.0", + "group": "scripting", + "complexity": "O(1)", + "acl_categories": [ + "@slow", + "@scripting" + ], + "arity": 2, + "command_flags": [ + "loading", + "stale" + ] + }, + "FUNCTION KILL": { + "summary": "Terminates a function during execution.", + "since": "7.0.0", + "group": "scripting", + "complexity": "O(1)", + "acl_categories": [ + "@slow", + "@scripting" + ], + "arity": 2, + "command_flags": [ + "noscript", + "allow_busy" + ], + "hints": [ + "request_policy:all_shards", + "response_policy:one_succeeded" + ] + }, + "FUNCTION LIST": { + "summary": "Returns information about all libraries.", + "since": "7.0.0", + "group": "scripting", + "complexity": "O(N) where N is the number of functions", + "acl_categories": [ + "@slow", + "@scripting" + ], + "arity": -2, + "arguments": [ + { + "name": "library-name-pattern", + "type": "string", + "display_text": "library-name-pattern", + "token": "LIBRARYNAME", + "optional": true + }, + { + "name": "withcode", + "type": "pure-token", + "display_text": "withcode", + "token": "WITHCODE", + "optional": true + } + ], + "command_flags": [ + "noscript" + ], + "hints": [ + "nondeterministic_output_order" + ] + }, + "FUNCTION LOAD": { + "summary": "Creates a library.", + "since": "7.0.0", + "group": "scripting", + "complexity": "O(1) (considering compilation time is redundant)", + "acl_categories": [ + "@write", + "@slow", + "@scripting" + ], + "arity": -3, + "arguments": [ + { + "name": "replace", + "type": "pure-token", + "display_text": "replace", + "token": "REPLACE", + "optional": true + }, + { + "name": "function-code", + "type": "string", + "display_text": "function-code" + } + ], + "command_flags": [ + "write", + "denyoom", + "noscript" + ], + "hints": [ + "request_policy:all_shards", + "response_policy:all_succeeded" + ] + }, + "FUNCTION RESTORE": { + "summary": "Restores all libraries from a payload.", + "since": "7.0.0", + "group": "scripting", + "complexity": "O(N) where N is the number of functions on the payload", + "acl_categories": [ + "@write", + "@slow", + "@scripting" + ], + "arity": -3, + "arguments": [ + { + "name": "serialized-value", + "type": "string", + "display_text": "serialized-value" + }, + { + "name": "policy", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "flush", + "type": "pure-token", + "display_text": "flush", + "token": "FLUSH" + }, + { + "name": "append", + "type": "pure-token", + "display_text": "append", + "token": "APPEND" + }, + { + "name": "replace", + "type": "pure-token", + "display_text": "replace", + "token": "REPLACE" + } + ] + } + ], + "command_flags": [ + "write", + "denyoom", + "noscript" + ], + "hints": [ + "request_policy:all_shards", + "response_policy:all_succeeded" + ] + }, + "FUNCTION STATS": { + "summary": "Returns information about a function during execution.", + "since": "7.0.0", + "group": "scripting", + "complexity": "O(1)", + "acl_categories": [ + "@slow", + "@scripting" + ], + "arity": 2, + "command_flags": [ + "noscript", + "allow_busy" + ], + "hints": [ + "nondeterministic_output", + "request_policy:all_shards", + "response_policy:special" + ] + }, + "GEOADD": { + "summary": "Adds one or more members to a geospatial index. The key is created if it doesn't exist.", + "since": "3.2.0", + "group": "geo", + "complexity": "O(log(N)) for each item added, where N is the number of elements in the sorted set.", + "history": [ + [ + "6.2.0", + "Added the `CH`, `NX` and `XX` options." + ] + ], + "acl_categories": [ + "@write", + "@geo", + "@slow" + ], + "arity": -5, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "update": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "condition", + "type": "oneof", + "since": "6.2.0", + "optional": true, + "arguments": [ + { + "name": "nx", + "type": "pure-token", + "display_text": "nx", + "token": "NX" + }, + { + "name": "xx", + "type": "pure-token", + "display_text": "xx", + "token": "XX" + } + ] + }, + { + "name": "change", + "type": "pure-token", + "display_text": "change", + "token": "CH", + "since": "6.2.0", + "optional": true + }, + { + "name": "data", + "type": "block", + "multiple": true, + "arguments": [ + { + "name": "longitude", + "type": "double", + "display_text": "longitude" + }, + { + "name": "latitude", + "type": "double", + "display_text": "latitude" + }, + { + "name": "member", + "type": "string", + "display_text": "member" + } + ] + } + ], + "command_flags": [ + "write", + "denyoom" + ] + }, + "GEODIST": { + "summary": "Returns the distance between two members of a geospatial index.", + "since": "3.2.0", + "group": "geo", + "complexity": "O(1)", + "acl_categories": [ + "@read", + "@geo", + "@slow" + ], + "arity": -4, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "member1", + "type": "string", + "display_text": "member1" + }, + { + "name": "member2", + "type": "string", + "display_text": "member2" + }, + { + "name": "unit", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "m", + "type": "pure-token", + "display_text": "m", + "token": "M" + }, + { + "name": "km", + "type": "pure-token", + "display_text": "km", + "token": "KM" + }, + { + "name": "ft", + "type": "pure-token", + "display_text": "ft", + "token": "FT" + }, + { + "name": "mi", + "type": "pure-token", + "display_text": "mi", + "token": "MI" + } + ] + } + ], + "command_flags": [ + "readonly" + ] + }, + "GEOHASH": { + "summary": "Returns members from a geospatial index as geohash strings.", + "since": "3.2.0", + "group": "geo", + "complexity": "O(1) for each member requested.", + "acl_categories": [ + "@read", + "@geo", + "@slow" + ], + "arity": -2, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "member", + "type": "string", + "display_text": "member", + "optional": true, + "multiple": true + } + ], + "command_flags": [ + "readonly" + ] + }, + "GEOPOS": { + "summary": "Returns the longitude and latitude of members from a geospatial index.", + "since": "3.2.0", + "group": "geo", + "complexity": "O(1) for each member requested.", + "acl_categories": [ + "@read", + "@geo", + "@slow" + ], + "arity": -2, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "member", + "type": "string", + "display_text": "member", + "optional": true, + "multiple": true + } + ], + "command_flags": [ + "readonly" + ] + }, + "GEORADIUS": { + "summary": "Queries a geospatial index for members within a distance from a coordinate, optionally stores the result.", + "since": "3.2.0", + "group": "geo", + "complexity": "O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.", + "deprecated_since": "6.2.0", + "replaced_by": "`GEOSEARCH` and `GEOSEARCHSTORE` with the `BYRADIUS` argument", + "history": [ + [ + "6.2.0", + "Added the `ANY` option for `COUNT`." + ], + [ + "7.0.0", + "Added support for uppercase unit names." + ] + ], + "acl_categories": [ + "@write", + "@geo", + "@slow" + ], + "arity": -6, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + }, + { + "begin_search": { + "type": "keyword", + "spec": { + "keyword": "STORE", + "startfrom": 6 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "OW": true, + "update": true + }, + { + "begin_search": { + "type": "keyword", + "spec": { + "keyword": "STOREDIST", + "startfrom": 6 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "OW": true, + "update": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "longitude", + "type": "double", + "display_text": "longitude" + }, + { + "name": "latitude", + "type": "double", + "display_text": "latitude" + }, + { + "name": "radius", + "type": "double", + "display_text": "radius" + }, + { + "name": "unit", + "type": "oneof", + "arguments": [ + { + "name": "m", + "type": "pure-token", + "display_text": "m", + "token": "M" + }, + { + "name": "km", + "type": "pure-token", + "display_text": "km", + "token": "KM" + }, + { + "name": "ft", + "type": "pure-token", + "display_text": "ft", + "token": "FT" + }, + { + "name": "mi", + "type": "pure-token", + "display_text": "mi", + "token": "MI" + } + ] + }, + { + "name": "withcoord", + "type": "pure-token", + "display_text": "withcoord", + "token": "WITHCOORD", + "optional": true + }, + { + "name": "withdist", + "type": "pure-token", + "display_text": "withdist", + "token": "WITHDIST", + "optional": true + }, + { + "name": "withhash", + "type": "pure-token", + "display_text": "withhash", + "token": "WITHHASH", + "optional": true + }, + { + "name": "count-block", + "type": "block", + "optional": true, + "arguments": [ + { + "name": "count", + "type": "integer", + "display_text": "count", + "token": "COUNT" + }, + { + "name": "any", + "type": "pure-token", + "display_text": "any", + "token": "ANY", + "since": "6.2.0", + "optional": true + } + ] + }, + { + "name": "order", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "asc", + "type": "pure-token", + "display_text": "asc", + "token": "ASC" + }, + { + "name": "desc", + "type": "pure-token", + "display_text": "desc", + "token": "DESC" + } + ] + }, + { + "name": "store", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "storekey", + "type": "key", + "display_text": "key", + "key_spec_index": 1, + "token": "STORE" + }, + { + "name": "storedistkey", + "type": "key", + "display_text": "key", + "key_spec_index": 2, + "token": "STOREDIST" + } + ] + } + ], + "command_flags": [ + "write", + "denyoom", + "movablekeys" + ], + "doc_flags": [ + "deprecated" + ] + }, + "GEORADIUSBYMEMBER": { + "summary": "Queries a geospatial index for members within a distance from a member, optionally stores the result.", + "since": "3.2.0", + "group": "geo", + "complexity": "O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.", + "deprecated_since": "6.2.0", + "replaced_by": "`GEOSEARCH` and `GEOSEARCHSTORE` with the `BYRADIUS` and `FROMMEMBER` arguments", + "history": [ + [ + "6.2.0", + "Added the `ANY` option for `COUNT`." + ], + [ + "7.0.0", + "Added support for uppercase unit names." + ] + ], + "acl_categories": [ + "@write", + "@geo", + "@slow" + ], + "arity": -5, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + }, + { + "begin_search": { + "type": "keyword", + "spec": { + "keyword": "STORE", + "startfrom": 5 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "OW": true, + "update": true + }, + { + "begin_search": { + "type": "keyword", + "spec": { + "keyword": "STOREDIST", + "startfrom": 5 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "OW": true, + "update": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "member", + "type": "string", + "display_text": "member" + }, + { + "name": "radius", + "type": "double", + "display_text": "radius" + }, + { + "name": "unit", + "type": "oneof", + "arguments": [ + { + "name": "m", + "type": "pure-token", + "display_text": "m", + "token": "M" + }, + { + "name": "km", + "type": "pure-token", + "display_text": "km", + "token": "KM" + }, + { + "name": "ft", + "type": "pure-token", + "display_text": "ft", + "token": "FT" + }, + { + "name": "mi", + "type": "pure-token", + "display_text": "mi", + "token": "MI" + } + ] + }, + { + "name": "withcoord", + "type": "pure-token", + "display_text": "withcoord", + "token": "WITHCOORD", + "optional": true + }, + { + "name": "withdist", + "type": "pure-token", + "display_text": "withdist", + "token": "WITHDIST", + "optional": true + }, + { + "name": "withhash", + "type": "pure-token", + "display_text": "withhash", + "token": "WITHHASH", + "optional": true + }, + { + "name": "count-block", + "type": "block", + "optional": true, + "arguments": [ + { + "name": "count", + "type": "integer", + "display_text": "count", + "token": "COUNT" + }, + { + "name": "any", + "type": "pure-token", + "display_text": "any", + "token": "ANY", + "optional": true + } + ] + }, + { + "name": "order", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "asc", + "type": "pure-token", + "display_text": "asc", + "token": "ASC" + }, + { + "name": "desc", + "type": "pure-token", + "display_text": "desc", + "token": "DESC" + } + ] + }, + { + "name": "store", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "storekey", + "type": "key", + "display_text": "key", + "key_spec_index": 1, + "token": "STORE" + }, + { + "name": "storedistkey", + "type": "key", + "display_text": "key", + "key_spec_index": 2, + "token": "STOREDIST" + } + ] + } + ], + "command_flags": [ + "write", + "denyoom", + "movablekeys" + ], + "doc_flags": [ + "deprecated" + ] + }, + "GEORADIUSBYMEMBER_RO": { + "summary": "Returns members from a geospatial index that are within a distance from a member.", + "since": "3.2.10", + "group": "geo", + "complexity": "O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.", + "deprecated_since": "6.2.0", + "replaced_by": "`GEOSEARCH` with the `BYRADIUS` and `FROMMEMBER` arguments", + "history": [ + [ + "6.2.0", + "Added the `ANY` option for `COUNT`." + ], + [ + "7.0.0", + "Added support for uppercase unit names." + ] + ], + "acl_categories": [ + "@read", + "@geo", + "@slow" + ], + "arity": -5, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "member", + "type": "string", + "display_text": "member" + }, + { + "name": "radius", + "type": "double", + "display_text": "radius" + }, + { + "name": "unit", + "type": "oneof", + "arguments": [ + { + "name": "m", + "type": "pure-token", + "display_text": "m", + "token": "M" + }, + { + "name": "km", + "type": "pure-token", + "display_text": "km", + "token": "KM" + }, + { + "name": "ft", + "type": "pure-token", + "display_text": "ft", + "token": "FT" + }, + { + "name": "mi", + "type": "pure-token", + "display_text": "mi", + "token": "MI" + } + ] + }, + { + "name": "withcoord", + "type": "pure-token", + "display_text": "withcoord", + "token": "WITHCOORD", + "optional": true + }, + { + "name": "withdist", + "type": "pure-token", + "display_text": "withdist", + "token": "WITHDIST", + "optional": true + }, + { + "name": "withhash", + "type": "pure-token", + "display_text": "withhash", + "token": "WITHHASH", + "optional": true + }, + { + "name": "count-block", + "type": "block", + "optional": true, + "arguments": [ + { + "name": "count", + "type": "integer", + "display_text": "count", + "token": "COUNT" + }, + { + "name": "any", + "type": "pure-token", + "display_text": "any", + "token": "ANY", + "optional": true + } + ] + }, + { + "name": "order", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "asc", + "type": "pure-token", + "display_text": "asc", + "token": "ASC" + }, + { + "name": "desc", + "type": "pure-token", + "display_text": "desc", + "token": "DESC" + } + ] + } + ], + "command_flags": [ + "readonly" + ], + "doc_flags": [ + "deprecated" + ] + }, + "GEORADIUS_RO": { + "summary": "Returns members from a geospatial index that are within a distance from a coordinate.", + "since": "3.2.10", + "group": "geo", + "complexity": "O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.", + "deprecated_since": "6.2.0", + "replaced_by": "`GEOSEARCH` with the `BYRADIUS` argument", + "history": [ + [ + "6.2.0", + "Added the `ANY` option for `COUNT`." + ], + [ + "7.0.0", + "Added support for uppercase unit names." + ] + ], + "acl_categories": [ + "@read", + "@geo", + "@slow" + ], + "arity": -6, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "longitude", + "type": "double", + "display_text": "longitude" + }, + { + "name": "latitude", + "type": "double", + "display_text": "latitude" + }, + { + "name": "radius", + "type": "double", + "display_text": "radius" + }, + { + "name": "unit", + "type": "oneof", + "arguments": [ + { + "name": "m", + "type": "pure-token", + "display_text": "m", + "token": "M" + }, + { + "name": "km", + "type": "pure-token", + "display_text": "km", + "token": "KM" + }, + { + "name": "ft", + "type": "pure-token", + "display_text": "ft", + "token": "FT" + }, + { + "name": "mi", + "type": "pure-token", + "display_text": "mi", + "token": "MI" + } + ] + }, + { + "name": "withcoord", + "type": "pure-token", + "display_text": "withcoord", + "token": "WITHCOORD", + "optional": true + }, + { + "name": "withdist", + "type": "pure-token", + "display_text": "withdist", + "token": "WITHDIST", + "optional": true + }, + { + "name": "withhash", + "type": "pure-token", + "display_text": "withhash", + "token": "WITHHASH", + "optional": true + }, + { + "name": "count-block", + "type": "block", + "optional": true, + "arguments": [ + { + "name": "count", + "type": "integer", + "display_text": "count", + "token": "COUNT" + }, + { + "name": "any", + "type": "pure-token", + "display_text": "any", + "token": "ANY", + "since": "6.2.0", + "optional": true + } + ] }, + { + "name": "order", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "asc", + "type": "pure-token", + "display_text": "asc", + "token": "ASC" + }, + { + "name": "desc", + "type": "pure-token", + "display_text": "desc", + "token": "DESC" + } + ] + } + ], + "command_flags": [ + "readonly" + ], + "doc_flags": [ + "deprecated" + ] + }, + "GEOSEARCH": { + "summary": "Queries a geospatial index for members inside an area of a box or a circle.", + "since": "6.2.0", + "group": "geo", + "complexity": "O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape", + "history": [ + [ + "7.0.0", + "Added support for uppercase unit names." + ] + ], + "acl_categories": [ + "@read", + "@geo", + "@slow" + ], + "arity": -7, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ { "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0, + "key_spec_index": 0 + }, + { + "name": "from", + "type": "oneof", + "arguments": [ + { + "name": "member", + "type": "string", + "display_text": "member", + "token": "FROMMEMBER" + }, + { + "name": "fromlonlat", + "type": "block", + "token": "FROMLONLAT", + "arguments": [ + { + "name": "longitude", + "type": "double", + "display_text": "longitude" + }, + { + "name": "latitude", + "type": "double", + "display_text": "latitude" + } + ] + } + ] + }, + { + "name": "by", + "type": "oneof", + "arguments": [ + { + "name": "circle", + "type": "block", + "arguments": [ + { + "name": "radius", + "type": "double", + "display_text": "radius", + "token": "BYRADIUS" + }, + { + "name": "unit", + "type": "oneof", + "arguments": [ + { + "name": "m", + "type": "pure-token", + "display_text": "m", + "token": "M" + }, + { + "name": "km", + "type": "pure-token", + "display_text": "km", + "token": "KM" + }, + { + "name": "ft", + "type": "pure-token", + "display_text": "ft", + "token": "FT" + }, + { + "name": "mi", + "type": "pure-token", + "display_text": "mi", + "token": "MI" + } + ] + } + ] + }, + { + "name": "box", + "type": "block", + "arguments": [ + { + "name": "width", + "type": "double", + "display_text": "width", + "token": "BYBOX" + }, + { + "name": "height", + "type": "double", + "display_text": "height" + }, + { + "name": "unit", + "type": "oneof", + "arguments": [ + { + "name": "m", + "type": "pure-token", + "display_text": "m", + "token": "M" + }, + { + "name": "km", + "type": "pure-token", + "display_text": "km", + "token": "KM" + }, + { + "name": "ft", + "type": "pure-token", + "display_text": "ft", + "token": "FT" + }, + { + "name": "mi", + "type": "pure-token", + "display_text": "mi", + "token": "MI" + } + ] + } + ] + } + ] + }, + { + "name": "order", + "type": "oneof", "optional": true, - "multiple": true + "arguments": [ + { + "name": "asc", + "type": "pure-token", + "display_text": "asc", + "token": "ASC" + }, + { + "name": "desc", + "type": "pure-token", + "display_text": "desc", + "token": "DESC" + } + ] }, { - "name": "arg", - "type": "string", - "display_text": "arg", + "name": "count-block", + "type": "block", "optional": true, - "multiple": true + "arguments": [ + { + "name": "count", + "type": "integer", + "display_text": "count", + "token": "COUNT" + }, + { + "name": "any", + "type": "pure-token", + "display_text": "any", + "token": "ANY", + "optional": true + } + ] + }, + { + "name": "withcoord", + "type": "pure-token", + "display_text": "withcoord", + "token": "WITHCOORD", + "optional": true + }, + { + "name": "withdist", + "type": "pure-token", + "display_text": "withdist", + "token": "WITHDIST", + "optional": true + }, + { + "name": "withhash", + "type": "pure-token", + "display_text": "withhash", + "token": "WITHHASH", + "optional": true } ], "command_flags": [ - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" + "readonly" ] }, - "EVALSHA": { - "summary": "Executes a server-side Lua script by SHA1 digest.", - "since": "2.6.0", - "group": "scripting", - "complexity": "Depends on the script that is executed.", + "GEOSEARCHSTORE": { + "summary": "Queries a geospatial index for members inside an area of a box or a circle, optionally stores the result.", + "since": "6.2.0", + "group": "geo", + "complexity": "O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape", + "history": [ + [ + "7.0.0", + "Added support for uppercase unit names." + ] + ], "acl_categories": [ - "@slow", - "@scripting" + "@write", + "@geo", + "@slow" ], - "arity": -3, + "arity": -8, "key_specs": [ { "begin_search": { "type": "index", "spec": { - "index": 2 + "index": 1 } }, "find_keys": { - "type": "keynum", + "type": "range", "spec": { - "keynumidx": 0, - "firstkey": 1, - "keystep": 1 + "lastkey": 0, + "keystep": 1, + "limit": 0 } }, - "RW": true, - "access": true, + "OW": true, "update": true + }, + { + "begin_search": { + "type": "index", + "spec": { + "index": 2 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true } ], "arguments": [ { - "name": "sha1", - "type": "string", - "display_text": "sha1" + "name": "destination", + "type": "key", + "display_text": "destination", + "key_spec_index": 0 }, { - "name": "numkeys", - "type": "integer", - "display_text": "numkeys" + "name": "source", + "type": "key", + "display_text": "source", + "key_spec_index": 1 }, { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0, + "name": "from", + "type": "oneof", + "arguments": [ + { + "name": "member", + "type": "string", + "display_text": "member", + "token": "FROMMEMBER" + }, + { + "name": "fromlonlat", + "type": "block", + "token": "FROMLONLAT", + "arguments": [ + { + "name": "longitude", + "type": "double", + "display_text": "longitude" + }, + { + "name": "latitude", + "type": "double", + "display_text": "latitude" + } + ] + } + ] + }, + { + "name": "by", + "type": "oneof", + "arguments": [ + { + "name": "circle", + "type": "block", + "arguments": [ + { + "name": "radius", + "type": "double", + "display_text": "radius", + "token": "BYRADIUS" + }, + { + "name": "unit", + "type": "oneof", + "arguments": [ + { + "name": "m", + "type": "pure-token", + "display_text": "m", + "token": "M" + }, + { + "name": "km", + "type": "pure-token", + "display_text": "km", + "token": "KM" + }, + { + "name": "ft", + "type": "pure-token", + "display_text": "ft", + "token": "FT" + }, + { + "name": "mi", + "type": "pure-token", + "display_text": "mi", + "token": "MI" + } + ] + } + ] + }, + { + "name": "box", + "type": "block", + "arguments": [ + { + "name": "width", + "type": "double", + "display_text": "width", + "token": "BYBOX" + }, + { + "name": "height", + "type": "double", + "display_text": "height" + }, + { + "name": "unit", + "type": "oneof", + "arguments": [ + { + "name": "m", + "type": "pure-token", + "display_text": "m", + "token": "M" + }, + { + "name": "km", + "type": "pure-token", + "display_text": "km", + "token": "KM" + }, + { + "name": "ft", + "type": "pure-token", + "display_text": "ft", + "token": "FT" + }, + { + "name": "mi", + "type": "pure-token", + "display_text": "mi", + "token": "MI" + } + ] + } + ] + } + ] + }, + { + "name": "order", + "type": "oneof", "optional": true, - "multiple": true + "arguments": [ + { + "name": "asc", + "type": "pure-token", + "display_text": "asc", + "token": "ASC" + }, + { + "name": "desc", + "type": "pure-token", + "display_text": "desc", + "token": "DESC" + } + ] }, { - "name": "arg", - "type": "string", - "display_text": "arg", + "name": "count-block", + "type": "block", "optional": true, - "multiple": true + "arguments": [ + { + "name": "count", + "type": "integer", + "display_text": "count", + "token": "COUNT" + }, + { + "name": "any", + "type": "pure-token", + "display_text": "any", + "token": "ANY", + "optional": true + } + ] + }, + { + "name": "storedist", + "type": "pure-token", + "display_text": "storedist", + "token": "STOREDIST", + "optional": true } ], "command_flags": [ - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" + "write", + "denyoom" ] }, - "EVALSHA_RO": { - "summary": "Executes a read-only server-side Lua script by SHA1 digest.", - "since": "7.0.0", - "group": "scripting", - "complexity": "Depends on the script that is executed.", - "acl_categories": [ - "@slow", - "@scripting" + "GET": { + "summary": "Returns the string value of a key.", + "since": "1.0.0", + "group": "string", + "complexity": "O(1)", + "acl_categories": [ + "@read", + "@string", + "@fast" ], - "arity": -3, + "arity": 2, "key_specs": [ { "begin_search": { "type": "index", "spec": { - "index": 2 + "index": 1 } }, "find_keys": { - "type": "keynum", + "type": "range", "spec": { - "keynumidx": 0, - "firstkey": 1, - "keystep": 1 + "lastkey": 0, + "keystep": 1, + "limit": 0 } }, "RO": true, @@ -3985,66 +8062,43 @@ } ], "arguments": [ - { - "name": "sha1", - "type": "string", - "display_text": "sha1" - }, - { - "name": "numkeys", - "type": "integer", - "display_text": "numkeys" - }, { "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0, - "optional": true, - "multiple": true - }, - { - "name": "arg", - "type": "string", - "display_text": "arg", - "optional": true, - "multiple": true + "key_spec_index": 0 } ], "command_flags": [ "readonly", - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" + "fast" ] }, - "EVAL_RO": { - "summary": "Executes a read-only server-side Lua script.", - "since": "7.0.0", - "group": "scripting", - "complexity": "Depends on the script that is executed.", + "GETBIT": { + "summary": "Returns a bit value by offset.", + "since": "2.2.0", + "group": "bitmap", + "complexity": "O(1)", "acl_categories": [ - "@slow", - "@scripting" + "@read", + "@bitmap", + "@fast" ], - "arity": -3, + "arity": 3, "key_specs": [ { - "notes": "We cannot tell how the keys will be used so we assume the worst, RO and ACCESS", "begin_search": { "type": "index", "spec": { - "index": 2 + "index": 1 } }, "find_keys": { - "type": "keynum", + "type": "range", "spec": { - "keynumidx": 0, - "firstkey": 1, - "keystep": 1 + "lastkey": 0, + "keystep": 1, + "limit": 0 } }, "RO": true, @@ -4052,75 +8106,34 @@ } ], "arguments": [ - { - "name": "script", - "type": "string", - "display_text": "script" - }, - { - "name": "numkeys", - "type": "integer", - "display_text": "numkeys" - }, { "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0, - "optional": true, - "multiple": true + "key_spec_index": 0 }, { - "name": "arg", - "type": "string", - "display_text": "arg", - "optional": true, - "multiple": true + "name": "offset", + "type": "integer", + "display_text": "offset" } ], "command_flags": [ "readonly", - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" - ] - }, - "EXEC": { - "summary": "Executes all commands in a transaction.", - "since": "1.2.0", - "group": "transactions", - "complexity": "Depends on commands in the transaction", - "acl_categories": [ - "@slow", - "@transaction" - ], - "arity": 1, - "command_flags": [ - "noscript", - "loading", - "stale", - "skip_slowlog" + "fast" ] }, - "EXISTS": { - "summary": "Determines whether one or more keys exist.", - "since": "1.0.0", - "group": "generic", - "complexity": "O(N) where N is the number of keys to check.", - "history": [ - [ - "3.0.3", - "Accepts multiple `key` arguments." - ] - ], + "GETDEL": { + "summary": "Returns the string value of a key after deleting the key.", + "since": "6.2.0", + "group": "string", + "complexity": "O(1)", "acl_categories": [ - "@keyspace", - "@read", + "@write", + "@string", "@fast" ], - "arity": -2, + "arity": 2, "key_specs": [ { "begin_search": { @@ -4132,12 +8145,14 @@ "find_keys": { "type": "range", "spec": { - "lastkey": -1, + "lastkey": 0, "keystep": 1, "limit": 0 } }, - "RO": true + "RW": true, + "access": true, + "delete": true } ], "arguments": [ @@ -4145,38 +8160,28 @@ "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0, - "multiple": true + "key_spec_index": 0 } ], "command_flags": [ - "readonly", + "write", "fast" - ], - "hints": [ - "request_policy:multi_shard", - "response_policy:agg_sum" ] }, - "EXPIRE": { - "summary": "Sets the expiration time of a key in seconds.", - "since": "1.0.0", - "group": "generic", + "GETEX": { + "summary": "Returns the string value of a key after setting its expiration time.", + "since": "6.2.0", + "group": "string", "complexity": "O(1)", - "history": [ - [ - "7.0.0", - "Added options: `NX`, `XX`, `GT` and `LT`." - ] - ], "acl_categories": [ - "@keyspace", "@write", + "@string", "@fast" ], - "arity": -3, + "arity": -2, "key_specs": [ { + "notes": "RW and UPDATE because it changes the TTL", "begin_search": { "type": "index", "spec": { @@ -4192,6 +8197,7 @@ } }, "RW": true, + "access": true, "update": true } ], @@ -4203,65 +8209,114 @@ "key_spec_index": 0 }, { - "name": "seconds", - "type": "integer", - "display_text": "seconds" - }, - { - "name": "condition", + "name": "expiration", "type": "oneof", - "since": "7.0.0", "optional": true, "arguments": [ { - "name": "nx", - "type": "pure-token", - "display_text": "nx", - "token": "NX" + "name": "seconds", + "type": "integer", + "display_text": "seconds", + "token": "EX" }, { - "name": "xx", - "type": "pure-token", - "display_text": "xx", - "token": "XX" + "name": "milliseconds", + "type": "integer", + "display_text": "milliseconds", + "token": "PX" }, { - "name": "gt", - "type": "pure-token", - "display_text": "gt", - "token": "GT" + "name": "unix-time-seconds", + "type": "unix-time", + "display_text": "unix-time-seconds", + "token": "EXAT" }, { - "name": "lt", + "name": "unix-time-milliseconds", + "type": "unix-time", + "display_text": "unix-time-milliseconds", + "token": "PXAT" + }, + { + "name": "persist", "type": "pure-token", - "display_text": "lt", - "token": "LT" + "display_text": "persist", + "token": "PERSIST" } ] } ], "command_flags": [ - "write", - "fast" + "write", + "fast" + ] + }, + "GETRANGE": { + "summary": "Returns a substring of the string stored at a key.", + "since": "2.4.0", + "group": "string", + "complexity": "O(N) where N is the length of the returned string. The complexity is ultimately determined by the returned length, but because creating a substring from an existing string is very cheap, it can be considered O(1) for small strings.", + "acl_categories": [ + "@read", + "@string", + "@slow" + ], + "arity": 4, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "start", + "type": "integer", + "display_text": "start" + }, + { + "name": "end", + "type": "integer", + "display_text": "end" + } + ], + "command_flags": [ + "readonly" ] }, - "EXPIREAT": { - "summary": "Sets the expiration time of a key to a Unix timestamp.", - "since": "1.2.0", - "group": "generic", + "GETSET": { + "summary": "Returns the previous string value of a key after setting it to a new value.", + "since": "1.0.0", + "group": "string", "complexity": "O(1)", - "history": [ - [ - "7.0.0", - "Added options: `NX`, `XX`, `GT` and `LT`." - ] - ], + "deprecated_since": "6.2.0", + "replaced_by": "`SET` with the `!GET` argument", "acl_categories": [ - "@keyspace", "@write", + "@string", "@fast" ], - "arity": -3, + "arity": 3, "key_specs": [ { "begin_search": { @@ -4279,6 +8334,7 @@ } }, "RW": true, + "access": true, "update": true } ], @@ -4290,59 +8346,37 @@ "key_spec_index": 0 }, { - "name": "unix-time-seconds", - "type": "unix-time", - "display_text": "unix-time-seconds" - }, - { - "name": "condition", - "type": "oneof", - "since": "7.0.0", - "optional": true, - "arguments": [ - { - "name": "nx", - "type": "pure-token", - "display_text": "nx", - "token": "NX" - }, - { - "name": "xx", - "type": "pure-token", - "display_text": "xx", - "token": "XX" - }, - { - "name": "gt", - "type": "pure-token", - "display_text": "gt", - "token": "GT" - }, - { - "name": "lt", - "type": "pure-token", - "display_text": "lt", - "token": "LT" - } - ] + "name": "value", + "type": "string", + "display_text": "value" } ], "command_flags": [ "write", + "denyoom", "fast" + ], + "doc_flags": [ + "deprecated" ] }, - "EXPIRETIME": { - "summary": "Returns the expiration time of a key as a Unix timestamp.", - "since": "7.0.0", - "group": "generic", - "complexity": "O(1)", + "HDEL": { + "summary": "Deletes one or more fields and their values from a hash. Deletes the hash if no fields remain.", + "since": "2.0.0", + "group": "hash", + "complexity": "O(N) where N is the number of fields to be removed.", + "history": [ + [ + "2.4.0", + "Accepts multiple `field` arguments." + ] + ], "acl_categories": [ - "@keyspace", - "@read", + "@write", + "@hash", "@fast" ], - "arity": 2, + "arity": -3, "key_specs": [ { "begin_search": { @@ -4359,8 +8393,8 @@ "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "delete": true } ], "arguments": [ @@ -4369,593 +8403,493 @@ "type": "key", "display_text": "key", "key_spec_index": 0 + }, + { + "name": "field", + "type": "string", + "display_text": "field", + "multiple": true } ], "command_flags": [ - "readonly", + "write", "fast" ] }, - "FAILOVER": { - "summary": "Starts a coordinated failover from a server to one of its replicas.", - "since": "6.2.0", - "group": "server", + "HELLO": { + "summary": "Handshakes with the Redis server.", + "since": "6.0.0", + "group": "connection", "complexity": "O(1)", + "history": [ + [ + "6.2.0", + "`protover` made optional; when called without arguments the command reports the current connection's context." + ] + ], "acl_categories": [ - "@admin", - "@slow", - "@dangerous" + "@fast", + "@connection" ], "arity": -1, "arguments": [ { - "name": "target", + "name": "arguments", "type": "block", - "token": "TO", "optional": true, "arguments": [ { - "name": "host", - "type": "string", - "display_text": "host" + "name": "protover", + "type": "integer", + "display_text": "protover" }, { - "name": "port", - "type": "integer", - "display_text": "port" + "name": "auth", + "type": "block", + "token": "AUTH", + "optional": true, + "arguments": [ + { + "name": "username", + "type": "string", + "display_text": "username" + }, + { + "name": "password", + "type": "string", + "display_text": "password" + } + ] }, { - "name": "force", - "type": "pure-token", - "display_text": "force", - "token": "FORCE", + "name": "clientname", + "type": "string", + "display_text": "clientname", + "token": "SETNAME", "optional": true } ] - }, - { - "name": "abort", - "type": "pure-token", - "display_text": "abort", - "token": "ABORT", - "optional": true - }, - { - "name": "milliseconds", - "type": "integer", - "display_text": "milliseconds", - "token": "TIMEOUT", - "optional": true } ], "command_flags": [ - "admin", "noscript", - "stale" + "loading", + "stale", + "fast", + "no_auth", + "allow_busy" ] }, - "FCALL": { - "summary": "Invokes a function.", - "since": "7.0.0", - "group": "scripting", - "complexity": "Depends on the function that is executed.", + "HEXISTS": { + "summary": "Determines whether a field exists in a hash.", + "since": "2.0.0", + "group": "hash", + "complexity": "O(1)", "acl_categories": [ - "@slow", - "@scripting" + "@read", + "@hash", + "@fast" ], - "arity": -3, + "arity": 3, "key_specs": [ { - "notes": "We cannot tell how the keys will be used so we assume the worst, RW and UPDATE", "begin_search": { "type": "index", "spec": { - "index": 2 + "index": 1 } }, "find_keys": { - "type": "keynum", + "type": "range", "spec": { - "keynumidx": 0, - "firstkey": 1, - "keystep": 1 + "lastkey": 0, + "keystep": 1, + "limit": 0 } }, - "RW": true, - "access": true, - "update": true + "RO": true } ], "arguments": [ - { - "name": "function", - "type": "string", - "display_text": "function" - }, - { - "name": "numkeys", - "type": "integer", - "display_text": "numkeys" - }, { "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0, - "optional": true, - "multiple": true + "key_spec_index": 0 }, { - "name": "arg", + "name": "field", "type": "string", - "display_text": "arg", - "optional": true, - "multiple": true + "display_text": "field" } ], "command_flags": [ - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" + "readonly", + "fast" ] - }, - "FCALL_RO": { - "summary": "Invokes a read-only function.", - "since": "7.0.0", - "group": "scripting", - "complexity": "Depends on the function that is executed.", + }, + "HEXPIRE": { + "summary": "Set expiry for hash field using relative time to expire (seconds)", + "since": "7.4.0", + "group": "hash", + "complexity": "O(N) where N is the number of specified fields", "acl_categories": [ - "@slow", - "@scripting" + "@write", + "@hash", + "@fast" ], - "arity": -3, + "arity": -6, "key_specs": [ { - "notes": "We cannot tell how the keys will be used so we assume the worst, RO and ACCESS", "begin_search": { "type": "index", "spec": { - "index": 2 + "index": 1 } }, "find_keys": { - "type": "keynum", + "type": "range", "spec": { - "keynumidx": 0, - "firstkey": 1, - "keystep": 1 + "lastkey": 0, + "keystep": 1, + "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "update": true } ], "arguments": [ - { - "name": "function", - "type": "string", - "display_text": "function" - }, - { - "name": "numkeys", - "type": "integer", - "display_text": "numkeys" - }, { "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0, - "optional": true, - "multiple": true + "key_spec_index": 0 }, { - "name": "arg", - "type": "string", - "display_text": "arg", - "optional": true, - "multiple": true - } - ], - "command_flags": [ - "readonly", - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" - ] - }, - "FLUSHALL": { - "summary": "Removes all keys from all databases.", - "since": "1.0.0", - "group": "server", - "complexity": "O(N) where N is the total number of keys in all databases", - "history": [ - [ - "4.0.0", - "Added the `ASYNC` flushing mode modifier." - ], - [ - "6.2.0", - "Added the `SYNC` flushing mode modifier." - ] - ], - "acl_categories": [ - "@keyspace", - "@write", - "@slow", - "@dangerous" - ], - "arity": -1, - "arguments": [ + "name": "seconds", + "type": "integer", + "display_text": "seconds" + }, { - "name": "flush-type", + "name": "condition", "type": "oneof", "optional": true, "arguments": [ { - "name": "async", + "name": "nx", "type": "pure-token", - "display_text": "async", - "token": "ASYNC", - "since": "4.0.0" + "display_text": "nx", + "token": "NX" }, { - "name": "sync", + "name": "xx", "type": "pure-token", - "display_text": "sync", - "token": "SYNC", - "since": "6.2.0" + "display_text": "xx", + "token": "XX" + }, + { + "name": "gt", + "type": "pure-token", + "display_text": "gt", + "token": "GT" + }, + { + "name": "lt", + "type": "pure-token", + "display_text": "lt", + "token": "LT" } ] - } - ], - "command_flags": [ - "write" - ], - "hints": [ - "request_policy:all_shards", - "response_policy:all_succeeded" - ] - }, - "FLUSHDB": { - "summary": "Remove all keys from the current database.", - "since": "1.0.0", - "group": "server", - "complexity": "O(N) where N is the number of keys in the selected database", - "history": [ - [ - "4.0.0", - "Added the `ASYNC` flushing mode modifier." - ], - [ - "6.2.0", - "Added the `SYNC` flushing mode modifier." - ] - ], - "acl_categories": [ - "@keyspace", - "@write", - "@slow", - "@dangerous" - ], - "arity": -1, - "arguments": [ + }, { - "name": "flush-type", - "type": "oneof", - "optional": true, + "name": "fields", + "type": "block", + "token": "FIELDS", "arguments": [ { - "name": "async", - "type": "pure-token", - "display_text": "async", - "token": "ASYNC", - "since": "4.0.0" + "name": "numfields", + "type": "integer", + "display_text": "numfields" }, { - "name": "sync", - "type": "pure-token", - "display_text": "sync", - "token": "SYNC", - "since": "6.2.0" + "name": "field", + "type": "string", + "display_text": "field", + "multiple": true } ] } ], "command_flags": [ - "write" - ], - "hints": [ - "request_policy:all_shards", - "response_policy:all_succeeded" + "write", + "fast" ] }, - "FUNCTION": { - "summary": "A container for function commands.", - "since": "7.0.0", - "group": "scripting", - "complexity": "Depends on subcommand.", - "acl_categories": [ - "@slow" - ], - "arity": -2 - }, - "FUNCTION DELETE": { - "summary": "Deletes a library and its functions.", - "since": "7.0.0", - "group": "scripting", - "complexity": "O(1)", + "HEXPIREAT": { + "summary": "Set expiry for hash field using an absolute Unix timestamp (seconds)", + "since": "7.4.0", + "group": "hash", + "complexity": "O(N) where N is the number of specified fields", "acl_categories": [ "@write", - "@slow", - "@scripting" + "@hash", + "@fast" ], - "arity": 3, - "arguments": [ + "arity": -6, + "key_specs": [ { - "name": "library-name", - "type": "string", - "display_text": "library-name" + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "update": true } ], - "command_flags": [ - "write", - "noscript" - ], - "hints": [ - "request_policy:all_shards", - "response_policy:all_succeeded" - ] - }, - "FUNCTION DUMP": { - "summary": "Dumps all libraries into a serialized binary payload.", - "since": "7.0.0", - "group": "scripting", - "complexity": "O(N) where N is the number of functions", - "acl_categories": [ - "@slow", - "@scripting" - ], - "arity": 2, - "command_flags": [ - "noscript" - ] - }, - "FUNCTION FLUSH": { - "summary": "Deletes all libraries and functions.", - "since": "7.0.0", - "group": "scripting", - "complexity": "O(N) where N is the number of functions deleted", - "acl_categories": [ - "@write", - "@slow", - "@scripting" - ], - "arity": -2, "arguments": [ { - "name": "flush-type", + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "unix-time-seconds", + "type": "unix-time", + "display_text": "unix-time-seconds" + }, + { + "name": "condition", "type": "oneof", "optional": true, "arguments": [ { - "name": "async", + "name": "nx", "type": "pure-token", - "display_text": "async", - "token": "ASYNC" + "display_text": "nx", + "token": "NX" }, { - "name": "sync", + "name": "xx", "type": "pure-token", - "display_text": "sync", - "token": "SYNC" + "display_text": "xx", + "token": "XX" + }, + { + "name": "gt", + "type": "pure-token", + "display_text": "gt", + "token": "GT" + }, + { + "name": "lt", + "type": "pure-token", + "display_text": "lt", + "token": "LT" + } + ] + }, + { + "name": "fields", + "type": "block", + "token": "FIELDS", + "arguments": [ + { + "name": "numfields", + "type": "integer", + "display_text": "numfields" + }, + { + "name": "field", + "type": "string", + "display_text": "field", + "multiple": true } ] } ], "command_flags": [ "write", - "noscript" - ], - "hints": [ - "request_policy:all_shards", - "response_policy:all_succeeded" - ] - }, - "FUNCTION HELP": { - "summary": "Returns helpful text about the different subcommands.", - "since": "7.0.0", - "group": "scripting", - "complexity": "O(1)", - "acl_categories": [ - "@slow", - "@scripting" - ], - "arity": 2, - "command_flags": [ - "loading", - "stale" + "fast" ] }, - "FUNCTION KILL": { - "summary": "Terminates a function during execution.", - "since": "7.0.0", - "group": "scripting", - "complexity": "O(1)", + "HEXPIRETIME": { + "summary": "Returns the expiration time of a hash field as a Unix timestamp, in seconds.", + "since": "7.4.0", + "group": "hash", + "complexity": "O(N) where N is the number of specified fields", "acl_categories": [ - "@slow", - "@scripting" - ], - "arity": 2, - "command_flags": [ - "noscript", - "allow_busy" + "@read", + "@hash", + "@fast" ], - "hints": [ - "request_policy:all_shards", - "response_policy:one_succeeded" - ] - }, - "FUNCTION LIST": { - "summary": "Returns information about all libraries.", - "since": "7.0.0", - "group": "scripting", - "complexity": "O(N) where N is the number of functions", - "acl_categories": [ - "@slow", - "@scripting" + "arity": -5, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } ], - "arity": -2, "arguments": [ { - "name": "library-name-pattern", - "type": "string", - "display_text": "library-name-pattern", - "token": "LIBRARYNAME", - "optional": true + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 }, { - "name": "withcode", - "type": "pure-token", - "display_text": "withcode", - "token": "WITHCODE", - "optional": true + "name": "fields", + "type": "block", + "token": "FIELDS", + "arguments": [ + { + "name": "numfields", + "type": "integer", + "display_text": "numfields" + }, + { + "name": "field", + "type": "string", + "display_text": "field", + "multiple": true + } + ] } ], "command_flags": [ - "noscript" - ], - "hints": [ - "nondeterministic_output_order" + "readonly", + "fast" ] }, - "FUNCTION LOAD": { - "summary": "Creates a library.", - "since": "7.0.0", - "group": "scripting", - "complexity": "O(1) (considering compilation time is redundant)", + "HGET": { + "summary": "Returns the value of a field in a hash.", + "since": "2.0.0", + "group": "hash", + "complexity": "O(1)", "acl_categories": [ - "@write", - "@slow", - "@scripting" + "@read", + "@hash", + "@fast" + ], + "arity": 3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } ], - "arity": -3, "arguments": [ { - "name": "replace", - "type": "pure-token", - "display_text": "replace", - "token": "REPLACE", - "optional": true + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 }, { - "name": "function-code", + "name": "field", "type": "string", - "display_text": "function-code" + "display_text": "field" } ], "command_flags": [ - "write", - "denyoom", - "noscript" - ], - "hints": [ - "request_policy:all_shards", - "response_policy:all_succeeded" + "readonly", + "fast" ] }, - "FUNCTION RESTORE": { - "summary": "Restores all libraries from a payload.", - "since": "7.0.0", - "group": "scripting", - "complexity": "O(N) where N is the number of functions on the payload", + "HGETALL": { + "summary": "Returns all fields and values in a hash.", + "since": "2.0.0", + "group": "hash", + "complexity": "O(N) where N is the size of the hash.", "acl_categories": [ - "@write", - "@slow", - "@scripting" + "@read", + "@hash", + "@slow" ], - "arity": -3, - "arguments": [ - { - "name": "serialized-value", - "type": "string", - "display_text": "serialized-value" - }, + "arity": 2, + "key_specs": [ { - "name": "policy", - "type": "oneof", - "optional": true, - "arguments": [ - { - "name": "flush", - "type": "pure-token", - "display_text": "flush", - "token": "FLUSH" - }, - { - "name": "append", - "type": "pure-token", - "display_text": "append", - "token": "APPEND" - }, - { - "name": "replace", - "type": "pure-token", - "display_text": "replace", - "token": "REPLACE" + "begin_search": { + "type": "index", + "spec": { + "index": 1 } - ] + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true } ], - "command_flags": [ - "write", - "denyoom", - "noscript" - ], - "hints": [ - "request_policy:all_shards", - "response_policy:all_succeeded" - ] - }, - "FUNCTION STATS": { - "summary": "Returns information about a function during execution.", - "since": "7.0.0", - "group": "scripting", - "complexity": "O(1)", - "acl_categories": [ - "@slow", - "@scripting" + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + } ], - "arity": 2, "command_flags": [ - "noscript", - "allow_busy" + "readonly" ], "hints": [ - "nondeterministic_output", - "request_policy:all_shards", - "response_policy:special" + "nondeterministic_output_order" ] }, - "GEOADD": { - "summary": "Adds one or more members to a geospatial index. The key is created if it doesn't exist.", - "since": "3.2.0", - "group": "geo", - "complexity": "O(log(N)) for each item added, where N is the number of elements in the sorted set.", - "history": [ - [ - "6.2.0", - "Added the `CH`, `NX` and `XX` options." - ] - ], + "HGETDEL": { + "summary": "Returns the value of a field and deletes it from the hash.", + "since": "8.0.0", + "group": "hash", + "complexity": "O(N) where N is the number of specified fields", "acl_categories": [ "@write", - "@geo", - "@slow" + "@hash", + "@fast" ], "arity": -5, "key_specs": [ @@ -4975,7 +8909,8 @@ } }, "RW": true, - "update": true + "access": true, + "delete": true } ], "arguments": [ @@ -4986,74 +8921,43 @@ "key_spec_index": 0 }, { - "name": "condition", - "type": "oneof", - "since": "6.2.0", - "optional": true, - "arguments": [ - { - "name": "nx", - "type": "pure-token", - "display_text": "nx", - "token": "NX" - }, - { - "name": "xx", - "type": "pure-token", - "display_text": "xx", - "token": "XX" - } - ] - }, - { - "name": "change", - "type": "pure-token", - "display_text": "change", - "token": "CH", - "since": "6.2.0", - "optional": true - }, - { - "name": "data", + "name": "fields", "type": "block", - "multiple": true, + "token": "FIELDS", "arguments": [ { - "name": "longitude", - "type": "double", - "display_text": "longitude" - }, - { - "name": "latitude", - "type": "double", - "display_text": "latitude" + "name": "numfields", + "type": "integer", + "display_text": "numfields" }, { - "name": "member", + "name": "field", "type": "string", - "display_text": "member" + "display_text": "field", + "multiple": true } ] } ], "command_flags": [ "write", - "denyoom" + "fast" ] }, - "GEODIST": { - "summary": "Returns the distance between two members of a geospatial index.", - "since": "3.2.0", - "group": "geo", - "complexity": "O(1)", + "HGETEX": { + "summary": "Get the value of one or more fields of a given hash key, and optionally set their expiration.", + "since": "8.0.0", + "group": "hash", + "complexity": "O(N) where N is the number of specified fields", "acl_categories": [ - "@read", - "@geo", - "@slow" + "@write", + "@hash", + "@fast" ], - "arity": -4, + "arity": -5, "key_specs": [ { + "notes": "RW and UPDATE because it changes the TTL", "begin_search": { "type": "index", "spec": { @@ -5068,8 +8972,9 @@ "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "access": true, + "update": true } ], "arguments": [ @@ -5080,62 +8985,77 @@ "key_spec_index": 0 }, { - "name": "member1", - "type": "string", - "display_text": "member1" - }, - { - "name": "member2", - "type": "string", - "display_text": "member2" - }, - { - "name": "unit", + "name": "expiration", "type": "oneof", "optional": true, "arguments": [ { - "name": "m", - "type": "pure-token", - "display_text": "m", - "token": "M" + "name": "seconds", + "type": "integer", + "display_text": "seconds", + "token": "EX" }, { - "name": "km", - "type": "pure-token", - "display_text": "km", - "token": "KM" + "name": "milliseconds", + "type": "integer", + "display_text": "milliseconds", + "token": "PX" }, { - "name": "ft", - "type": "pure-token", - "display_text": "ft", - "token": "FT" + "name": "unix-time-seconds", + "type": "unix-time", + "display_text": "unix-time-seconds", + "token": "EXAT" }, { - "name": "mi", + "name": "unix-time-milliseconds", + "type": "unix-time", + "display_text": "unix-time-milliseconds", + "token": "PXAT" + }, + { + "name": "persist", "type": "pure-token", - "display_text": "mi", - "token": "MI" + "display_text": "persist", + "token": "PERSIST" + } + ] + }, + { + "name": "fields", + "type": "block", + "token": "FIELDS", + "arguments": [ + { + "name": "numfields", + "type": "integer", + "display_text": "numfields" + }, + { + "name": "field", + "type": "string", + "display_text": "field", + "multiple": true } ] } ], "command_flags": [ - "readonly" + "write", + "fast" ] }, - "GEOHASH": { - "summary": "Returns members from a geospatial index as geohash strings.", - "since": "3.2.0", - "group": "geo", - "complexity": "O(1) for each member requested.", + "HINCRBY": { + "summary": "Increments the integer value of a field in a hash by a number. Uses 0 as initial value if the field doesn't exist.", + "since": "2.0.0", + "group": "hash", + "complexity": "O(1)", "acl_categories": [ - "@read", - "@geo", - "@slow" + "@write", + "@hash", + "@fast" ], - "arity": -2, + "arity": 4, "key_specs": [ { "begin_search": { @@ -5152,8 +9072,9 @@ "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "access": true, + "update": true } ], "arguments": [ @@ -5164,28 +9085,33 @@ "key_spec_index": 0 }, { - "name": "member", + "name": "field", "type": "string", - "display_text": "member", - "optional": true, - "multiple": true + "display_text": "field" + }, + { + "name": "increment", + "type": "integer", + "display_text": "increment" } ], "command_flags": [ - "readonly" + "write", + "denyoom", + "fast" ] }, - "GEOPOS": { - "summary": "Returns the longitude and latitude of members from a geospatial index.", - "since": "3.2.0", - "group": "geo", - "complexity": "O(1) for each member requested.", + "HINCRBYFLOAT": { + "summary": "Increments the floating point value of a field by a number. Uses 0 as initial value if the field doesn't exist.", + "since": "2.6.0", + "group": "hash", + "complexity": "O(1)", "acl_categories": [ - "@read", - "@geo", - "@slow" + "@write", + "@hash", + "@fast" ], - "arity": -2, + "arity": 4, "key_specs": [ { "begin_search": { @@ -5202,8 +9128,9 @@ "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "access": true, + "update": true } ], "arguments": [ @@ -5214,40 +9141,33 @@ "key_spec_index": 0 }, { - "name": "member", + "name": "field", "type": "string", - "display_text": "member", - "optional": true, - "multiple": true + "display_text": "field" + }, + { + "name": "increment", + "type": "double", + "display_text": "increment" } ], "command_flags": [ - "readonly" + "write", + "denyoom", + "fast" ] }, - "GEORADIUS": { - "summary": "Queries a geospatial index for members within a distance from a coordinate, optionally stores the result.", - "since": "3.2.0", - "group": "geo", - "complexity": "O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.", - "deprecated_since": "6.2.0", - "replaced_by": "`GEOSEARCH` and `GEOSEARCHSTORE` with the `BYRADIUS` argument", - "history": [ - [ - "6.2.0", - "Added the `ANY` option for `COUNT`." - ], - [ - "7.0.0", - "Added support for uppercase unit names." - ] - ], + "HKEYS": { + "summary": "Returns all fields in a hash.", + "since": "2.0.0", + "group": "hash", + "complexity": "O(N) where N is the size of the hash.", "acl_categories": [ - "@write", - "@geo", + "@read", + "@hash", "@slow" ], - "arity": -6, + "arity": 2, "key_specs": [ { "begin_search": { @@ -5266,32 +9186,40 @@ }, "RO": true, "access": true - }, + } + ], + "arguments": [ { - "begin_search": { - "type": "keyword", - "spec": { - "keyword": "STORE", - "startfrom": 6 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "OW": true, - "update": true - }, + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + } + ], + "command_flags": [ + "readonly" + ], + "hints": [ + "nondeterministic_output_order" + ] + }, + "HLEN": { + "summary": "Returns the number of fields in a hash.", + "since": "2.0.0", + "group": "hash", + "complexity": "O(1)", + "acl_categories": [ + "@read", + "@hash", + "@fast" + ], + "arity": 2, + "key_specs": [ { "begin_search": { - "type": "keyword", + "type": "index", "spec": { - "keyword": "STOREDIST", - "startfrom": 6 + "index": 1 } }, "find_keys": { @@ -5302,8 +9230,7 @@ "limit": 0 } }, - "OW": true, - "update": true + "RO": true } ], "arguments": [ @@ -5312,167 +9239,24 @@ "type": "key", "display_text": "key", "key_spec_index": 0 - }, - { - "name": "longitude", - "type": "double", - "display_text": "longitude" - }, - { - "name": "latitude", - "type": "double", - "display_text": "latitude" - }, - { - "name": "radius", - "type": "double", - "display_text": "radius" - }, - { - "name": "unit", - "type": "oneof", - "arguments": [ - { - "name": "m", - "type": "pure-token", - "display_text": "m", - "token": "M" - }, - { - "name": "km", - "type": "pure-token", - "display_text": "km", - "token": "KM" - }, - { - "name": "ft", - "type": "pure-token", - "display_text": "ft", - "token": "FT" - }, - { - "name": "mi", - "type": "pure-token", - "display_text": "mi", - "token": "MI" - } - ] - }, - { - "name": "withcoord", - "type": "pure-token", - "display_text": "withcoord", - "token": "WITHCOORD", - "optional": true - }, - { - "name": "withdist", - "type": "pure-token", - "display_text": "withdist", - "token": "WITHDIST", - "optional": true - }, - { - "name": "withhash", - "type": "pure-token", - "display_text": "withhash", - "token": "WITHHASH", - "optional": true - }, - { - "name": "count-block", - "type": "block", - "optional": true, - "arguments": [ - { - "name": "count", - "type": "integer", - "display_text": "count", - "token": "COUNT" - }, - { - "name": "any", - "type": "pure-token", - "display_text": "any", - "token": "ANY", - "since": "6.2.0", - "optional": true - } - ] - }, - { - "name": "order", - "type": "oneof", - "optional": true, - "arguments": [ - { - "name": "asc", - "type": "pure-token", - "display_text": "asc", - "token": "ASC" - }, - { - "name": "desc", - "type": "pure-token", - "display_text": "desc", - "token": "DESC" - } - ] - }, - { - "name": "store", - "type": "oneof", - "optional": true, - "arguments": [ - { - "name": "storekey", - "type": "key", - "display_text": "key", - "key_spec_index": 1, - "token": "STORE" - }, - { - "name": "storedistkey", - "type": "key", - "display_text": "key", - "key_spec_index": 2, - "token": "STOREDIST" - } - ] } ], "command_flags": [ - "write", - "denyoom", - "movablekeys" - ], - "doc_flags": [ - "deprecated" + "readonly", + "fast" ] }, - "GEORADIUSBYMEMBER": { - "summary": "Queries a geospatial index for members within a distance from a member, optionally stores the result.", - "since": "3.2.0", - "group": "geo", - "complexity": "O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.", - "deprecated_since": "6.2.0", - "replaced_by": "`GEOSEARCH` and `GEOSEARCHSTORE` with the `BYRADIUS` and `FROMMEMBER` arguments", - "history": [ - [ - "6.2.0", - "Added the `ANY` option for `COUNT`." - ], - [ - "7.0.0", - "Added support for uppercase unit names." - ] - ], + "HMGET": { + "summary": "Returns the values of all fields in a hash.", + "since": "2.0.0", + "group": "hash", + "complexity": "O(N) where N is the number of fields being requested.", "acl_categories": [ - "@write", - "@geo", - "@slow" + "@read", + "@hash", + "@fast" ], - "arity": -5, + "arity": -3, "key_specs": [ { "begin_search": { @@ -5491,32 +9275,46 @@ }, "RO": true, "access": true - }, + } + ], + "arguments": [ { - "begin_search": { - "type": "keyword", - "spec": { - "keyword": "STORE", - "startfrom": 5 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "OW": true, - "update": true + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 }, + { + "name": "field", + "type": "string", + "display_text": "field", + "multiple": true + } + ], + "command_flags": [ + "readonly", + "fast" + ] + }, + "HMSET": { + "summary": "Sets the values of multiple fields.", + "since": "2.0.0", + "group": "hash", + "complexity": "O(N) where N is the number of fields being set.", + "deprecated_since": "4.0.0", + "replaced_by": "`HSET` with multiple field-value pairs", + "acl_categories": [ + "@write", + "@hash", + "@fast" + ], + "arity": -4, + "key_specs": [ { "begin_search": { - "type": "keyword", + "type": "index", "spec": { - "keyword": "STOREDIST", - "startfrom": 5 + "index": 1 } }, "find_keys": { @@ -5527,7 +9325,7 @@ "limit": 0 } }, - "OW": true, + "RW": true, "update": true } ], @@ -5539,157 +9337,211 @@ "key_spec_index": 0 }, { - "name": "member", - "type": "string", - "display_text": "member" - }, - { - "name": "radius", - "type": "double", - "display_text": "radius" - }, - { - "name": "unit", - "type": "oneof", + "name": "data", + "type": "block", + "multiple": true, "arguments": [ { - "name": "m", - "type": "pure-token", - "display_text": "m", - "token": "M" + "name": "field", + "type": "string", + "display_text": "field" }, { - "name": "km", - "type": "pure-token", - "display_text": "km", - "token": "KM" + "name": "value", + "type": "string", + "display_text": "value" + } + ] + } + ], + "command_flags": [ + "write", + "denyoom", + "fast" + ], + "doc_flags": [ + "deprecated" + ] + }, + "HOTKEYS": { + "summary": "A container for hotkeys tracking commands.", + "since": "8.6.0", + "group": "server", + "complexity": "Depends on subcommand.", + "acl_categories": [ + "@slow" + ], + "arity": -2 + }, + "HOTKEYS GET": { + "summary": "Returns lists of top K hotkeys depending on metrics chosen in HOTKEYS START command.", + "since": "8.6.0", + "group": "server", + "complexity": "O(K) where K is the number of hotkeys returned.", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" + ], + "arity": 2, + "command_flags": [ + "admin", + "noscript" + ], + "hints": [ + "nondeterministic_output", + "request_policy:special", + "response_policy:special" + ] + }, + "HOTKEYS HELP": { + "summary": "Return helpful text about HOTKEYS command parameters.", + "since": "8.6.1", + "group": "server", + "complexity": "O(1)", + "acl_categories": [ + "@slow" + ], + "arity": 2, + "command_flags": [ + "loading", + "stale" + ] + }, + "HOTKEYS RESET": { + "summary": "Release the resources used for hotkey tracking.", + "since": "8.6.0", + "group": "server", + "complexity": "O(1)", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" + ], + "arity": 2, + "command_flags": [ + "admin", + "noscript" + ], + "hints": [ + "request_policy:special" + ] + }, + "HOTKEYS START": { + "summary": "Starts hotkeys tracking.", + "since": "8.6.0", + "group": "server", + "complexity": "O(1)", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" + ], + "arity": -2, + "arguments": [ + { + "name": "metrics", + "type": "block", + "token": "METRICS", + "arguments": [ + { + "name": "count", + "type": "integer", + "display_text": "count" }, { - "name": "ft", + "name": "cpu", "type": "pure-token", - "display_text": "ft", - "token": "FT" + "display_text": "cpu", + "token": "CPU", + "optional": true }, { - "name": "mi", + "name": "net", "type": "pure-token", - "display_text": "mi", - "token": "MI" + "display_text": "net", + "token": "NET", + "optional": true } ] }, { - "name": "withcoord", - "type": "pure-token", - "display_text": "withcoord", - "token": "WITHCOORD", + "name": "k", + "type": "integer", + "display_text": "k", + "token": "COUNT", "optional": true }, { - "name": "withdist", - "type": "pure-token", - "display_text": "withdist", - "token": "WITHDIST", + "name": "seconds", + "type": "integer", + "display_text": "seconds", + "token": "DURATION", "optional": true }, { - "name": "withhash", - "type": "pure-token", - "display_text": "withhash", - "token": "WITHHASH", + "name": "ratio", + "type": "integer", + "display_text": "ratio", + "token": "SAMPLE", "optional": true }, { - "name": "count-block", + "name": "slots", "type": "block", + "token": "SLOTS", "optional": true, "arguments": [ { "name": "count", "type": "integer", - "display_text": "count", - "token": "COUNT" - }, - { - "name": "any", - "type": "pure-token", - "display_text": "any", - "token": "ANY", - "optional": true - } - ] - }, - { - "name": "order", - "type": "oneof", - "optional": true, - "arguments": [ - { - "name": "asc", - "type": "pure-token", - "display_text": "asc", - "token": "ASC" - }, - { - "name": "desc", - "type": "pure-token", - "display_text": "desc", - "token": "DESC" - } - ] - }, - { - "name": "store", - "type": "oneof", - "optional": true, - "arguments": [ - { - "name": "storekey", - "type": "key", - "display_text": "key", - "key_spec_index": 1, - "token": "STORE" - }, - { - "name": "storedistkey", - "type": "key", - "display_text": "key", - "key_spec_index": 2, - "token": "STOREDIST" + "display_text": "count" + }, + { + "name": "slot", + "type": "integer", + "display_text": "slot", + "multiple": true } ] } ], "command_flags": [ - "write", - "denyoom", - "movablekeys" + "admin", + "noscript" ], - "doc_flags": [ - "deprecated" + "hints": [ + "request_policy:special" ] }, - "GEORADIUSBYMEMBER_RO": { - "summary": "Returns members from a geospatial index that are within a distance from a member.", - "since": "3.2.10", - "group": "geo", - "complexity": "O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.", - "deprecated_since": "6.2.0", - "replaced_by": "`GEOSEARCH` with the `BYRADIUS` and `FROMMEMBER` arguments", - "history": [ - [ - "6.2.0", - "Added the `ANY` option for `COUNT`." - ], - [ - "7.0.0", - "Added support for uppercase unit names." - ] + "HOTKEYS STOP": { + "summary": "Stops hotkeys tracking.", + "since": "8.6.0", + "group": "server", + "complexity": "O(1)", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" + ], + "arity": 2, + "command_flags": [ + "admin", + "noscript" ], + "hints": [ + "request_policy:special" + ] + }, + "HPERSIST": { + "summary": "Removes the expiration time for each specified field", + "since": "7.4.0", + "group": "hash", + "complexity": "O(N) where N is the number of specified fields", "acl_categories": [ - "@read", - "@geo", - "@slow" + "@write", + "@hash", + "@fast" ], "arity": -5, "key_specs": [ @@ -5708,8 +9560,8 @@ "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "update": true } ], "arguments": [ @@ -5720,134 +9572,38 @@ "key_spec_index": 0 }, { - "name": "member", - "type": "string", - "display_text": "member" - }, - { - "name": "radius", - "type": "double", - "display_text": "radius" - }, - { - "name": "unit", - "type": "oneof", - "arguments": [ - { - "name": "m", - "type": "pure-token", - "display_text": "m", - "token": "M" - }, - { - "name": "km", - "type": "pure-token", - "display_text": "km", - "token": "KM" - }, - { - "name": "ft", - "type": "pure-token", - "display_text": "ft", - "token": "FT" - }, - { - "name": "mi", - "type": "pure-token", - "display_text": "mi", - "token": "MI" - } - ] - }, - { - "name": "withcoord", - "type": "pure-token", - "display_text": "withcoord", - "token": "WITHCOORD", - "optional": true - }, - { - "name": "withdist", - "type": "pure-token", - "display_text": "withdist", - "token": "WITHDIST", - "optional": true - }, - { - "name": "withhash", - "type": "pure-token", - "display_text": "withhash", - "token": "WITHHASH", - "optional": true - }, - { - "name": "count-block", + "name": "fields", "type": "block", - "optional": true, + "token": "FIELDS", "arguments": [ { - "name": "count", + "name": "numfields", "type": "integer", - "display_text": "count", - "token": "COUNT" - }, - { - "name": "any", - "type": "pure-token", - "display_text": "any", - "token": "ANY", - "optional": true - } - ] - }, - { - "name": "order", - "type": "oneof", - "optional": true, - "arguments": [ - { - "name": "asc", - "type": "pure-token", - "display_text": "asc", - "token": "ASC" + "display_text": "numfields" }, { - "name": "desc", - "type": "pure-token", - "display_text": "desc", - "token": "DESC" + "name": "field", + "type": "string", + "display_text": "field", + "multiple": true } ] } ], "command_flags": [ - "readonly" - ], - "doc_flags": [ - "deprecated" + "write", + "fast" ] }, - "GEORADIUS_RO": { - "summary": "Returns members from a geospatial index that are within a distance from a coordinate.", - "since": "3.2.10", - "group": "geo", - "complexity": "O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.", - "deprecated_since": "6.2.0", - "replaced_by": "`GEOSEARCH` with the `BYRADIUS` argument", - "history": [ - [ - "6.2.0", - "Added the `ANY` option for `COUNT`." - ], - [ - "7.0.0", - "Added support for uppercase unit names." - ] - ], + "HPEXPIRE": { + "summary": "Set expiry for hash field using relative time to expire (milliseconds)", + "since": "7.4.0", + "group": "hash", + "complexity": "O(N) where N is the number of specified fields", "acl_categories": [ - "@read", - "@geo", - "@slow" + "@write", + "@hash", + "@fast" ], "arity": -6, "key_specs": [ @@ -5866,8 +9622,8 @@ "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "update": true } ], "arguments": [ @@ -5878,136 +9634,76 @@ "key_spec_index": 0 }, { - "name": "longitude", - "type": "double", - "display_text": "longitude" - }, - { - "name": "latitude", - "type": "double", - "display_text": "latitude" - }, - { - "name": "radius", - "type": "double", - "display_text": "radius" + "name": "milliseconds", + "type": "integer", + "display_text": "milliseconds" }, { - "name": "unit", + "name": "condition", "type": "oneof", + "optional": true, "arguments": [ { - "name": "m", - "type": "pure-token", - "display_text": "m", - "token": "M" - }, - { - "name": "km", - "type": "pure-token", - "display_text": "km", - "token": "KM" - }, - { - "name": "ft", - "type": "pure-token", - "display_text": "ft", - "token": "FT" - }, - { - "name": "mi", + "name": "nx", "type": "pure-token", - "display_text": "mi", - "token": "MI" - } - ] - }, - { - "name": "withcoord", - "type": "pure-token", - "display_text": "withcoord", - "token": "WITHCOORD", - "optional": true - }, - { - "name": "withdist", - "type": "pure-token", - "display_text": "withdist", - "token": "WITHDIST", - "optional": true - }, - { - "name": "withhash", - "type": "pure-token", - "display_text": "withhash", - "token": "WITHHASH", - "optional": true - }, - { - "name": "count-block", - "type": "block", - "optional": true, - "arguments": [ + "display_text": "nx", + "token": "NX" + }, { - "name": "count", - "type": "integer", - "display_text": "count", - "token": "COUNT" + "name": "xx", + "type": "pure-token", + "display_text": "xx", + "token": "XX" }, { - "name": "any", + "name": "gt", "type": "pure-token", - "display_text": "any", - "token": "ANY", - "since": "6.2.0", - "optional": true + "display_text": "gt", + "token": "GT" + }, + { + "name": "lt", + "type": "pure-token", + "display_text": "lt", + "token": "LT" } ] }, { - "name": "order", - "type": "oneof", - "optional": true, + "name": "fields", + "type": "block", + "token": "FIELDS", "arguments": [ { - "name": "asc", - "type": "pure-token", - "display_text": "asc", - "token": "ASC" + "name": "numfields", + "type": "integer", + "display_text": "numfields" }, { - "name": "desc", - "type": "pure-token", - "display_text": "desc", - "token": "DESC" + "name": "field", + "type": "string", + "display_text": "field", + "multiple": true } ] } ], "command_flags": [ - "readonly" - ], - "doc_flags": [ - "deprecated" + "write", + "fast" ] }, - "GEOSEARCH": { - "summary": "Queries a geospatial index for members inside an area of a box or a circle.", - "since": "6.2.0", - "group": "geo", - "complexity": "O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape", - "history": [ - [ - "7.0.0", - "Added support for uppercase unit names." - ] - ], + "HPEXPIREAT": { + "summary": "Set expiry for hash field using an absolute Unix timestamp (milliseconds)", + "since": "7.4.0", + "group": "hash", + "complexity": "O(N) where N is the number of specified fields", "acl_categories": [ - "@read", - "@geo", - "@slow" + "@write", + "@hash", + "@fast" ], - "arity": -7, + "arity": -6, "key_specs": [ { "begin_search": { @@ -6024,8 +9720,8 @@ "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "update": true } ], "arguments": [ @@ -6036,211 +9732,76 @@ "key_spec_index": 0 }, { - "name": "from", - "type": "oneof", - "arguments": [ - { - "name": "member", - "type": "string", - "display_text": "member", - "token": "FROMMEMBER" - }, - { - "name": "fromlonlat", - "type": "block", - "token": "FROMLONLAT", - "arguments": [ - { - "name": "longitude", - "type": "double", - "display_text": "longitude" - }, - { - "name": "latitude", - "type": "double", - "display_text": "latitude" - } - ] - } - ] + "name": "unix-time-milliseconds", + "type": "unix-time", + "display_text": "unix-time-milliseconds" }, { - "name": "by", + "name": "condition", "type": "oneof", + "optional": true, "arguments": [ { - "name": "circle", - "type": "block", - "arguments": [ - { - "name": "radius", - "type": "double", - "display_text": "radius", - "token": "BYRADIUS" - }, - { - "name": "unit", - "type": "oneof", - "arguments": [ - { - "name": "m", - "type": "pure-token", - "display_text": "m", - "token": "M" - }, - { - "name": "km", - "type": "pure-token", - "display_text": "km", - "token": "KM" - }, - { - "name": "ft", - "type": "pure-token", - "display_text": "ft", - "token": "FT" - }, - { - "name": "mi", - "type": "pure-token", - "display_text": "mi", - "token": "MI" - } - ] - } - ] + "name": "nx", + "type": "pure-token", + "display_text": "nx", + "token": "NX" }, { - "name": "box", - "type": "block", - "arguments": [ - { - "name": "width", - "type": "double", - "display_text": "width", - "token": "BYBOX" - }, - { - "name": "height", - "type": "double", - "display_text": "height" - }, - { - "name": "unit", - "type": "oneof", - "arguments": [ - { - "name": "m", - "type": "pure-token", - "display_text": "m", - "token": "M" - }, - { - "name": "km", - "type": "pure-token", - "display_text": "km", - "token": "KM" - }, - { - "name": "ft", - "type": "pure-token", - "display_text": "ft", - "token": "FT" - }, - { - "name": "mi", - "type": "pure-token", - "display_text": "mi", - "token": "MI" - } - ] - } - ] - } - ] - }, - { - "name": "order", - "type": "oneof", - "optional": true, - "arguments": [ + "name": "xx", + "type": "pure-token", + "display_text": "xx", + "token": "XX" + }, { - "name": "asc", + "name": "gt", "type": "pure-token", - "display_text": "asc", - "token": "ASC" + "display_text": "gt", + "token": "GT" }, { - "name": "desc", + "name": "lt", "type": "pure-token", - "display_text": "desc", - "token": "DESC" + "display_text": "lt", + "token": "LT" } ] }, { - "name": "count-block", + "name": "fields", "type": "block", - "optional": true, + "token": "FIELDS", "arguments": [ { - "name": "count", + "name": "numfields", "type": "integer", - "display_text": "count", - "token": "COUNT" + "display_text": "numfields" }, { - "name": "any", - "type": "pure-token", - "display_text": "any", - "token": "ANY", - "optional": true + "name": "field", + "type": "string", + "display_text": "field", + "multiple": true } ] - }, - { - "name": "withcoord", - "type": "pure-token", - "display_text": "withcoord", - "token": "WITHCOORD", - "optional": true - }, - { - "name": "withdist", - "type": "pure-token", - "display_text": "withdist", - "token": "WITHDIST", - "optional": true - }, - { - "name": "withhash", - "type": "pure-token", - "display_text": "withhash", - "token": "WITHHASH", - "optional": true } ], "command_flags": [ - "readonly" + "write", + "fast" ] }, - "GEOSEARCHSTORE": { - "summary": "Queries a geospatial index for members inside an area of a box or a circle, optionally stores the result.", - "since": "6.2.0", - "group": "geo", - "complexity": "O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape", - "history": [ - [ - "7.0.0", - "Added support for uppercase unit names." - ] - ], + "HPEXPIRETIME": { + "summary": "Returns the expiration time of a hash field as a Unix timestamp, in msec.", + "since": "7.4.0", + "group": "hash", + "complexity": "O(N) where N is the number of specified fields", "acl_categories": [ - "@write", - "@geo", - "@slow" + "@read", + "@hash", + "@fast" ], - "arity": -8, + "arity": -5, "key_specs": [ { "begin_search": { @@ -6257,14 +9818,58 @@ "limit": 0 } }, - "OW": true, - "update": true + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 }, + { + "name": "fields", + "type": "block", + "token": "FIELDS", + "arguments": [ + { + "name": "numfields", + "type": "integer", + "display_text": "numfields" + }, + { + "name": "field", + "type": "string", + "display_text": "field", + "multiple": true + } + ] + } + ], + "command_flags": [ + "readonly", + "fast" + ] + }, + "HPTTL": { + "summary": "Returns the TTL in milliseconds of a hash field.", + "since": "7.4.0", + "group": "hash", + "complexity": "O(N) where N is the number of specified fields", + "acl_categories": [ + "@read", + "@hash", + "@fast" + ], + "arity": -5, + "key_specs": [ { "begin_search": { "type": "index", "spec": { - "index": 2 + "index": 1 } }, "find_keys": { @@ -6281,204 +9886,49 @@ ], "arguments": [ { - "name": "destination", + "name": "key", "type": "key", - "display_text": "destination", + "display_text": "key", "key_spec_index": 0 }, { - "name": "source", - "type": "key", - "display_text": "source", - "key_spec_index": 1 - }, - { - "name": "from", - "type": "oneof", - "arguments": [ - { - "name": "member", - "type": "string", - "display_text": "member", - "token": "FROMMEMBER" - }, - { - "name": "fromlonlat", - "type": "block", - "token": "FROMLONLAT", - "arguments": [ - { - "name": "longitude", - "type": "double", - "display_text": "longitude" - }, - { - "name": "latitude", - "type": "double", - "display_text": "latitude" - } - ] - } - ] - }, - { - "name": "by", - "type": "oneof", - "arguments": [ - { - "name": "circle", - "type": "block", - "arguments": [ - { - "name": "radius", - "type": "double", - "display_text": "radius", - "token": "BYRADIUS" - }, - { - "name": "unit", - "type": "oneof", - "arguments": [ - { - "name": "m", - "type": "pure-token", - "display_text": "m", - "token": "M" - }, - { - "name": "km", - "type": "pure-token", - "display_text": "km", - "token": "KM" - }, - { - "name": "ft", - "type": "pure-token", - "display_text": "ft", - "token": "FT" - }, - { - "name": "mi", - "type": "pure-token", - "display_text": "mi", - "token": "MI" - } - ] - } - ] - }, - { - "name": "box", - "type": "block", - "arguments": [ - { - "name": "width", - "type": "double", - "display_text": "width", - "token": "BYBOX" - }, - { - "name": "height", - "type": "double", - "display_text": "height" - }, - { - "name": "unit", - "type": "oneof", - "arguments": [ - { - "name": "m", - "type": "pure-token", - "display_text": "m", - "token": "M" - }, - { - "name": "km", - "type": "pure-token", - "display_text": "km", - "token": "KM" - }, - { - "name": "ft", - "type": "pure-token", - "display_text": "ft", - "token": "FT" - }, - { - "name": "mi", - "type": "pure-token", - "display_text": "mi", - "token": "MI" - } - ] - } - ] - } - ] - }, - { - "name": "order", - "type": "oneof", - "optional": true, - "arguments": [ - { - "name": "asc", - "type": "pure-token", - "display_text": "asc", - "token": "ASC" - }, - { - "name": "desc", - "type": "pure-token", - "display_text": "desc", - "token": "DESC" - } - ] - }, - { - "name": "count-block", + "name": "fields", "type": "block", - "optional": true, + "token": "FIELDS", "arguments": [ { - "name": "count", + "name": "numfields", "type": "integer", - "display_text": "count", - "token": "COUNT" + "display_text": "numfields" }, { - "name": "any", - "type": "pure-token", - "display_text": "any", - "token": "ANY", - "optional": true + "name": "field", + "type": "string", + "display_text": "field", + "multiple": true } ] - }, - { - "name": "storedist", - "type": "pure-token", - "display_text": "storedist", - "token": "STOREDIST", - "optional": true } ], "command_flags": [ - "write", - "denyoom" + "readonly", + "fast" + ], + "hints": [ + "nondeterministic_output" ] }, - "GET": { - "summary": "Returns the string value of a key.", - "since": "1.0.0", - "group": "string", - "complexity": "O(1)", + "HRANDFIELD": { + "summary": "Returns one or more random fields from a hash.", + "since": "6.2.0", + "group": "hash", + "complexity": "O(N) where N is the number of fields returned", "acl_categories": [ "@read", - "@string", - "@fast" + "@hash", + "@slow" ], - "arity": 2, + "arity": -2, "key_specs": [ { "begin_search": { @@ -6505,24 +9955,45 @@ "type": "key", "display_text": "key", "key_spec_index": 0 + }, + { + "name": "options", + "type": "block", + "optional": true, + "arguments": [ + { + "name": "count", + "type": "integer", + "display_text": "count" + }, + { + "name": "withvalues", + "type": "pure-token", + "display_text": "withvalues", + "token": "WITHVALUES", + "optional": true + } + ] } ], "command_flags": [ - "readonly", - "fast" + "readonly" + ], + "hints": [ + "nondeterministic_output" ] }, - "GETBIT": { - "summary": "Returns a bit value by offset.", - "since": "2.2.0", - "group": "bitmap", - "complexity": "O(1)", + "HSCAN": { + "summary": "Iterates over fields and values of a hash.", + "since": "2.8.0", + "group": "hash", + "complexity": "O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection.", "acl_categories": [ "@read", - "@bitmap", - "@fast" + "@hash", + "@slow" ], - "arity": 3, + "arity": -3, "key_specs": [ { "begin_search": { @@ -6551,27 +10022,56 @@ "key_spec_index": 0 }, { - "name": "offset", + "name": "cursor", "type": "integer", - "display_text": "offset" + "display_text": "cursor" + }, + { + "name": "pattern", + "type": "pattern", + "display_text": "pattern", + "token": "MATCH", + "optional": true + }, + { + "name": "count", + "type": "integer", + "display_text": "count", + "token": "COUNT", + "optional": true + }, + { + "name": "novalues", + "type": "pure-token", + "display_text": "novalues", + "token": "NOVALUES", + "optional": true } ], "command_flags": [ - "readonly", - "fast" + "readonly" + ], + "hints": [ + "nondeterministic_output" ] }, - "GETDEL": { - "summary": "Returns the string value of a key after deleting the key.", - "since": "6.2.0", - "group": "string", - "complexity": "O(1)", + "HSET": { + "summary": "Creates or modifies the value of a field in a hash.", + "since": "2.0.0", + "group": "hash", + "complexity": "O(1) for each field/value pair added, so O(N) to add N field/value pairs when the command is called with multiple field/value pairs.", + "history": [ + [ + "4.0.0", + "Accepts multiple `field` and `value` arguments." + ] + ], "acl_categories": [ "@write", - "@string", + "@hash", "@fast" ], - "arity": 2, + "arity": -4, "key_specs": [ { "begin_search": { @@ -6589,8 +10089,7 @@ } }, "RW": true, - "access": true, - "delete": true + "update": true } ], "arguments": [ @@ -6599,27 +10098,44 @@ "type": "key", "display_text": "key", "key_spec_index": 0 + }, + { + "name": "data", + "type": "block", + "multiple": true, + "arguments": [ + { + "name": "field", + "type": "string", + "display_text": "field" + }, + { + "name": "value", + "type": "string", + "display_text": "value" + } + ] } ], "command_flags": [ "write", + "denyoom", "fast" ] }, - "GETEX": { - "summary": "Returns the string value of a key after setting its expiration time.", - "since": "6.2.0", - "group": "string", - "complexity": "O(1)", + "HSETEX": { + "summary": "Set the value of one or more fields of a given hash key, and optionally set their expiration.", + "since": "8.0.0", + "group": "hash", + "complexity": "O(N) where N is the number of fields being set.", "acl_categories": [ "@write", - "@string", + "@hash", "@fast" ], - "arity": -2, + "arity": -6, "key_specs": [ { - "notes": "RW and UPDATE because it changes the TTL", "begin_search": { "type": "index", "spec": { @@ -6635,7 +10151,6 @@ } }, "RW": true, - "access": true, "update": true } ], @@ -6646,6 +10161,25 @@ "display_text": "key", "key_spec_index": 0 }, + { + "name": "condition", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "fnx", + "type": "pure-token", + "display_text": "fnx", + "token": "FNX" + }, + { + "name": "fxx", + "type": "pure-token", + "display_text": "fxx", + "token": "FXX" + } + ] + }, { "name": "expiration", "type": "oneof", @@ -6675,146 +10209,61 @@ "display_text": "unix-time-milliseconds", "token": "PXAT" }, - { - "name": "persist", - "type": "pure-token", - "display_text": "persist", - "token": "PERSIST" - } - ] - } - ], - "command_flags": [ - "write", - "fast" - ] - }, - "GETRANGE": { - "summary": "Returns a substring of the string stored at a key.", - "since": "2.4.0", - "group": "string", - "complexity": "O(N) where N is the length of the returned string. The complexity is ultimately determined by the returned length, but because creating a substring from an existing string is very cheap, it can be considered O(1) for small strings.", - "acl_categories": [ - "@read", - "@string", - "@slow" - ], - "arity": 4, - "key_specs": [ - { - "begin_search": { - "type": "index", - "spec": { - "index": 1 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "RO": true, - "access": true - } - ], - "arguments": [ - { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 - }, - { - "name": "start", - "type": "integer", - "display_text": "start" - }, - { - "name": "end", - "type": "integer", - "display_text": "end" - } - ], - "command_flags": [ - "readonly" - ] - }, - "GETSET": { - "summary": "Returns the previous string value of a key after setting it to a new value.", - "since": "1.0.0", - "group": "string", - "complexity": "O(1)", - "deprecated_since": "6.2.0", - "replaced_by": "`SET` with the `!GET` argument", - "acl_categories": [ - "@write", - "@string", - "@fast" - ], - "arity": 3, - "key_specs": [ - { - "begin_search": { - "type": "index", - "spec": { - "index": 1 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "RW": true, - "access": true, - "update": true - } - ], - "arguments": [ - { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 + { + "name": "keepttl", + "type": "pure-token", + "display_text": "keepttl", + "token": "KEEPTTL" + } + ] }, { - "name": "value", - "type": "string", - "display_text": "value" + "name": "fields", + "type": "block", + "token": "FIELDS", + "arguments": [ + { + "name": "numfields", + "type": "integer", + "display_text": "numfields" + }, + { + "name": "data", + "type": "block", + "multiple": true, + "arguments": [ + { + "name": "field", + "type": "string", + "display_text": "field" + }, + { + "name": "value", + "type": "string", + "display_text": "value" + } + ] + } + ] } ], "command_flags": [ "write", "denyoom", "fast" - ], - "doc_flags": [ - "deprecated" ] }, - "HDEL": { - "summary": "Deletes one or more fields and their values from a hash. Deletes the hash if no fields remain.", + "HSETNX": { + "summary": "Sets the value of a field in a hash only when the field doesn't exist.", "since": "2.0.0", "group": "hash", - "complexity": "O(N) where N is the number of fields to be removed.", - "history": [ - [ - "2.4.0", - "Accepts multiple `field` arguments." - ] - ], + "complexity": "O(1)", "acl_categories": [ "@write", "@hash", "@fast" ], - "arity": -3, + "arity": 4, "key_specs": [ { "begin_search": { @@ -6832,7 +10281,7 @@ } }, "RW": true, - "delete": true + "insert": true } ], "arguments": [ @@ -6845,82 +10294,23 @@ { "name": "field", "type": "string", - "display_text": "field", - "multiple": true + "display_text": "field" + }, + { + "name": "value", + "type": "string", + "display_text": "value" } ], "command_flags": [ "write", + "denyoom", "fast" ] }, - "HELLO": { - "summary": "Handshakes with the Redis server.", - "since": "6.0.0", - "group": "connection", - "complexity": "O(1)", - "history": [ - [ - "6.2.0", - "`protover` made optional; when called without arguments the command reports the current connection's context." - ] - ], - "acl_categories": [ - "@fast", - "@connection" - ], - "arity": -1, - "arguments": [ - { - "name": "arguments", - "type": "block", - "optional": true, - "arguments": [ - { - "name": "protover", - "type": "integer", - "display_text": "protover" - }, - { - "name": "auth", - "type": "block", - "token": "AUTH", - "optional": true, - "arguments": [ - { - "name": "username", - "type": "string", - "display_text": "username" - }, - { - "name": "password", - "type": "string", - "display_text": "password" - } - ] - }, - { - "name": "clientname", - "type": "string", - "display_text": "clientname", - "token": "SETNAME", - "optional": true - } - ] - } - ], - "command_flags": [ - "noscript", - "loading", - "stale", - "fast", - "no_auth", - "allow_busy" - ] - }, - "HEXISTS": { - "summary": "Determines whether a field exists in a hash.", - "since": "2.0.0", + "HSTRLEN": { + "summary": "Returns the length of the value of a field.", + "since": "3.2.0", "group": "hash", "complexity": "O(1)", "acl_categories": [ @@ -6966,13 +10356,13 @@ "fast" ] }, - "HEXPIRE": { - "summary": "Set expiry for hash field using relative time to expire (seconds)", - "since": "8.0.0", + "HTTL": { + "summary": "Returns the TTL in seconds of a hash field.", + "since": "7.4.0", "group": "hash", - "complexity": "O(N) where N is the number of arguments to the command", + "complexity": "O(N) where N is the number of specified fields", "acl_categories": [ - "@write", + "@read", "@hash", "@fast" ], @@ -6993,8 +10383,8 @@ "limit": 0 } }, - "RW": true, - "update": true + "RO": true, + "access": true } ], "arguments": [ @@ -7005,70 +10395,43 @@ "key_spec_index": 0 }, { - "name": "seconds", - "type": "integer", - "display_text": "seconds" - }, - { - "name": "condition", - "type": "oneof", - "optional": true, + "name": "fields", + "type": "block", + "token": "FIELDS", "arguments": [ { - "name": "nx", - "type": "pure-token", - "display_text": "nx", - "token": "NX" - }, - { - "name": "xx", - "type": "pure-token", - "display_text": "xx", - "token": "XX" - }, - { - "name": "gt", - "type": "pure-token", - "display_text": "gt", - "token": "GT" + "name": "numfields", + "type": "integer", + "display_text": "numfields" }, { - "name": "lt", - "type": "pure-token", - "display_text": "lt", - "token": "LT" + "name": "field", + "type": "string", + "display_text": "field", + "multiple": true } ] - }, - { - "name": "numfields", - "type": "integer", - "display_text": "numfields" - }, - { - "name": "field", - "type": "string", - "display_text": "field", - "multiple": true } ], "command_flags": [ - "write", - "denyoom", + "readonly", "fast" + ], + "hints": [ + "nondeterministic_output" ] }, - "HEXPIREAT": { - "summary": "Set expiry for hash field using an absolute Unix timestamp (seconds)", - "since": "8.0.0", + "HVALS": { + "summary": "Returns all values in a hash.", + "since": "2.0.0", "group": "hash", - "complexity": "O(N) where N is the number of arguments to the command", + "complexity": "O(N) where N is the size of the hash.", "acl_categories": [ - "@write", + "@read", "@hash", - "@fast" + "@slow" ], - "arity": -5, + "arity": 2, "key_specs": [ { "begin_search": { @@ -7085,8 +10448,8 @@ "limit": 0 } }, - "RW": true, - "update": true + "RO": true, + "access": true } ], "arguments": [ @@ -7095,72 +10458,26 @@ "type": "key", "display_text": "key", "key_spec_index": 0 - }, - { - "name": "unix-time-seconds", - "type": "unix-time", - "display_text": "unix-time-seconds" - }, - { - "name": "condition", - "type": "oneof", - "optional": true, - "arguments": [ - { - "name": "nx", - "type": "pure-token", - "display_text": "nx", - "token": "NX" - }, - { - "name": "xx", - "type": "pure-token", - "display_text": "xx", - "token": "XX" - }, - { - "name": "gt", - "type": "pure-token", - "display_text": "gt", - "token": "GT" - }, - { - "name": "lt", - "type": "pure-token", - "display_text": "lt", - "token": "LT" - } - ] - }, - { - "name": "numfields", - "type": "integer", - "display_text": "numfields" - }, - { - "name": "field", - "type": "string", - "display_text": "field", - "multiple": true } ], "command_flags": [ - "write", - "denyoom", - "fast" + "readonly" + ], + "hints": [ + "nondeterministic_output_order" ] }, - "HEXPIRETIME": { - "summary": "Returns the expiration time of a hash field as a Unix timestamp, in seconds.", - "since": "8.0.0", - "group": "hash", - "complexity": "O(N) where N is the number of arguments to the command", + "INCR": { + "summary": "Increments the integer value of a key by one. Uses 0 as initial value if the key doesn't exist.", + "since": "1.0.0", + "group": "string", + "complexity": "O(1)", "acl_categories": [ - "@read", - "@hash", + "@write", + "@string", "@fast" ], - "arity": -4, + "arity": 2, "key_specs": [ { "begin_search": { @@ -7177,8 +10494,9 @@ "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "access": true, + "update": true } ], "arguments": [ @@ -7187,32 +10505,22 @@ "type": "key", "display_text": "key", "key_spec_index": 0 - }, - { - "name": "numfields", - "type": "integer", - "display_text": "numfields" - }, - { - "name": "field", - "type": "string", - "display_text": "field", - "multiple": true } ], "command_flags": [ - "readonly", + "write", + "denyoom", "fast" ] }, - "HGET": { - "summary": "Returns the value of a field in a hash.", - "since": "2.0.0", - "group": "hash", + "INCRBY": { + "summary": "Increments the integer value of a key by a number. Uses 0 as initial value if the key doesn't exist.", + "since": "1.0.0", + "group": "string", "complexity": "O(1)", "acl_categories": [ - "@read", - "@hash", + "@write", + "@string", "@fast" ], "arity": 3, @@ -7232,8 +10540,9 @@ "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "access": true, + "update": true } ], "arguments": [ @@ -7244,27 +10553,28 @@ "key_spec_index": 0 }, { - "name": "field", - "type": "string", - "display_text": "field" + "name": "increment", + "type": "integer", + "display_text": "increment" } ], "command_flags": [ - "readonly", + "write", + "denyoom", "fast" ] }, - "HGETALL": { - "summary": "Returns all fields and values in a hash.", - "since": "2.0.0", - "group": "hash", - "complexity": "O(N) where N is the size of the hash.", + "INCRBYFLOAT": { + "summary": "Increment the floating point value of a key by a number. Uses 0 as initial value if the key doesn't exist.", + "since": "2.6.0", + "group": "string", + "complexity": "O(1)", "acl_categories": [ - "@read", - "@hash", - "@slow" + "@write", + "@string", + "@fast" ], - "arity": 2, + "arity": 3, "key_specs": [ { "begin_search": { @@ -7281,8 +10591,9 @@ "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "access": true, + "update": true } ], "arguments": [ @@ -7291,26 +10602,30 @@ "type": "key", "display_text": "key", "key_spec_index": 0 + }, + { + "name": "increment", + "type": "double", + "display_text": "increment" } ], "command_flags": [ - "readonly" - ], - "hints": [ - "nondeterministic_output_order" + "write", + "denyoom", + "fast" ] }, - "HGETF": { - "summary": "For each specified field, returns its value and optionally set the field's remaining expiration time in seconds / milliseconds", - "since": "8.0.0", - "group": "hash", - "complexity": "O(N) where N is the number of arguments to the command", + "INCREX": { + "summary": "Increments the numeric value of a key by a number and sets its expiration time. Uses 0 as initial value if the key doesn't exist.", + "since": "8.8.0", + "group": "string", + "complexity": "O(1)", "acl_categories": [ "@write", - "@hash", + "@string", "@fast" ], - "arity": -5, + "arity": -2, "key_specs": [ { "begin_search": { @@ -7328,6 +10643,7 @@ } }, "RW": true, + "access": true, "update": true } ], @@ -7339,36 +10655,67 @@ "key_spec_index": 0 }, { - "name": "condition", + "name": "increment", "type": "oneof", "optional": true, "arguments": [ { - "name": "nx", - "type": "pure-token", - "display_text": "nx", - "token": "NX" + "name": "float", + "type": "double", + "display_text": "float", + "token": "BYFLOAT" }, { - "name": "xx", + "name": "integer", + "type": "integer", + "display_text": "integer", + "token": "BYINT" + } + ] + }, + { + "name": "overflow-block", + "type": "oneof", + "token": "OVERFLOW", + "summary": "Out-of-bounds policy; defaults to FAIL. Missing LBOUND/UBOUND default to the type limits (LLONG_MIN/LLONG_MAX for BYINT, -LDBL_MAX/LDBL_MAX for BYFLOAT).", + "optional": true, + "arguments": [ + { + "name": "fail", "type": "pure-token", - "display_text": "xx", - "token": "XX" + "display_text": "fail", + "token": "FAIL" }, { - "name": "gt", + "name": "sat", "type": "pure-token", - "display_text": "gt", - "token": "GT" + "display_text": "sat", + "token": "SAT" }, { - "name": "lt", + "name": "reject", "type": "pure-token", - "display_text": "lt", - "token": "LT" + "display_text": "reject", + "token": "REJECT" } ] }, + { + "name": "lowerbound", + "type": "string", + "display_text": "lowerbound", + "token": "LBOUND", + "summary": "Integer when used with BYINT, floating-point when used with BYFLOAT.", + "optional": true + }, + { + "name": "upperbound", + "type": "string", + "display_text": "upperbound", + "token": "UBOUND", + "summary": "Integer when used with BYINT, floating-point when used with BYFLOAT.", + "optional": true + }, { "name": "expiration", "type": "oneof", @@ -7407,197 +10754,306 @@ ] }, { - "name": "fields", + "name": "enx", + "type": "pure-token", + "display_text": "enx", + "token": "ENX", + "summary": "Only set the expiration if the key currently has no TTL. Requires one of EX/PX/EXAT/PXAT; cannot be combined with PERSIST.", + "optional": true + } + ], + "command_flags": [ + "write", + "denyoom", + "fast" + ] + }, + "INFO": { + "summary": "Returns information and statistics about the server.", + "since": "1.0.0", + "group": "server", + "complexity": "O(1)", + "history": [ + [ + "7.0.0", + "Added support for taking multiple section arguments." + ] + ], + "acl_categories": [ + "@slow", + "@dangerous" + ], + "arity": -1, + "arguments": [ + { + "name": "section", "type": "string", - "display_text": "fields" - }, + "display_text": "section", + "optional": true, + "multiple": true + } + ], + "command_flags": [ + "loading", + "stale" + ], + "hints": [ + "nondeterministic_output", + "request_policy:all_shards", + "response_policy:special" + ] + }, + "KEYS": { + "summary": "Returns all key names that match a pattern.", + "since": "1.0.0", + "group": "generic", + "complexity": "O(N) with N being the number of keys in the database, under the assumption that the key names in the database and the given pattern have limited length.", + "acl_categories": [ + "@keyspace", + "@read", + "@slow", + "@dangerous" + ], + "arity": 2, + "arguments": [ { - "name": "count", - "type": "integer", - "display_text": "count" - }, + "name": "pattern", + "type": "pattern", + "display_text": "pattern" + } + ], + "command_flags": [ + "readonly" + ], + "hints": [ + "request_policy:all_shards", + "nondeterministic_output_order" + ] + }, + "LASTSAVE": { + "summary": "Returns the Unix timestamp of the last successful save to disk.", + "since": "1.0.0", + "group": "server", + "complexity": "O(1)", + "acl_categories": [ + "@admin", + "@fast", + "@dangerous" + ], + "arity": 1, + "command_flags": [ + "loading", + "stale", + "fast" + ], + "hints": [ + "nondeterministic_output" + ] + }, + "LATENCY": { + "summary": "A container for latency diagnostics commands.", + "since": "2.8.13", + "group": "server", + "complexity": "Depends on subcommand.", + "acl_categories": [ + "@slow" + ], + "arity": -2 + }, + "LATENCY DOCTOR": { + "summary": "Returns a human-readable latency analysis report.", + "since": "2.8.13", + "group": "server", + "complexity": "O(1)", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" + ], + "arity": 2, + "command_flags": [ + "admin", + "noscript", + "loading", + "stale" + ], + "hints": [ + "nondeterministic_output", + "request_policy:all_nodes", + "response_policy:special" + ] + }, + "LATENCY GRAPH": { + "summary": "Returns a latency graph for an event.", + "since": "2.8.13", + "group": "server", + "complexity": "O(1)", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" + ], + "arity": 3, + "arguments": [ { - "name": "field", + "name": "event", "type": "string", - "display_text": "field", - "multiple": true + "display_text": "event" } ], "command_flags": [ - "write", - "denyoom", - "fast" + "admin", + "noscript", + "loading", + "stale" + ], + "hints": [ + "nondeterministic_output", + "request_policy:all_nodes", + "response_policy:special" ] }, - "HINCRBY": { - "summary": "Increments the integer value of a field in a hash by a number. Uses 0 as initial value if the field doesn't exist.", - "since": "2.0.0", - "group": "hash", + "LATENCY HELP": { + "summary": "Returns helpful text about the different subcommands.", + "since": "2.8.13", + "group": "server", "complexity": "O(1)", "acl_categories": [ - "@write", - "@hash", - "@fast" + "@slow" ], - "arity": 4, - "key_specs": [ - { - "begin_search": { - "type": "index", - "spec": { - "index": 1 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "RW": true, - "access": true, - "update": true - } + "arity": 2, + "command_flags": [ + "loading", + "stale" + ] + }, + "LATENCY HISTOGRAM": { + "summary": "Returns the cumulative distribution of latencies of a subset or all commands.", + "since": "7.0.0", + "group": "server", + "complexity": "O(N) where N is the number of commands with latency information being retrieved.", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" ], + "arity": -2, "arguments": [ { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 - }, - { - "name": "field", + "name": "command", "type": "string", - "display_text": "field" - }, - { - "name": "increment", - "type": "integer", - "display_text": "increment" + "display_text": "command", + "optional": true, + "multiple": true } ], "command_flags": [ - "write", - "denyoom", - "fast" + "admin", + "noscript", + "loading", + "stale" + ], + "hints": [ + "nondeterministic_output", + "request_policy:all_nodes", + "response_policy:special" ] }, - "HINCRBYFLOAT": { - "summary": "Increments the floating point value of a field by a number. Uses 0 as initial value if the field doesn't exist.", - "since": "2.6.0", - "group": "hash", + "LATENCY HISTORY": { + "summary": "Returns timestamp-latency samples for an event.", + "since": "2.8.13", + "group": "server", "complexity": "O(1)", "acl_categories": [ - "@write", - "@hash", - "@fast" - ], - "arity": 4, - "key_specs": [ - { - "begin_search": { - "type": "index", - "spec": { - "index": 1 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "RW": true, - "access": true, - "update": true - } + "@admin", + "@slow", + "@dangerous" ], + "arity": 3, "arguments": [ { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 - }, - { - "name": "field", + "name": "event", "type": "string", - "display_text": "field" - }, - { - "name": "increment", - "type": "double", - "display_text": "increment" + "display_text": "event" } ], "command_flags": [ - "write", - "denyoom", - "fast" + "admin", + "noscript", + "loading", + "stale" + ], + "hints": [ + "nondeterministic_output", + "request_policy:all_nodes", + "response_policy:special" ] }, - "HKEYS": { - "summary": "Returns all fields in a hash.", - "since": "2.0.0", - "group": "hash", - "complexity": "O(N) where N is the size of the hash.", + "LATENCY LATEST": { + "summary": "Returns the latest latency samples for all events.", + "since": "2.8.13", + "group": "server", + "complexity": "O(1)", "acl_categories": [ - "@read", - "@hash", - "@slow" + "@admin", + "@slow", + "@dangerous" ], "arity": 2, - "key_specs": [ - { - "begin_search": { - "type": "index", - "spec": { - "index": 1 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "RO": true, - "access": true - } + "command_flags": [ + "admin", + "noscript", + "loading", + "stale" + ], + "hints": [ + "nondeterministic_output", + "request_policy:all_nodes", + "response_policy:special" + ] + }, + "LATENCY RESET": { + "summary": "Resets the latency data for one or more events.", + "since": "2.8.13", + "group": "server", + "complexity": "O(1)", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" ], + "arity": -2, "arguments": [ { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 + "name": "event", + "type": "string", + "display_text": "event", + "optional": true, + "multiple": true } ], "command_flags": [ - "readonly" + "admin", + "noscript", + "loading", + "stale" ], "hints": [ - "nondeterministic_output_order" + "request_policy:all_nodes", + "response_policy:agg_sum" ] }, - "HLEN": { - "summary": "Returns the number of fields in a hash.", - "since": "2.0.0", - "group": "hash", - "complexity": "O(1)", + "LCS": { + "summary": "Finds the longest common substring.", + "since": "7.0.0", + "group": "string", + "complexity": "O(N*M) where N and M are the lengths of s1 and s2, respectively", "acl_categories": [ "@read", - "@hash", - "@fast" + "@string", + "@slow" ], - "arity": 2, + "arity": -3, "key_specs": [ { "begin_search": { @@ -7609,38 +11065,72 @@ "find_keys": { "type": "range", "spec": { - "lastkey": 0, + "lastkey": 1, "keystep": 1, "limit": 0 } }, - "RO": true + "RO": true, + "access": true } ], "arguments": [ { - "name": "key", + "name": "key1", "type": "key", - "display_text": "key", + "display_text": "key1", + "key_spec_index": 0 + }, + { + "name": "key2", + "type": "key", + "display_text": "key2", "key_spec_index": 0 + }, + { + "name": "len", + "type": "pure-token", + "display_text": "len", + "token": "LEN", + "optional": true + }, + { + "name": "idx", + "type": "pure-token", + "display_text": "idx", + "token": "IDX", + "optional": true + }, + { + "name": "min-match-len", + "type": "integer", + "display_text": "min-match-len", + "token": "MINMATCHLEN", + "optional": true + }, + { + "name": "withmatchlen", + "type": "pure-token", + "display_text": "withmatchlen", + "token": "WITHMATCHLEN", + "optional": true } ], "command_flags": [ - "readonly", - "fast" + "readonly" ] }, - "HMGET": { - "summary": "Returns the values of all fields in a hash.", - "since": "2.0.0", - "group": "hash", - "complexity": "O(N) where N is the number of fields being requested.", + "LINDEX": { + "summary": "Returns an element from a list by its index.", + "since": "1.0.0", + "group": "list", + "complexity": "O(N) where N is the number of elements to traverse to get to the element at index. This makes asking for the first or the last element of the list O(1).", "acl_categories": [ "@read", - "@hash", - "@fast" + "@list", + "@slow" ], - "arity": -3, + "arity": 3, "key_specs": [ { "begin_search": { @@ -7669,30 +11159,26 @@ "key_spec_index": 0 }, { - "name": "field", - "type": "string", - "display_text": "field", - "multiple": true + "name": "index", + "type": "integer", + "display_text": "index" } ], "command_flags": [ - "readonly", - "fast" + "readonly" ] }, - "HMSET": { - "summary": "Sets the values of multiple fields.", - "since": "2.0.0", - "group": "hash", - "complexity": "O(N) where N is the number of fields being set.", - "deprecated_since": "4.0.0", - "replaced_by": "`HSET` with multiple field-value pairs", + "LINSERT": { + "summary": "Inserts an element before or after another element in a list.", + "since": "2.2.0", + "group": "list", + "complexity": "O(N) where N is the number of elements to traverse before seeing the value pivot. This means that inserting somewhere on the left end on the list (head) can be considered O(1) and inserting somewhere on the right end (tail) is O(N).", "acl_categories": [ "@write", - "@hash", - "@fast" + "@list", + "@slow" ], - "arity": -4, + "arity": 5, "key_specs": [ { "begin_search": { @@ -7710,7 +11196,7 @@ } }, "RW": true, - "update": true + "insert": true } ], "arguments": [ @@ -7721,98 +11207,50 @@ "key_spec_index": 0 }, { - "name": "data", - "type": "block", - "multiple": true, + "name": "where", + "type": "oneof", "arguments": [ { - "name": "field", - "type": "string", - "display_text": "field" + "name": "before", + "type": "pure-token", + "display_text": "before", + "token": "BEFORE" }, { - "name": "value", - "type": "string", - "display_text": "value" + "name": "after", + "type": "pure-token", + "display_text": "after", + "token": "AFTER" } ] - } - ], - "command_flags": [ - "write", - "denyoom", - "fast" - ], - "doc_flags": [ - "deprecated" - ] - }, - "HPERSIST": { - "summary": "Removes the expiration time for each specified field", - "since": "8.0.0", - "group": "hash", - "complexity": "O(N) where N is the number of arguments to the command", - "acl_categories": [ - "@read", - "@hash", - "@fast" - ], - "arity": -4, - "key_specs": [ - { - "begin_search": { - "type": "index", - "spec": { - "index": 1 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "RO": true, - "access": true - } - ], - "arguments": [ - { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 }, { - "name": "numfields", - "type": "integer", - "display_text": "numfields" + "name": "pivot", + "type": "string", + "display_text": "pivot" }, { - "name": "field", + "name": "element", "type": "string", - "display_text": "field", - "multiple": true + "display_text": "element" } ], "command_flags": [ - "readonly", - "fast" + "write", + "denyoom" ] }, - "HPEXPIRE": { - "summary": "Set expiry for hash field using relative time to expire (milliseconds)", - "since": "8.0.0", - "group": "hash", - "complexity": "O(N) where N is the number of arguments to the command", + "LLEN": { + "summary": "Returns the length of a list.", + "since": "1.0.0", + "group": "list", + "complexity": "O(1)", "acl_categories": [ - "@write", - "@hash", + "@read", + "@list", "@fast" ], - "arity": -5, + "arity": 2, "key_specs": [ { "begin_search": { @@ -7829,8 +11267,7 @@ "limit": 0 } }, - "RW": true, - "update": true + "RO": true } ], "arguments": [ @@ -7839,72 +11276,24 @@ "type": "key", "display_text": "key", "key_spec_index": 0 - }, - { - "name": "milliseconds", - "type": "integer", - "display_text": "milliseconds" - }, - { - "name": "condition", - "type": "oneof", - "optional": true, - "arguments": [ - { - "name": "nx", - "type": "pure-token", - "display_text": "nx", - "token": "NX" - }, - { - "name": "xx", - "type": "pure-token", - "display_text": "xx", - "token": "XX" - }, - { - "name": "gt", - "type": "pure-token", - "display_text": "gt", - "token": "GT" - }, - { - "name": "lt", - "type": "pure-token", - "display_text": "lt", - "token": "LT" - } - ] - }, - { - "name": "numfields", - "type": "integer", - "display_text": "numfields" - }, - { - "name": "field", - "type": "string", - "display_text": "field", - "multiple": true } ], "command_flags": [ - "write", - "denyoom", + "readonly", "fast" ] }, - "HPEXPIREAT": { - "summary": "Set expiry for hash field using an absolute Unix timestamp (milliseconds)", - "since": "8.0.0", - "group": "hash", - "complexity": "O(N) where N is the number of arguments to the command", + "LMOVE": { + "summary": "Returns an element after popping it from one list and pushing it to another. Deletes the list if the last element was moved.", + "since": "6.2.0", + "group": "list", + "complexity": "O(1)", "acl_categories": [ "@write", - "@hash", - "@fast" + "@list", + "@slow" ], - "arity": -5, + "arity": 5, "key_specs": [ { "begin_search": { @@ -7922,79 +11311,92 @@ } }, "RW": true, - "update": true + "access": true, + "delete": true + }, + { + "begin_search": { + "type": "index", + "spec": { + "index": 2 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "insert": true } ], "arguments": [ { - "name": "key", + "name": "source", "type": "key", - "display_text": "key", + "display_text": "source", "key_spec_index": 0 }, { - "name": "unix-time-milliseconds", - "type": "unix-time", - "display_text": "unix-time-milliseconds" + "name": "destination", + "type": "key", + "display_text": "destination", + "key_spec_index": 1 }, { - "name": "condition", + "name": "wherefrom", "type": "oneof", - "optional": true, "arguments": [ { - "name": "nx", + "name": "left", "type": "pure-token", - "display_text": "nx", - "token": "NX" + "display_text": "left", + "token": "LEFT" }, { - "name": "xx", + "name": "right", "type": "pure-token", - "display_text": "xx", - "token": "XX" - }, + "display_text": "right", + "token": "RIGHT" + } + ] + }, + { + "name": "whereto", + "type": "oneof", + "arguments": [ { - "name": "gt", + "name": "left", "type": "pure-token", - "display_text": "gt", - "token": "GT" + "display_text": "left", + "token": "LEFT" }, { - "name": "lt", + "name": "right", "type": "pure-token", - "display_text": "lt", - "token": "LT" + "display_text": "right", + "token": "RIGHT" } ] - }, - { - "name": "numfields", - "type": "integer", - "display_text": "numfields" - }, - { - "name": "field", - "type": "string", - "display_text": "field", - "multiple": true } ], "command_flags": [ "write", - "denyoom", - "fast" + "denyoom" ] }, - "HPEXPIRETIME": { - "summary": "Returns the expiration time of a hash field as a Unix timestamp, in msec.", - "since": "8.0.0", - "group": "hash", - "complexity": "O(N) where N is the number of arguments to the command", + "LMPOP": { + "summary": "Returns multiple elements from a list after removing them. Deletes the list if the last element was popped.", + "since": "7.0.0", + "group": "list", + "complexity": "O(N+M) where N is the number of provided keys and M is the number of elements returned.", "acl_categories": [ - "@read", - "@hash", - "@fast" + "@write", + "@list", + "@slow" ], "arity": -4, "key_specs": [ @@ -8006,89 +11408,78 @@ } }, "find_keys": { - "type": "range", + "type": "keynum", "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 + "keynumidx": 0, + "firstkey": 1, + "keystep": 1 } }, - "RO": true, - "access": true + "RW": true, + "access": true, + "delete": true } ], "arguments": [ + { + "name": "numkeys", + "type": "integer", + "display_text": "numkeys" + }, { "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0 + "key_spec_index": 0, + "multiple": true }, { - "name": "numfields", - "type": "integer", - "display_text": "numfields" + "name": "where", + "type": "oneof", + "arguments": [ + { + "name": "left", + "type": "pure-token", + "display_text": "left", + "token": "LEFT" + }, + { + "name": "right", + "type": "pure-token", + "display_text": "right", + "token": "RIGHT" + } + ] }, { - "name": "field", - "type": "string", - "display_text": "field", - "multiple": true + "name": "count", + "type": "integer", + "display_text": "count", + "token": "COUNT", + "optional": true } ], "command_flags": [ - "readonly", - "fast" + "write", + "movablekeys" ] }, - "HPTTL": { - "summary": "Returns the TTL in milliseconds of a hash field.", - "since": "8.0.0", - "group": "hash", - "complexity": "O(N) where N is the number of arguments to the command", + "LOLWUT": { + "summary": "Displays computer art and the Redis version", + "since": "5.0.0", + "group": "server", "acl_categories": [ "@read", - "@hash", "@fast" ], - "arity": -4, - "key_specs": [ - { - "begin_search": { - "type": "index", - "spec": { - "index": 1 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "RO": true, - "access": true - } - ], + "arity": -1, "arguments": [ { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 - }, - { - "name": "numfields", + "name": "version", "type": "integer", - "display_text": "numfields" - }, - { - "name": "field", - "type": "string", - "display_text": "field", - "multiple": true + "display_text": "version", + "token": "VERSION", + "optional": true } ], "command_flags": [ @@ -8096,15 +11487,21 @@ "fast" ] }, - "HRANDFIELD": { - "summary": "Returns one or more random fields from a hash.", - "since": "6.2.0", - "group": "hash", - "complexity": "O(N) where N is the number of fields returned", + "LPOP": { + "summary": "Returns the first elements in a list after removing it. Deletes the list if the last element was popped.", + "since": "1.0.0", + "group": "list", + "complexity": "O(N) where N is the number of elements returned", + "history": [ + [ + "6.2.0", + "Added the `count` argument." + ] + ], "acl_categories": [ - "@read", - "@hash", - "@slow" + "@write", + "@list", + "@fast" ], "arity": -2, "key_specs": [ @@ -8123,8 +11520,9 @@ "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "access": true, + "delete": true } ], "arguments": [ @@ -8135,40 +11533,26 @@ "key_spec_index": 0 }, { - "name": "options", - "type": "block", - "optional": true, - "arguments": [ - { - "name": "count", - "type": "integer", - "display_text": "count" - }, - { - "name": "withvalues", - "type": "pure-token", - "display_text": "withvalues", - "token": "WITHVALUES", - "optional": true - } - ] + "name": "count", + "type": "integer", + "display_text": "count", + "since": "6.2.0", + "optional": true } ], "command_flags": [ - "readonly" - ], - "hints": [ - "nondeterministic_output" + "write", + "fast" ] }, - "HSCAN": { - "summary": "Iterates over fields and values of a hash.", - "since": "2.8.0", - "group": "hash", - "complexity": "O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection.", + "LPOS": { + "summary": "Returns the index of matching elements in a list.", + "since": "6.0.6", + "group": "list", + "complexity": "O(N) where N is the number of elements in the list, for the average case. When searching for elements near the head or the tail of the list, or when the MAXLEN option is provided, the command may run in constant time.", "acl_categories": [ "@read", - "@hash", + "@list", "@slow" ], "arity": -3, @@ -8200,56 +11584,53 @@ "key_spec_index": 0 }, { - "name": "cursor", - "type": "integer", - "display_text": "cursor" + "name": "element", + "type": "string", + "display_text": "element" }, { - "name": "pattern", - "type": "pattern", - "display_text": "pattern", - "token": "MATCH", + "name": "rank", + "type": "integer", + "display_text": "rank", + "token": "RANK", "optional": true }, { - "name": "count", + "name": "num-matches", "type": "integer", - "display_text": "count", + "display_text": "num-matches", "token": "COUNT", "optional": true }, { - "name": "novalues", - "type": "pure-token", - "display_text": "novalues", - "token": "NOVALUES", + "name": "len", + "type": "integer", + "display_text": "len", + "token": "MAXLEN", "optional": true } ], "command_flags": [ "readonly" - ], - "hints": [ - "nondeterministic_output" ] }, - "HSET": { - "summary": "Creates or modifies the value of a field in a hash.", - "since": "2.0.0", - "group": "hash", - "complexity": "O(1) for each field/value pair added, so O(N) to add N field/value pairs when the command is called with multiple field/value pairs.", + "LPUSH": { + "summary": "Prepends one or more elements to a list. Creates the key if it doesn't exist.", + "since": "1.0.0", + "group": "list", + "complexity": "O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.", "history": [ [ - "4.0.0", - "Accepts multiple `field` and `value` arguments." + "2.4.0", + "Accepts multiple `element` arguments." ] ], "acl_categories": [ "@write", - "@hash", + "@list", "@fast" ], - "arity": -4, + "arity": -3, "key_specs": [ { "begin_search": { @@ -8267,7 +11648,7 @@ } }, "RW": true, - "update": true + "insert": true } ], "arguments": [ @@ -8278,21 +11659,10 @@ "key_spec_index": 0 }, { - "name": "data", - "type": "block", - "multiple": true, - "arguments": [ - { - "name": "field", - "type": "string", - "display_text": "field" - }, - { - "name": "value", - "type": "string", - "display_text": "value" - } - ] + "name": "element", + "type": "string", + "display_text": "element", + "multiple": true } ], "command_flags": [ @@ -8301,202 +11671,23 @@ "fast" ] }, - "HSETF": { - "summary": "For each specified field, returns its value and optionally set the field's remaining expiration time in seconds / milliseconds", - "since": "8.0.0", - "group": "hash", - "complexity": "O(N) where N is the number of arguments to the command", - "acl_categories": [ - "@write", - "@hash", - "@fast" - ], - "arity": -6, - "key_specs": [ - { - "begin_search": { - "type": "index", - "spec": { - "index": 1 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "RW": true, - "update": true - } - ], - "arguments": [ - { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 - }, - { - "name": "create key option", - "type": "pure-token", - "display_text": "create key option", - "token": "DC", - "optional": true - }, - { - "name": "create option", - "type": "oneof", - "optional": true, - "arguments": [ - { - "name": "dcf", - "type": "pure-token", - "display_text": "dcf", - "token": "DCF" - }, - { - "name": "dof", - "type": "pure-token", - "display_text": "dof", - "token": "DOF" - } - ] - }, - { - "name": "return option", - "type": "oneof", - "optional": true, - "arguments": [ - { - "name": "getnew", - "type": "pure-token", - "display_text": "getnew", - "token": "GETNEW" - }, - { - "name": "getold", - "type": "pure-token", - "display_text": "getold", - "token": "GETOLD" - } - ] - }, - { - "name": "condition", - "type": "oneof", - "optional": true, - "arguments": [ - { - "name": "nx", - "type": "pure-token", - "display_text": "nx", - "token": "NX" - }, - { - "name": "xx", - "type": "pure-token", - "display_text": "xx", - "token": "XX" - }, - { - "name": "gt", - "type": "pure-token", - "display_text": "gt", - "token": "GT" - }, - { - "name": "lt", - "type": "pure-token", - "display_text": "lt", - "token": "LT" - } - ] - }, - { - "name": "expiration", - "type": "oneof", - "optional": true, - "arguments": [ - { - "name": "seconds", - "type": "integer", - "display_text": "seconds", - "token": "EX" - }, - { - "name": "milliseconds", - "type": "integer", - "display_text": "milliseconds", - "token": "PX" - }, - { - "name": "unix-time-seconds", - "type": "unix-time", - "display_text": "unix-time-seconds", - "token": "EXAT" - }, - { - "name": "unix-time-milliseconds", - "type": "unix-time", - "display_text": "unix-time-milliseconds", - "token": "PXAT" - }, - { - "name": "keepttl", - "type": "pure-token", - "display_text": "keepttl", - "token": "KEEPTTL" - } - ] - }, - { - "name": "fvs", - "type": "string", - "display_text": "fvs" - }, - { - "name": "count", - "type": "integer", - "display_text": "count" - }, - { - "name": "data", - "type": "block", - "multiple": true, - "arguments": [ - { - "name": "field", - "type": "string", - "display_text": "field" - }, - { - "name": "value", - "type": "string", - "display_text": "value" - } - ] - } + "LPUSHX": { + "summary": "Prepends one or more elements to a list only when the list exists.", + "since": "2.2.0", + "group": "list", + "complexity": "O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.", + "history": [ + [ + "4.0.0", + "Accepts multiple `element` arguments." + ] ], - "command_flags": [ - "write", - "denyoom", - "fast" - ] - }, - "HSETNX": { - "summary": "Sets the value of a field in a hash only when the field doesn't exist.", - "since": "2.0.0", - "group": "hash", - "complexity": "O(1)", "acl_categories": [ "@write", - "@hash", + "@list", "@fast" ], - "arity": 4, + "arity": -3, "key_specs": [ { "begin_search": { @@ -8525,14 +11716,10 @@ "key_spec_index": 0 }, { - "name": "field", - "type": "string", - "display_text": "field" - }, - { - "name": "value", + "name": "element", "type": "string", - "display_text": "value" + "display_text": "element", + "multiple": true } ], "command_flags": [ @@ -8541,17 +11728,17 @@ "fast" ] }, - "HSTRLEN": { - "summary": "Returns the length of the value of a field.", - "since": "3.2.0", - "group": "hash", - "complexity": "O(1)", + "LRANGE": { + "summary": "Returns a range of elements from a list.", + "since": "1.0.0", + "group": "list", + "complexity": "O(S+N) where S is the distance of start offset from HEAD for small lists, from nearest end (HEAD or TAIL) for large lists; and N is the number of elements in the specified range.", "acl_categories": [ "@read", - "@hash", - "@fast" + "@list", + "@slow" ], - "arity": 3, + "arity": 4, "key_specs": [ { "begin_search": { @@ -8568,7 +11755,8 @@ "limit": 0 } }, - "RO": true + "RO": true, + "access": true } ], "arguments": [ @@ -8579,27 +11767,31 @@ "key_spec_index": 0 }, { - "name": "field", - "type": "string", - "display_text": "field" + "name": "start", + "type": "integer", + "display_text": "start" + }, + { + "name": "stop", + "type": "integer", + "display_text": "stop" } ], "command_flags": [ - "readonly", - "fast" + "readonly" ] }, - "HTTL": { - "summary": "Returns the TTL in seconds of a hash field.", - "since": "8.0.0", - "group": "hash", - "complexity": "O(N) where N is the number of arguments to the command", + "LREM": { + "summary": "Removes elements from a list. Deletes the list if the last element was removed.", + "since": "1.0.0", + "group": "list", + "complexity": "O(N+M) where N is the length of the list and M is the number of elements removed.", "acl_categories": [ - "@read", - "@hash", - "@fast" + "@write", + "@list", + "@slow" ], - "arity": -4, + "arity": 4, "key_specs": [ { "begin_search": { @@ -8616,8 +11808,8 @@ "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "delete": true } ], "arguments": [ @@ -8628,33 +11820,31 @@ "key_spec_index": 0 }, { - "name": "numfields", + "name": "count", "type": "integer", - "display_text": "numfields" + "display_text": "count" }, { - "name": "field", + "name": "element", "type": "string", - "display_text": "field", - "multiple": true + "display_text": "element" } ], "command_flags": [ - "readonly", - "fast" + "write" ] }, - "HVALS": { - "summary": "Returns all values in a hash.", - "since": "2.0.0", - "group": "hash", - "complexity": "O(N) where N is the size of the hash.", + "LSET": { + "summary": "Sets the value of an element in a list by its index.", + "since": "1.0.0", + "group": "list", + "complexity": "O(N) where N is the length of the list. Setting either the first or the last element of the list is O(1).", "acl_categories": [ - "@read", - "@hash", + "@write", + "@list", "@slow" ], - "arity": 2, + "arity": 4, "key_specs": [ { "begin_search": { @@ -8671,8 +11861,8 @@ "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "update": true } ], "arguments": [ @@ -8681,26 +11871,34 @@ "type": "key", "display_text": "key", "key_spec_index": 0 + }, + { + "name": "index", + "type": "integer", + "display_text": "index" + }, + { + "name": "element", + "type": "string", + "display_text": "element" } ], "command_flags": [ - "readonly" - ], - "hints": [ - "nondeterministic_output_order" + "write", + "denyoom" ] }, - "INCR": { - "summary": "Increments the integer value of a key by one. Uses 0 as initial value if the key doesn't exist.", + "LTRIM": { + "summary": "Removes elements from both ends a list. Deletes the list if all elements were trimmed.", "since": "1.0.0", - "group": "string", - "complexity": "O(1)", + "group": "list", + "complexity": "O(N) where N is the number of elements to be removed by the operation.", "acl_categories": [ "@write", - "@string", - "@fast" + "@list", + "@slow" ], - "arity": 2, + "arity": 4, "key_specs": [ { "begin_search": { @@ -8718,8 +11916,7 @@ } }, "RW": true, - "access": true, - "update": true + "delete": true } ], "arguments": [ @@ -8728,31 +11925,121 @@ "type": "key", "display_text": "key", "key_spec_index": 0 + }, + { + "name": "start", + "type": "integer", + "display_text": "start" + }, + { + "name": "stop", + "type": "integer", + "display_text": "stop" } ], "command_flags": [ - "write", - "denyoom", - "fast" + "write" ] }, - "INCRBY": { - "summary": "Increments the integer value of a key by a number. Uses 0 as initial value if the key doesn't exist.", - "since": "1.0.0", - "group": "string", + "MEMORY": { + "summary": "A container for memory diagnostics commands.", + "since": "4.0.0", + "group": "server", + "complexity": "Depends on subcommand.", + "acl_categories": [ + "@slow" + ], + "arity": -2 + }, + "MEMORY DOCTOR": { + "summary": "Outputs a memory problems report.", + "since": "4.0.0", + "group": "server", "complexity": "O(1)", "acl_categories": [ - "@write", - "@string", - "@fast" + "@slow" ], - "arity": 3, + "arity": 2, + "hints": [ + "nondeterministic_output", + "request_policy:all_shards", + "response_policy:special" + ] + }, + "MEMORY HELP": { + "summary": "Returns helpful text about the different subcommands.", + "since": "4.0.0", + "group": "server", + "complexity": "O(1)", + "acl_categories": [ + "@slow" + ], + "arity": 2, + "command_flags": [ + "loading", + "stale" + ] + }, + "MEMORY MALLOC-STATS": { + "summary": "Returns the allocator statistics.", + "since": "4.0.0", + "group": "server", + "complexity": "Depends on how much memory is allocated, could be slow", + "acl_categories": [ + "@slow" + ], + "arity": 2, + "hints": [ + "nondeterministic_output", + "request_policy:all_shards", + "response_policy:special" + ] + }, + "MEMORY PURGE": { + "summary": "Asks the allocator to release memory.", + "since": "4.0.0", + "group": "server", + "complexity": "Depends on how much memory is allocated, could be slow", + "acl_categories": [ + "@slow" + ], + "arity": 2, + "hints": [ + "request_policy:all_shards", + "response_policy:all_succeeded" + ] + }, + "MEMORY STATS": { + "summary": "Returns details about memory usage.", + "since": "4.0.0", + "group": "server", + "complexity": "O(1)", + "acl_categories": [ + "@slow" + ], + "arity": 2, + "hints": [ + "nondeterministic_output", + "request_policy:all_shards", + "response_policy:special" + ] + }, + "MEMORY USAGE": { + "summary": "Estimates the memory usage of a key.", + "since": "4.0.0", + "group": "server", + "complexity": "O(N) where N is the number of samples.", + "acl_categories": [ + "@read", + "@slow" + ], + "arity": -3, "key_specs": [ { "begin_search": { "type": "index", "spec": { - "index": 1 + "index": 2 } }, "find_keys": { @@ -8763,9 +12050,7 @@ "limit": 0 } }, - "RW": true, - "access": true, - "update": true + "RO": true } ], "arguments": [ @@ -8776,28 +12061,28 @@ "key_spec_index": 0 }, { - "name": "increment", + "name": "count", "type": "integer", - "display_text": "increment" + "display_text": "count", + "token": "SAMPLES", + "optional": true } ], "command_flags": [ - "write", - "denyoom", - "fast" + "readonly" ] }, - "INCRBYFLOAT": { - "summary": "Increment the floating point value of a key by a number. Uses 0 as initial value if the key doesn't exist.", - "since": "2.6.0", + "MGET": { + "summary": "Atomically returns the string values of one or more keys.", + "since": "1.0.0", "group": "string", - "complexity": "O(1)", + "complexity": "O(N) where N is the number of keys to retrieve.", "acl_categories": [ - "@write", + "@read", "@string", "@fast" ], - "arity": 3, + "arity": -2, "key_specs": [ { "begin_search": { @@ -8809,14 +12094,13 @@ "find_keys": { "type": "range", "spec": { - "lastkey": 0, + "lastkey": -1, "keystep": 1, "limit": 0 } }, - "RW": true, - "access": true, - "update": true + "RO": true, + "access": true } ], "arguments": [ @@ -8824,105 +12108,199 @@ "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0 - }, - { - "name": "increment", - "type": "double", - "display_text": "increment" + "key_spec_index": 0, + "multiple": true } ], "command_flags": [ - "write", - "denyoom", + "readonly", "fast" + ], + "hints": [ + "request_policy:multi_shard" ] }, - "INFO": { - "summary": "Returns information and statistics about the server.", - "since": "1.0.0", - "group": "server", - "complexity": "O(1)", + "MIGRATE": { + "summary": "Atomically transfers a key from one Redis instance to another.", + "since": "2.6.0", + "group": "generic", + "complexity": "This command actually executes a DUMP+DEL in the source instance, and a RESTORE in the target instance. See the pages of these commands for time complexity. Also an O(N) data transfer between the two instances is performed.", "history": [ [ - "7.0.0", - "Added support for taking multiple section arguments." + "3.0.0", + "Added the `COPY` and `REPLACE` options." + ], + [ + "3.0.6", + "Added the `KEYS` option." + ], + [ + "4.0.7", + "Added the `AUTH` option." + ], + [ + "6.0.0", + "Added the `AUTH2` option." ] ], "acl_categories": [ + "@keyspace", + "@write", "@slow", "@dangerous" ], - "arity": -1, - "arguments": [ + "arity": -6, + "key_specs": [ { - "name": "section", - "type": "string", - "display_text": "section", - "optional": true, - "multiple": true + "begin_search": { + "type": "index", + "spec": { + "index": 3 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "access": true, + "delete": true + }, + { + "begin_search": { + "type": "keyword", + "spec": { + "keyword": "KEYS", + "startfrom": -2 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": -1, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "access": true, + "delete": true, + "incomplete": true } ], - "command_flags": [ - "loading", - "stale" - ], - "hints": [ - "nondeterministic_output", - "request_policy:all_shards", - "response_policy:special" - ] - }, - "KEYS": { - "summary": "Returns all key names that match a pattern.", - "since": "1.0.0", - "group": "generic", - "complexity": "O(N) with N being the number of keys in the database, under the assumption that the key names in the database and the given pattern have limited length.", - "acl_categories": [ - "@keyspace", - "@read", - "@slow", - "@dangerous" - ], - "arity": 2, "arguments": [ { - "name": "pattern", - "type": "pattern", - "display_text": "pattern" - } - ], - "command_flags": [ - "readonly" - ], - "hints": [ - "request_policy:all_shards", - "nondeterministic_output_order" - ] - }, - "LASTSAVE": { - "summary": "Returns the Unix timestamp of the last successful save to disk.", - "since": "1.0.0", - "group": "server", - "complexity": "O(1)", - "acl_categories": [ - "@admin", - "@fast", - "@dangerous" + "name": "host", + "type": "string", + "display_text": "host" + }, + { + "name": "port", + "type": "integer", + "display_text": "port" + }, + { + "name": "key-selector", + "type": "oneof", + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "empty-string", + "type": "pure-token", + "display_text": "empty-string", + "token": "" + } + ] + }, + { + "name": "destination-db", + "type": "integer", + "display_text": "destination-db" + }, + { + "name": "timeout", + "type": "integer", + "display_text": "timeout" + }, + { + "name": "copy", + "type": "pure-token", + "display_text": "copy", + "token": "COPY", + "since": "3.0.0", + "optional": true + }, + { + "name": "replace", + "type": "pure-token", + "display_text": "replace", + "token": "REPLACE", + "since": "3.0.0", + "optional": true + }, + { + "name": "authentication", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "auth", + "type": "string", + "display_text": "password", + "token": "AUTH", + "since": "4.0.7" + }, + { + "name": "auth2", + "type": "block", + "token": "AUTH2", + "since": "6.0.0", + "arguments": [ + { + "name": "username", + "type": "string", + "display_text": "username" + }, + { + "name": "password", + "type": "string", + "display_text": "password" + } + ] + } + ] + }, + { + "name": "keys", + "type": "key", + "display_text": "key", + "key_spec_index": 1, + "token": "KEYS", + "since": "3.0.6", + "optional": true, + "multiple": true + } ], - "arity": 1, "command_flags": [ - "loading", - "stale", - "fast" + "write", + "movablekeys" ], "hints": [ "nondeterministic_output" ] }, - "LATENCY": { - "summary": "A container for latency diagnostics commands.", - "since": "2.8.13", + "MODULE": { + "summary": "A container for module commands.", + "since": "4.0.0", "group": "server", "complexity": "Depends on subcommand.", "acl_categories": [ @@ -8930,89 +12308,60 @@ ], "arity": -2 }, - "LATENCY DOCTOR": { - "summary": "Returns a human-readable latency analysis report.", - "since": "2.8.13", + "MODULE HELP": { + "summary": "Returns helpful text about the different subcommands.", + "since": "5.0.0", "group": "server", "complexity": "O(1)", "acl_categories": [ - "@admin", - "@slow", - "@dangerous" + "@slow" ], "arity": 2, "command_flags": [ - "admin", - "noscript", "loading", "stale" - ], - "hints": [ - "nondeterministic_output", - "request_policy:all_nodes", - "response_policy:special" ] }, - "LATENCY GRAPH": { - "summary": "Returns a latency graph for an event.", - "since": "2.8.13", + "MODULE LIST": { + "summary": "Returns all loaded modules.", + "since": "4.0.0", "group": "server", - "complexity": "O(1)", + "complexity": "O(N) where N is the number of loaded modules.", "acl_categories": [ "@admin", "@slow", "@dangerous" ], - "arity": 3, - "arguments": [ - { - "name": "event", - "type": "string", - "display_text": "event" - } - ], + "arity": 2, "command_flags": [ "admin", - "noscript", - "loading", - "stale" + "noscript" ], "hints": [ - "nondeterministic_output", - "request_policy:all_nodes", - "response_policy:special" + "nondeterministic_output_order" ] }, - "LATENCY HELP": { - "summary": "Returns helpful text about the different subcommands.", - "since": "2.8.13", + "MODULE LOAD": { + "summary": "Loads a module.", + "since": "4.0.0", "group": "server", "complexity": "O(1)", - "acl_categories": [ - "@slow" - ], - "arity": 2, - "command_flags": [ - "loading", - "stale" - ] - }, - "LATENCY HISTOGRAM": { - "summary": "Returns the cumulative distribution of latencies of a subset or all commands.", - "since": "7.0.0", - "group": "server", - "complexity": "O(N) where N is the number of commands with latency information being retrieved.", "acl_categories": [ "@admin", "@slow", "@dangerous" ], - "arity": -2, + "arity": -3, "arguments": [ { - "name": "command", + "name": "path", "type": "string", - "display_text": "command", + "display_text": "path" + }, + { + "name": "arg", + "type": "string", + "display_text": "arg", "optional": true, "multiple": true } @@ -9020,18 +12369,12 @@ "command_flags": [ "admin", "noscript", - "loading", - "stale" - ], - "hints": [ - "nondeterministic_output", - "request_policy:all_nodes", - "response_policy:special" + "no_async_loading" ] }, - "LATENCY HISTORY": { - "summary": "Returns timestamp-latency samples for an event.", - "since": "2.8.13", + "MODULE LOADEX": { + "summary": "Loads a module using extended parameters.", + "since": "7.0.0", "group": "server", "complexity": "O(1)", "acl_categories": [ @@ -9039,166 +12382,98 @@ "@slow", "@dangerous" ], - "arity": 3, + "arity": -3, "arguments": [ { - "name": "event", + "name": "path", "type": "string", - "display_text": "event" - } - ], - "command_flags": [ - "admin", - "noscript", - "loading", - "stale" - ], - "hints": [ - "nondeterministic_output", - "request_policy:all_nodes", - "response_policy:special" - ] - }, - "LATENCY LATEST": { - "summary": "Returns the latest latency samples for all events.", - "since": "2.8.13", - "group": "server", - "complexity": "O(1)", - "acl_categories": [ - "@admin", - "@slow", - "@dangerous" - ], - "arity": 2, - "command_flags": [ - "admin", - "noscript", - "loading", - "stale" - ], - "hints": [ - "nondeterministic_output", - "request_policy:all_nodes", - "response_policy:special" - ] - }, - "LATENCY RESET": { - "summary": "Resets the latency data for one or more events.", - "since": "2.8.13", - "group": "server", - "complexity": "O(1)", - "acl_categories": [ - "@admin", - "@slow", - "@dangerous" - ], - "arity": -2, - "arguments": [ + "display_text": "path" + }, { - "name": "event", - "type": "string", - "display_text": "event", + "name": "configs", + "type": "block", + "token": "CONFIG", "optional": true, - "multiple": true - } - ], - "command_flags": [ - "admin", - "noscript", - "loading", - "stale" - ], - "hints": [ - "request_policy:all_nodes", - "response_policy:agg_sum" - ] - }, - "LCS": { - "summary": "Finds the longest common substring.", - "since": "7.0.0", - "group": "string", - "complexity": "O(N*M) where N and M are the lengths of s1 and s2, respectively", - "acl_categories": [ - "@read", - "@string", - "@slow" - ], - "arity": -3, - "key_specs": [ - { - "begin_search": { - "type": "index", - "spec": { - "index": 1 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 1, - "keystep": 1, - "limit": 0 + "multiple": true, + "multiple_token": true, + "arguments": [ + { + "name": "name", + "type": "string", + "display_text": "name" + }, + { + "name": "value", + "type": "string", + "display_text": "value" } - }, - "RO": true, - "access": true - } - ], - "arguments": [ - { - "name": "key1", - "type": "key", - "display_text": "key1", - "key_spec_index": 0 - }, - { - "name": "key2", - "type": "key", - "display_text": "key2", - "key_spec_index": 0 - }, - { - "name": "len", - "type": "pure-token", - "display_text": "len", - "token": "LEN", - "optional": true - }, - { - "name": "idx", - "type": "pure-token", - "display_text": "idx", - "token": "IDX", - "optional": true + ] }, { - "name": "min-match-len", - "type": "integer", - "display_text": "min-match-len", - "token": "MINMATCHLEN", - "optional": true - }, + "name": "args", + "type": "string", + "display_text": "args", + "token": "ARGS", + "optional": true, + "multiple": true + } + ], + "command_flags": [ + "admin", + "noscript", + "no_async_loading" + ] + }, + "MODULE UNLOAD": { + "summary": "Unloads a module.", + "since": "4.0.0", + "group": "server", + "complexity": "O(1)", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" + ], + "arity": 3, + "arguments": [ { - "name": "withmatchlen", - "type": "pure-token", - "display_text": "withmatchlen", - "token": "WITHMATCHLEN", - "optional": true + "name": "name", + "type": "string", + "display_text": "name" } ], "command_flags": [ - "readonly" + "admin", + "noscript", + "no_async_loading" ] }, - "LINDEX": { - "summary": "Returns an element from a list by its index.", + "MONITOR": { + "summary": "Listens for all requests received by the server in real-time.", "since": "1.0.0", - "group": "list", - "complexity": "O(N) where N is the number of elements to traverse to get to the element at index. This makes asking for the first or the last element of the list O(1).", + "group": "server", "acl_categories": [ - "@read", - "@list", - "@slow" + "@admin", + "@slow", + "@dangerous" + ], + "arity": 1, + "command_flags": [ + "admin", + "noscript", + "loading", + "stale" + ] + }, + "MOVE": { + "summary": "Moves a key to another database.", + "since": "1.0.0", + "group": "generic", + "complexity": "O(1)", + "acl_categories": [ + "@keyspace", + "@write", + "@fast" ], "arity": 3, "key_specs": [ @@ -9217,8 +12492,9 @@ "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "access": true, + "update": true } ], "arguments": [ @@ -9229,26 +12505,27 @@ "key_spec_index": 0 }, { - "name": "index", + "name": "db", "type": "integer", - "display_text": "index" + "display_text": "db" } ], "command_flags": [ - "readonly" + "write", + "fast" ] }, - "LINSERT": { - "summary": "Inserts an element before or after another element in a list.", - "since": "2.2.0", - "group": "list", - "complexity": "O(N) where N is the number of elements to traverse before seeing the value pivot. This means that inserting somewhere on the left end on the list (head) can be considered O(1) and inserting somewhere on the right end (tail) is O(N).", + "MSET": { + "summary": "Atomically creates or modifies the string values of one or more keys.", + "since": "1.0.1", + "group": "string", + "complexity": "O(N) where N is the number of keys to set.", "acl_categories": [ "@write", - "@list", + "@string", "@slow" ], - "arity": 5, + "arity": -3, "key_specs": [ { "begin_search": { @@ -9260,110 +12537,55 @@ "find_keys": { "type": "range", "spec": { - "lastkey": 0, - "keystep": 1, + "lastkey": -1, + "keystep": 2, "limit": 0 } }, - "RW": true, - "insert": true + "OW": true, + "update": true } ], "arguments": [ { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 - }, - { - "name": "where", - "type": "oneof", + "name": "data", + "type": "block", + "multiple": true, "arguments": [ { - "name": "before", - "type": "pure-token", - "display_text": "before", - "token": "BEFORE" + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 }, { - "name": "after", - "type": "pure-token", - "display_text": "after", - "token": "AFTER" + "name": "value", + "type": "string", + "display_text": "value" } ] - }, - { - "name": "pivot", - "type": "string", - "display_text": "pivot" - }, - { - "name": "element", - "type": "string", - "display_text": "element" } ], "command_flags": [ "write", "denyoom" - ] - }, - "LLEN": { - "summary": "Returns the length of a list.", - "since": "1.0.0", - "group": "list", - "complexity": "O(1)", - "acl_categories": [ - "@read", - "@list", - "@fast" - ], - "arity": 2, - "key_specs": [ - { - "begin_search": { - "type": "index", - "spec": { - "index": 1 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "RO": true - } - ], - "arguments": [ - { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 - } ], - "command_flags": [ - "readonly", - "fast" + "hints": [ + "request_policy:multi_shard", + "response_policy:all_succeeded" ] }, - "LMOVE": { - "summary": "Returns an element after popping it from one list and pushing it to another. Deletes the list if the last element was moved.", - "since": "6.2.0", - "group": "list", - "complexity": "O(1)", + "MSETEX": { + "summary": "Atomically sets multiple string keys with a shared expiration in a single operation. Supports flexible argument parsing where condition and expiration flags can appear in any order.", + "since": "8.4.0", + "group": "string", + "complexity": "O(N) where N is the number of keys to set.", "acl_categories": [ "@write", - "@list", + "@string", "@slow" ], - "arity": 5, + "arity": -4, "key_specs": [ { "begin_search": { @@ -9373,102 +12595,119 @@ } }, "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "RW": true, - "access": true, - "delete": true - }, - { - "begin_search": { - "type": "index", - "spec": { - "index": 2 - } - }, - "find_keys": { - "type": "range", + "type": "keynum", "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 + "keynumidx": 0, + "firstkey": 1, + "keystep": 2 } }, - "RW": true, - "insert": true + "OW": true, + "update": true } ], "arguments": [ { - "name": "source", - "type": "key", - "display_text": "source", - "key_spec_index": 0 + "name": "numkeys", + "type": "integer", + "display_text": "numkeys" }, { - "name": "destination", - "type": "key", - "display_text": "destination", - "key_spec_index": 1 + "name": "data", + "type": "block", + "multiple": true, + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "value", + "type": "string", + "display_text": "value" + } + ] }, { - "name": "wherefrom", + "name": "condition", "type": "oneof", + "optional": true, "arguments": [ { - "name": "left", + "name": "nx", "type": "pure-token", - "display_text": "left", - "token": "LEFT" + "display_text": "nx", + "token": "NX" }, { - "name": "right", + "name": "xx", "type": "pure-token", - "display_text": "right", - "token": "RIGHT" + "display_text": "xx", + "token": "XX" } ] }, { - "name": "whereto", + "name": "expiration", "type": "oneof", + "optional": true, "arguments": [ { - "name": "left", - "type": "pure-token", - "display_text": "left", - "token": "LEFT" + "name": "seconds", + "type": "integer", + "display_text": "seconds", + "token": "EX" }, { - "name": "right", + "name": "milliseconds", + "type": "integer", + "display_text": "milliseconds", + "token": "PX" + }, + { + "name": "unix-time-seconds", + "type": "unix-time", + "display_text": "unix-time-seconds", + "token": "EXAT" + }, + { + "name": "unix-time-milliseconds", + "type": "unix-time", + "display_text": "unix-time-milliseconds", + "token": "PXAT" + }, + { + "name": "keepttl", "type": "pure-token", - "display_text": "right", - "token": "RIGHT" + "display_text": "keepttl", + "token": "KEEPTTL" } ] } ], "command_flags": [ "write", - "denyoom" + "denyoom", + "movablekeys" + ], + "hints": [ + "request_policy:multi_shard", + "response_policy:all_succeeded" ] }, - "LMPOP": { - "summary": "Returns multiple elements from a list after removing them. Deletes the list if the last element was popped.", - "since": "7.0.0", - "group": "list", - "complexity": "O(N+M) where N is the number of provided keys and M is the number of elements returned.", + "MSETNX": { + "summary": "Atomically modifies the string values of one or more keys only when all keys don't exist.", + "since": "1.0.1", + "group": "string", + "complexity": "O(N) where N is the number of keys to set.", "acl_categories": [ "@write", - "@list", + "@string", "@slow" ], - "arity": -4, + "arity": -3, "key_specs": [ { "begin_search": { @@ -9478,108 +12717,132 @@ } }, "find_keys": { - "type": "keynum", + "type": "range", "spec": { - "keynumidx": 0, - "firstkey": 1, - "keystep": 1 + "lastkey": -1, + "keystep": 2, + "limit": 0 } }, - "RW": true, - "access": true, - "delete": true + "OW": true, + "insert": true } ], "arguments": [ { - "name": "numkeys", - "type": "integer", - "display_text": "numkeys" - }, - { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0, - "multiple": true - }, - { - "name": "where", - "type": "oneof", + "name": "data", + "type": "block", + "multiple": true, "arguments": [ { - "name": "left", - "type": "pure-token", - "display_text": "left", - "token": "LEFT" + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 }, { - "name": "right", - "type": "pure-token", - "display_text": "right", - "token": "RIGHT" + "name": "value", + "type": "string", + "display_text": "value" } ] - }, - { - "name": "count", - "type": "integer", - "display_text": "count", - "token": "COUNT", - "optional": true } ], "command_flags": [ "write", - "movablekeys" + "denyoom" ] }, - "LOLWUT": { - "summary": "Displays computer art and the Redis version", - "since": "5.0.0", - "group": "server", + "MULTI": { + "summary": "Starts a transaction.", + "since": "1.2.0", + "group": "transactions", + "complexity": "O(1)", + "acl_categories": [ + "@fast", + "@transaction" + ], + "arity": 1, + "command_flags": [ + "noscript", + "loading", + "stale", + "fast", + "allow_busy" + ] + }, + "OBJECT": { + "summary": "A container for object introspection commands.", + "since": "2.2.3", + "group": "generic", + "complexity": "Depends on subcommand.", + "acl_categories": [ + "@slow" + ], + "arity": -2 + }, + "OBJECT ENCODING": { + "summary": "Returns the internal encoding of a Redis object.", + "since": "2.2.3", + "group": "generic", + "complexity": "O(1)", "acl_categories": [ + "@keyspace", "@read", - "@fast" + "@slow" + ], + "arity": 3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 2 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true + } ], - "arity": -1, "arguments": [ { - "name": "version", - "type": "integer", - "display_text": "version", - "token": "VERSION", - "optional": true + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 } ], "command_flags": [ - "readonly", - "fast" + "readonly" + ], + "hints": [ + "nondeterministic_output" ] }, - "LPOP": { - "summary": "Returns the first elements in a list after removing it. Deletes the list if the last element was popped.", - "since": "1.0.0", - "group": "list", - "complexity": "O(N) where N is the number of elements returned", - "history": [ - [ - "6.2.0", - "Added the `count` argument." - ] - ], + "OBJECT FREQ": { + "summary": "Returns the logarithmic access frequency counter of a Redis object.", + "since": "4.0.0", + "group": "generic", + "complexity": "O(1)", "acl_categories": [ - "@write", - "@list", - "@fast" + "@keyspace", + "@read", + "@slow" ], - "arity": -2, + "arity": 3, "key_specs": [ { "begin_search": { "type": "index", "spec": { - "index": 1 + "index": 2 } }, "find_keys": { @@ -9590,9 +12853,7 @@ "limit": 0 } }, - "RW": true, - "access": true, - "delete": true + "RO": true } ], "arguments": [ @@ -9601,37 +12862,47 @@ "type": "key", "display_text": "key", "key_spec_index": 0 - }, - { - "name": "count", - "type": "integer", - "display_text": "count", - "since": "6.2.0", - "optional": true } ], "command_flags": [ - "write", - "fast" + "readonly" + ], + "hints": [ + "nondeterministic_output" ] }, - "LPOS": { - "summary": "Returns the index of matching elements in a list.", - "since": "6.0.6", - "group": "list", - "complexity": "O(N) where N is the number of elements in the list, for the average case. When searching for elements near the head or the tail of the list, or when the MAXLEN option is provided, the command may run in constant time.", + "OBJECT HELP": { + "summary": "Returns helpful text about the different subcommands.", + "since": "6.2.0", + "group": "generic", + "complexity": "O(1)", + "acl_categories": [ + "@keyspace", + "@slow" + ], + "arity": 2, + "command_flags": [ + "loading", + "stale" + ] + }, + "OBJECT IDLETIME": { + "summary": "Returns the time since the last access to a Redis object.", + "since": "2.2.3", + "group": "generic", + "complexity": "O(1)", "acl_categories": [ + "@keyspace", "@read", - "@list", "@slow" ], - "arity": -3, + "arity": 3, "key_specs": [ { "begin_search": { "type": "index", "spec": { - "index": 1 + "index": 2 } }, "find_keys": { @@ -9642,8 +12913,7 @@ "limit": 0 } }, - "RO": true, - "access": true + "RO": true } ], "arguments": [ @@ -9652,61 +12922,32 @@ "type": "key", "display_text": "key", "key_spec_index": 0 - }, - { - "name": "element", - "type": "string", - "display_text": "element" - }, - { - "name": "rank", - "type": "integer", - "display_text": "rank", - "token": "RANK", - "optional": true - }, - { - "name": "num-matches", - "type": "integer", - "display_text": "num-matches", - "token": "COUNT", - "optional": true - }, - { - "name": "len", - "type": "integer", - "display_text": "len", - "token": "MAXLEN", - "optional": true } ], "command_flags": [ "readonly" + ], + "hints": [ + "nondeterministic_output" ] }, - "LPUSH": { - "summary": "Prepends one or more elements to a list. Creates the key if it doesn't exist.", - "since": "1.0.0", - "group": "list", - "complexity": "O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.", - "history": [ - [ - "2.4.0", - "Accepts multiple `element` arguments." - ] - ], + "OBJECT REFCOUNT": { + "summary": "Returns the reference count of a value of a key.", + "since": "2.2.3", + "group": "generic", + "complexity": "O(1)", "acl_categories": [ - "@write", - "@list", - "@fast" + "@keyspace", + "@read", + "@slow" ], - "arity": -3, + "arity": 3, "key_specs": [ { "begin_search": { "type": "index", "spec": { - "index": 1 + "index": 2 } }, "find_keys": { @@ -9717,8 +12958,7 @@ "limit": 0 } }, - "RW": true, - "insert": true + "RO": true } ], "arguments": [ @@ -9727,37 +12967,26 @@ "type": "key", "display_text": "key", "key_spec_index": 0 - }, - { - "name": "element", - "type": "string", - "display_text": "element", - "multiple": true } ], "command_flags": [ - "write", - "denyoom", - "fast" + "readonly" + ], + "hints": [ + "nondeterministic_output" ] }, - "LPUSHX": { - "summary": "Prepends one or more elements to a list only when the list exists.", + "PERSIST": { + "summary": "Removes the expiration time of a key.", "since": "2.2.0", - "group": "list", - "complexity": "O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.", - "history": [ - [ - "4.0.0", - "Accepts multiple `element` arguments." - ] - ], + "group": "generic", + "complexity": "O(1)", "acl_categories": [ + "@keyspace", "@write", - "@list", "@fast" ], - "arity": -3, + "arity": 2, "key_specs": [ { "begin_search": { @@ -9775,7 +13004,7 @@ } }, "RW": true, - "insert": true + "update": true } ], "arguments": [ @@ -9784,31 +13013,30 @@ "type": "key", "display_text": "key", "key_spec_index": 0 - }, - { - "name": "element", - "type": "string", - "display_text": "element", - "multiple": true } ], "command_flags": [ "write", - "denyoom", "fast" ] }, - "LRANGE": { - "summary": "Returns a range of elements from a list.", - "since": "1.0.0", - "group": "list", - "complexity": "O(S+N) where S is the distance of start offset from HEAD for small lists, from nearest end (HEAD or TAIL) for large lists; and N is the number of elements in the specified range.", + "PEXPIRE": { + "summary": "Sets the expiration time of a key in milliseconds.", + "since": "2.6.0", + "group": "generic", + "complexity": "O(1)", + "history": [ + [ + "7.0.0", + "Added options: `NX`, `XX`, `GT` and `LT`." + ] + ], "acl_categories": [ - "@read", - "@list", - "@slow" + "@keyspace", + "@write", + "@fast" ], - "arity": 4, + "arity": -3, "key_specs": [ { "begin_search": { @@ -9825,8 +13053,8 @@ "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "update": true } ], "arguments": [ @@ -9837,31 +13065,65 @@ "key_spec_index": 0 }, { - "name": "start", + "name": "milliseconds", "type": "integer", - "display_text": "start" + "display_text": "milliseconds" }, { - "name": "stop", - "type": "integer", - "display_text": "stop" + "name": "condition", + "type": "oneof", + "since": "7.0.0", + "optional": true, + "arguments": [ + { + "name": "nx", + "type": "pure-token", + "display_text": "nx", + "token": "NX" + }, + { + "name": "xx", + "type": "pure-token", + "display_text": "xx", + "token": "XX" + }, + { + "name": "gt", + "type": "pure-token", + "display_text": "gt", + "token": "GT" + }, + { + "name": "lt", + "type": "pure-token", + "display_text": "lt", + "token": "LT" + } + ] } ], "command_flags": [ - "readonly" + "write", + "fast" ] }, - "LREM": { - "summary": "Removes elements from a list. Deletes the list if the last element was removed.", - "since": "1.0.0", - "group": "list", - "complexity": "O(N+M) where N is the length of the list and M is the number of elements removed.", + "PEXPIREAT": { + "summary": "Sets the expiration time of a key to a Unix milliseconds timestamp.", + "since": "2.6.0", + "group": "generic", + "complexity": "O(1)", + "history": [ + [ + "7.0.0", + "Added options: `NX`, `XX`, `GT` and `LT`." + ] + ], "acl_categories": [ + "@keyspace", "@write", - "@list", - "@slow" + "@fast" ], - "arity": 4, + "arity": -3, "key_specs": [ { "begin_search": { @@ -9879,7 +13141,7 @@ } }, "RW": true, - "delete": true + "update": true } ], "arguments": [ @@ -9890,31 +13152,59 @@ "key_spec_index": 0 }, { - "name": "count", - "type": "integer", - "display_text": "count" + "name": "unix-time-milliseconds", + "type": "unix-time", + "display_text": "unix-time-milliseconds" }, { - "name": "element", - "type": "string", - "display_text": "element" + "name": "condition", + "type": "oneof", + "since": "7.0.0", + "optional": true, + "arguments": [ + { + "name": "nx", + "type": "pure-token", + "display_text": "nx", + "token": "NX" + }, + { + "name": "xx", + "type": "pure-token", + "display_text": "xx", + "token": "XX" + }, + { + "name": "gt", + "type": "pure-token", + "display_text": "gt", + "token": "GT" + }, + { + "name": "lt", + "type": "pure-token", + "display_text": "lt", + "token": "LT" + } + ] } ], "command_flags": [ - "write" + "write", + "fast" ] }, - "LSET": { - "summary": "Sets the value of an element in a list by its index.", - "since": "1.0.0", - "group": "list", - "complexity": "O(N) where N is the length of the list. Setting either the first or the last element of the list is O(1).", + "PEXPIRETIME": { + "summary": "Returns the expiration time of a key as a Unix milliseconds timestamp.", + "since": "7.0.0", + "group": "generic", + "complexity": "O(1)", "acl_categories": [ - "@write", - "@list", - "@slow" + "@keyspace", + "@read", + "@fast" ], - "arity": 4, + "arity": 2, "key_specs": [ { "begin_search": { @@ -9931,8 +13221,8 @@ "limit": 0 } }, - "RW": true, - "update": true + "RO": true, + "access": true } ], "arguments": [ @@ -9941,34 +13231,24 @@ "type": "key", "display_text": "key", "key_spec_index": 0 - }, - { - "name": "index", - "type": "integer", - "display_text": "index" - }, - { - "name": "element", - "type": "string", - "display_text": "element" } ], "command_flags": [ - "write", - "denyoom" + "readonly", + "fast" ] }, - "LTRIM": { - "summary": "Removes elements from both ends a list. Deletes the list if all elements were trimmed.", - "since": "1.0.0", - "group": "list", - "complexity": "O(N) where N is the number of elements to be removed by the operation.", + "PFADD": { + "summary": "Adds elements to a HyperLogLog key. Creates the key if it doesn't exist.", + "since": "2.8.9", + "group": "hyperloglog", + "complexity": "O(1) to add every element.", "acl_categories": [ "@write", - "@list", - "@slow" + "@hyperloglog", + "@fast" ], - "arity": 4, + "arity": -2, "key_specs": [ { "begin_search": { @@ -9986,7 +13266,7 @@ } }, "RW": true, - "delete": true + "insert": true } ], "arguments": [ @@ -9997,130 +13277,49 @@ "key_spec_index": 0 }, { - "name": "start", - "type": "integer", - "display_text": "start" - }, - { - "name": "stop", - "type": "integer", - "display_text": "stop" + "name": "element", + "type": "string", + "display_text": "element", + "optional": true, + "multiple": true } ], "command_flags": [ - "write" - ] - }, - "MEMORY": { - "summary": "A container for memory diagnostics commands.", - "since": "4.0.0", - "group": "server", - "complexity": "Depends on subcommand.", - "acl_categories": [ - "@slow" - ], - "arity": -2 - }, - "MEMORY DOCTOR": { - "summary": "Outputs a memory problems report.", - "since": "4.0.0", - "group": "server", - "complexity": "O(1)", - "acl_categories": [ - "@slow" - ], - "arity": 2, - "hints": [ - "nondeterministic_output", - "request_policy:all_shards", - "response_policy:special" - ] - }, - "MEMORY HELP": { - "summary": "Returns helpful text about the different subcommands.", - "since": "4.0.0", - "group": "server", - "complexity": "O(1)", - "acl_categories": [ - "@slow" - ], - "arity": 2, - "command_flags": [ - "loading", - "stale" - ] - }, - "MEMORY MALLOC-STATS": { - "summary": "Returns the allocator statistics.", - "since": "4.0.0", - "group": "server", - "complexity": "Depends on how much memory is allocated, could be slow", - "acl_categories": [ - "@slow" - ], - "arity": 2, - "hints": [ - "nondeterministic_output", - "request_policy:all_shards", - "response_policy:special" - ] - }, - "MEMORY PURGE": { - "summary": "Asks the allocator to release memory.", - "since": "4.0.0", - "group": "server", - "complexity": "Depends on how much memory is allocated, could be slow", - "acl_categories": [ - "@slow" - ], - "arity": 2, - "hints": [ - "request_policy:all_shards", - "response_policy:all_succeeded" - ] - }, - "MEMORY STATS": { - "summary": "Returns details about memory usage.", - "since": "4.0.0", - "group": "server", - "complexity": "O(1)", - "acl_categories": [ - "@slow" - ], - "arity": 2, - "hints": [ - "nondeterministic_output", - "request_policy:all_shards", - "response_policy:special" + "write", + "denyoom", + "fast" ] }, - "MEMORY USAGE": { - "summary": "Estimates the memory usage of a key.", - "since": "4.0.0", - "group": "server", - "complexity": "O(N) where N is the number of samples.", + "PFCOUNT": { + "summary": "Returns the approximated cardinality of the set(s) observed by the HyperLogLog key(s).", + "since": "2.8.9", + "group": "hyperloglog", + "complexity": "O(1) with a very small average constant time when called with a single key. O(N) with N being the number of keys, and much bigger constant times, when called with multiple keys.", "acl_categories": [ "@read", + "@hyperloglog", "@slow" ], - "arity": -3, + "arity": -2, "key_specs": [ { + "notes": "RW because it may change the internal representation of the key, and propagate to replicas", "begin_search": { "type": "index", "spec": { - "index": 2 + "index": 1 } }, "find_keys": { "type": "range", "spec": { - "lastkey": 0, + "lastkey": -1, "keystep": 1, "limit": 0 } }, - "RO": true + "RW": true, + "access": true } ], "arguments": [ @@ -10128,104 +13327,86 @@ "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0 - }, - { - "name": "count", - "type": "integer", - "display_text": "count", - "token": "SAMPLES", - "optional": true + "key_spec_index": 0, + "multiple": true } ], "command_flags": [ "readonly" ] }, - "MGET": { - "summary": "Atomically returns the string values of one or more keys.", - "since": "1.0.0", - "group": "string", - "complexity": "O(N) where N is the number of keys to retrieve.", + "PFDEBUG": { + "summary": "Internal commands for debugging HyperLogLog values.", + "since": "2.8.9", + "group": "hyperloglog", + "complexity": "N/A", "acl_categories": [ - "@read", - "@string", - "@fast" + "@write", + "@hyperloglog", + "@admin", + "@slow", + "@dangerous" ], - "arity": -2, + "arity": 3, "key_specs": [ { "begin_search": { "type": "index", "spec": { - "index": 1 + "index": 2 } }, "find_keys": { "type": "range", "spec": { - "lastkey": -1, + "lastkey": 0, "keystep": 1, "limit": 0 } }, - "RO": true, + "RW": true, "access": true } ], "arguments": [ + { + "name": "subcommand", + "type": "string", + "display_text": "subcommand" + }, { "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0, - "multiple": true + "key_spec_index": 0 } ], "command_flags": [ - "readonly", - "fast" + "write", + "denyoom", + "admin" ], - "hints": [ - "request_policy:multi_shard" + "doc_flags": [ + "syscmd" ] }, - "MIGRATE": { - "summary": "Atomically transfers a key from one Redis instance to another.", - "since": "2.6.0", - "group": "generic", - "complexity": "This command actually executes a DUMP+DEL in the source instance, and a RESTORE in the target instance. See the pages of these commands for time complexity. Also an O(N) data transfer between the two instances is performed.", - "history": [ - [ - "3.0.0", - "Added the `COPY` and `REPLACE` options." - ], - [ - "3.0.6", - "Added the `KEYS` option." - ], - [ - "4.0.7", - "Added the `AUTH` option." - ], - [ - "6.0.0", - "Added the `AUTH2` option." - ] - ], + "PFMERGE": { + "summary": "Merges one or more HyperLogLog values into a single key.", + "since": "2.8.9", + "group": "hyperloglog", + "complexity": "O(N) to merge N HyperLogLogs, but with high constant times.", "acl_categories": [ - "@keyspace", "@write", - "@slow", - "@dangerous" + "@hyperloglog", + "@slow" ], - "arity": -6, + "arity": -2, "key_specs": [ { "begin_search": { "type": "index", "spec": { - "index": 3 + "index": 1 } }, "find_keys": { @@ -10238,14 +13419,13 @@ }, "RW": true, "access": true, - "delete": true + "insert": true }, { "begin_search": { - "type": "keyword", + "type": "index", "spec": { - "keyword": "KEYS", - "startfrom": -2 + "index": 2 } }, "find_keys": { @@ -10256,166 +13436,165 @@ "limit": 0 } }, - "RW": true, - "access": true, - "delete": true, - "incomplete": true + "RO": true, + "access": true } ], "arguments": [ { - "name": "host", - "type": "string", - "display_text": "host" - }, - { - "name": "port", - "type": "integer", - "display_text": "port" - }, - { - "name": "key-selector", - "type": "oneof", - "arguments": [ - { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 - }, - { - "name": "empty-string", - "type": "pure-token", - "display_text": "empty-string", - "token": "" - } - ] - }, - { - "name": "destination-db", - "type": "integer", - "display_text": "destination-db" - }, - { - "name": "timeout", - "type": "integer", - "display_text": "timeout" - }, - { - "name": "copy", - "type": "pure-token", - "display_text": "copy", - "token": "COPY", - "since": "3.0.0", - "optional": true - }, - { - "name": "replace", - "type": "pure-token", - "display_text": "replace", - "token": "REPLACE", - "since": "3.0.0", - "optional": true - }, - { - "name": "authentication", - "type": "oneof", - "optional": true, - "arguments": [ - { - "name": "auth", - "type": "string", - "display_text": "password", - "token": "AUTH", - "since": "4.0.7" - }, - { - "name": "auth2", - "type": "block", - "token": "AUTH2", - "since": "6.0.0", - "arguments": [ - { - "name": "username", - "type": "string", - "display_text": "username" - }, - { - "name": "password", - "type": "string", - "display_text": "password" - } - ] - } - ] + "name": "destkey", + "type": "key", + "display_text": "destkey", + "key_spec_index": 0 }, { - "name": "keys", + "name": "sourcekey", "type": "key", - "display_text": "key", + "display_text": "sourcekey", "key_spec_index": 1, - "token": "KEYS", - "since": "3.0.6", "optional": true, "multiple": true } ], "command_flags": [ "write", - "movablekeys" + "denyoom" + ] + }, + "PFSELFTEST": { + "summary": "An internal command for testing HyperLogLog values.", + "since": "2.8.9", + "group": "hyperloglog", + "complexity": "N/A", + "acl_categories": [ + "@hyperloglog", + "@admin", + "@slow", + "@dangerous" ], - "hints": [ - "nondeterministic_output" + "arity": 1, + "command_flags": [ + "admin" + ], + "doc_flags": [ + "syscmd" ] }, - "MODULE": { - "summary": "A container for module commands.", - "since": "4.0.0", - "group": "server", - "complexity": "Depends on subcommand.", + "PING": { + "summary": "Returns the server's liveliness response.", + "since": "1.0.0", + "group": "connection", + "complexity": "O(1)", "acl_categories": [ - "@slow" + "@fast", + "@connection" ], - "arity": -2 + "arity": -1, + "arguments": [ + { + "name": "message", + "type": "string", + "display_text": "message", + "optional": true + } + ], + "command_flags": [ + "fast" + ], + "hints": [ + "request_policy:all_shards", + "response_policy:all_succeeded" + ] }, - "MODULE HELP": { - "summary": "Returns helpful text about the different subcommands.", - "since": "5.0.0", - "group": "server", + "PSETEX": { + "summary": "Sets both string value and expiration time in milliseconds of a key. The key is created if it doesn't exist.", + "since": "2.6.0", + "group": "string", "complexity": "O(1)", + "deprecated_since": "2.6.12", + "replaced_by": "`SET` with the `PX` argument", "acl_categories": [ + "@write", + "@string", "@slow" ], - "arity": 2, + "arity": 4, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "OW": true, + "update": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "milliseconds", + "type": "integer", + "display_text": "milliseconds" + }, + { + "name": "value", + "type": "string", + "display_text": "value" + } + ], "command_flags": [ - "loading", - "stale" + "write", + "denyoom" + ], + "doc_flags": [ + "deprecated" ] }, - "MODULE LIST": { - "summary": "Returns all loaded modules.", - "since": "4.0.0", - "group": "server", - "complexity": "O(N) where N is the number of loaded modules.", + "PSUBSCRIBE": { + "summary": "Listens for messages published to channels that match one or more patterns.", + "since": "2.0.0", + "group": "pubsub", + "complexity": "O(N) where N is the number of patterns to subscribe to.", "acl_categories": [ - "@admin", - "@slow", - "@dangerous" + "@pubsub", + "@slow" ], - "arity": 2, - "command_flags": [ - "admin", - "noscript" + "arity": -2, + "arguments": [ + { + "name": "pattern", + "type": "pattern", + "display_text": "pattern", + "multiple": true + } ], - "hints": [ - "nondeterministic_output_order" + "command_flags": [ + "denyoom", + "pubsub", + "noscript", + "loading", + "stale" ] }, - "MODULE LOAD": { - "summary": "Loads a module.", - "since": "4.0.0", + "PSYNC": { + "summary": "An internal command used in replication.", + "since": "2.8.0", "group": "server", - "complexity": "O(1)", "acl_categories": [ "@admin", "@slow", @@ -10424,314 +13603,296 @@ "arity": -3, "arguments": [ { - "name": "path", + "name": "replicationid", "type": "string", - "display_text": "path" + "display_text": "replicationid" }, { - "name": "arg", - "type": "string", - "display_text": "arg", - "optional": true, - "multiple": true + "name": "offset", + "type": "integer", + "display_text": "offset" } ], "command_flags": [ "admin", "noscript", - "no_async_loading" + "no_async_loading", + "no_multi" ] }, - "MODULE LOADEX": { - "summary": "Loads a module using extended parameters.", - "since": "7.0.0", - "group": "server", + "PTTL": { + "summary": "Returns the expiration time in milliseconds of a key.", + "since": "2.6.0", + "group": "generic", "complexity": "O(1)", + "history": [ + [ + "2.8.0", + "Added the -2 reply." + ] + ], "acl_categories": [ - "@admin", - "@slow", - "@dangerous" + "@keyspace", + "@read", + "@fast" + ], + "arity": 2, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } ], - "arity": -3, "arguments": [ { - "name": "path", - "type": "string", - "display_text": "path" - }, + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + } + ], + "command_flags": [ + "readonly", + "fast" + ], + "hints": [ + "nondeterministic_output" + ] + }, + "PUBLISH": { + "summary": "Posts a message to a channel.", + "since": "2.0.0", + "group": "pubsub", + "complexity": "O(N+M) where N is the number of clients subscribed to the receiving channel and M is the total number of subscribed patterns (by any client).", + "acl_categories": [ + "@pubsub", + "@fast" + ], + "arity": 3, + "arguments": [ { - "name": "configs", - "type": "block", - "token": "CONFIG", - "optional": true, - "multiple": true, - "multiple_token": true, - "arguments": [ - { - "name": "name", - "type": "string", - "display_text": "name" - }, - { - "name": "value", - "type": "string", - "display_text": "value" - } - ] + "name": "channel", + "type": "string", + "display_text": "channel" }, { - "name": "args", + "name": "message", "type": "string", - "display_text": "args", - "token": "ARGS", - "optional": true, - "multiple": true + "display_text": "message" } ], "command_flags": [ - "admin", - "noscript", - "no_async_loading" + "pubsub", + "loading", + "stale", + "fast" ] }, - "MODULE UNLOAD": { - "summary": "Unloads a module.", - "since": "4.0.0", - "group": "server", - "complexity": "O(1)", + "PUBSUB": { + "summary": "A container for Pub/Sub commands.", + "since": "2.8.0", + "group": "pubsub", + "complexity": "Depends on subcommand.", "acl_categories": [ - "@admin", - "@slow", - "@dangerous" + "@slow" ], - "arity": 3, + "arity": -2 + }, + "PUBSUB CHANNELS": { + "summary": "Returns the active channels.", + "since": "2.8.0", + "group": "pubsub", + "complexity": "O(N) where N is the number of active channels, and assuming constant time pattern matching (relatively short channels and patterns)", + "acl_categories": [ + "@pubsub", + "@slow" + ], + "arity": -2, "arguments": [ { - "name": "name", - "type": "string", - "display_text": "name" + "name": "pattern", + "type": "pattern", + "display_text": "pattern", + "optional": true } ], "command_flags": [ - "admin", - "noscript", - "no_async_loading" + "pubsub", + "loading", + "stale" ] }, - "MONITOR": { - "summary": "Listens for all requests received by the server in real-time.", - "since": "1.0.0", - "group": "server", + "PUBSUB HELP": { + "summary": "Returns helpful text about the different subcommands.", + "since": "6.2.0", + "group": "pubsub", + "complexity": "O(1)", "acl_categories": [ - "@admin", - "@slow", - "@dangerous" + "@slow" ], - "arity": 1, + "arity": 2, "command_flags": [ - "admin", - "noscript", "loading", "stale" ] }, - "MOVE": { - "summary": "Moves a key to another database.", - "since": "1.0.0", - "group": "generic", + "PUBSUB NUMPAT": { + "summary": "Returns a count of unique pattern subscriptions.", + "since": "2.8.0", + "group": "pubsub", "complexity": "O(1)", "acl_categories": [ - "@keyspace", - "@write", - "@fast" + "@pubsub", + "@slow" ], - "arity": 3, - "key_specs": [ + "arity": 2, + "command_flags": [ + "pubsub", + "loading", + "stale" + ] + }, + "PUBSUB NUMSUB": { + "summary": "Returns a count of subscribers to channels.", + "since": "2.8.0", + "group": "pubsub", + "complexity": "O(N) for the NUMSUB subcommand, where N is the number of requested channels", + "acl_categories": [ + "@pubsub", + "@slow" + ], + "arity": -2, + "arguments": [ { - "begin_search": { - "type": "index", - "spec": { - "index": 1 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "RW": true, - "access": true, - "update": true + "name": "channel", + "type": "string", + "display_text": "channel", + "optional": true, + "multiple": true } ], + "command_flags": [ + "pubsub", + "loading", + "stale" + ] + }, + "PUBSUB SHARDCHANNELS": { + "summary": "Returns the active shard channels.", + "since": "7.0.0", + "group": "pubsub", + "complexity": "O(N) where N is the number of active shard channels, and assuming constant time pattern matching (relatively short shard channels).", + "acl_categories": [ + "@pubsub", + "@slow" + ], + "arity": -2, "arguments": [ { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 - }, - { - "name": "db", - "type": "integer", - "display_text": "db" + "name": "pattern", + "type": "pattern", + "display_text": "pattern", + "optional": true } ], "command_flags": [ - "write", - "fast" + "pubsub", + "loading", + "stale" ] }, - "MSET": { - "summary": "Atomically creates or modifies the string values of one or more keys.", - "since": "1.0.1", - "group": "string", - "complexity": "O(N) where N is the number of keys to set.", + "PUBSUB SHARDNUMSUB": { + "summary": "Returns the count of subscribers of shard channels.", + "since": "7.0.0", + "group": "pubsub", + "complexity": "O(N) for the SHARDNUMSUB subcommand, where N is the number of requested shard channels", "acl_categories": [ - "@write", - "@string", + "@pubsub", "@slow" ], - "arity": -3, - "key_specs": [ - { - "begin_search": { - "type": "index", - "spec": { - "index": 1 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": -1, - "keystep": 2, - "limit": 0 - } - }, - "OW": true, - "update": true - } - ], + "arity": -2, "arguments": [ { - "name": "data", - "type": "block", - "multiple": true, - "arguments": [ - { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 - }, - { - "name": "value", - "type": "string", - "display_text": "value" - } - ] + "name": "shardchannel", + "type": "string", + "display_text": "shardchannel", + "optional": true, + "multiple": true } ], "command_flags": [ - "write", - "denyoom" - ], - "hints": [ - "request_policy:multi_shard", - "response_policy:all_succeeded" + "pubsub", + "loading", + "stale" ] }, - "MSETNX": { - "summary": "Atomically modifies the string values of one or more keys only when all keys don't exist.", - "since": "1.0.1", - "group": "string", - "complexity": "O(N) where N is the number of keys to set.", + "PUNSUBSCRIBE": { + "summary": "Stops listening to messages published to channels that match one or more patterns.", + "since": "2.0.0", + "group": "pubsub", + "complexity": "O(N) where N is the number of patterns to unsubscribe.", "acl_categories": [ - "@write", - "@string", + "@pubsub", "@slow" ], - "arity": -3, - "key_specs": [ - { - "begin_search": { - "type": "index", - "spec": { - "index": 1 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": -1, - "keystep": 2, - "limit": 0 - } - }, - "OW": true, - "insert": true - } - ], + "arity": -1, "arguments": [ { - "name": "data", - "type": "block", - "multiple": true, - "arguments": [ - { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 - }, - { - "name": "value", - "type": "string", - "display_text": "value" - } - ] + "name": "pattern", + "type": "pattern", + "display_text": "pattern", + "optional": true, + "multiple": true } ], "command_flags": [ - "write", - "denyoom" + "pubsub", + "noscript", + "loading", + "stale" ] }, - "MULTI": { - "summary": "Starts a transaction.", - "since": "1.2.0", - "group": "transactions", + "QUIT": { + "summary": "Closes the connection.", + "since": "1.0.0", + "group": "connection", "complexity": "O(1)", + "deprecated_since": "7.2.0", + "replaced_by": "just closing the connection", "acl_categories": [ "@fast", - "@transaction" + "@connection" ], - "arity": 1, + "arity": -1, "command_flags": [ "noscript", "loading", "stale", "fast", + "no_auth", "allow_busy" - ] - }, - "OBJECT": { - "summary": "A container for object introspection commands.", - "since": "2.2.3", - "group": "generic", - "complexity": "Depends on subcommand.", - "acl_categories": [ - "@slow" ], - "arity": -2 + "doc_flags": [ + "deprecated" + ] }, - "OBJECT ENCODING": { - "summary": "Returns the internal encoding of a Redis object.", - "since": "2.2.3", + "RANDOMKEY": { + "summary": "Returns a random key name from the database.", + "since": "1.0.0", "group": "generic", "complexity": "O(1)", "acl_categories": [ @@ -10739,109 +13900,56 @@ "@read", "@slow" ], - "arity": 3, - "key_specs": [ - { - "begin_search": { - "type": "index", - "spec": { - "index": 2 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "RO": true - } - ], - "arguments": [ - { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 - } - ], + "arity": 1, "command_flags": [ "readonly" ], "hints": [ + "request_policy:all_shards", + "response_policy:special", "nondeterministic_output" ] }, - "OBJECT FREQ": { - "summary": "Returns the logarithmic access frequency counter of a Redis object.", - "since": "4.0.0", - "group": "generic", + "READONLY": { + "summary": "Enables read-only queries for a connection to a Redis Cluster replica node.", + "since": "3.0.0", + "group": "cluster", "complexity": "O(1)", "acl_categories": [ - "@keyspace", - "@read", - "@slow" - ], - "arity": 3, - "key_specs": [ - { - "begin_search": { - "type": "index", - "spec": { - "index": 2 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "RO": true - } - ], - "arguments": [ - { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 - } - ], - "command_flags": [ - "readonly" + "@fast", + "@connection" ], - "hints": [ - "nondeterministic_output" + "arity": 1, + "command_flags": [ + "loading", + "stale", + "fast" ] }, - "OBJECT HELP": { - "summary": "Returns helpful text about the different subcommands.", - "since": "6.2.0", - "group": "generic", + "READWRITE": { + "summary": "Enables read-write queries for a connection to a Reids Cluster replica node.", + "since": "3.0.0", + "group": "cluster", "complexity": "O(1)", "acl_categories": [ - "@keyspace", - "@slow" + "@fast", + "@connection" ], - "arity": 2, + "arity": 1, "command_flags": [ "loading", - "stale" + "stale", + "fast" ] }, - "OBJECT IDLETIME": { - "summary": "Returns the time since the last access to a Redis object.", - "since": "2.2.3", + "RENAME": { + "summary": "Renames a key and overwrites the destination.", + "since": "1.0.0", "group": "generic", "complexity": "O(1)", "acl_categories": [ "@keyspace", - "@read", + "@write", "@slow" ], "arity": 3, @@ -10850,7 +13958,7 @@ "begin_search": { "type": "index", "spec": { - "index": 2 + "index": 1 } }, "find_keys": { @@ -10861,36 +13969,10 @@ "limit": 0 } }, - "RO": true - } - ], - "arguments": [ - { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 - } - ], - "command_flags": [ - "readonly" - ], - "hints": [ - "nondeterministic_output" - ] - }, - "OBJECT REFCOUNT": { - "summary": "Returns the reference count of a value of a key.", - "since": "2.2.3", - "group": "generic", - "complexity": "O(1)", - "acl_categories": [ - "@keyspace", - "@read", - "@slow" - ], - "arity": 3, - "key_specs": [ + "RW": true, + "access": true, + "delete": true + }, { "begin_search": { "type": "index", @@ -10906,7 +13988,8 @@ "limit": 0 } }, - "RO": true + "OW": true, + "update": true } ], "arguments": [ @@ -10915,26 +13998,35 @@ "type": "key", "display_text": "key", "key_spec_index": 0 + }, + { + "name": "newkey", + "type": "key", + "display_text": "newkey", + "key_spec_index": 1 } ], "command_flags": [ - "readonly" - ], - "hints": [ - "nondeterministic_output" + "write" ] }, - "PERSIST": { - "summary": "Removes the expiration time of a key.", - "since": "2.2.0", + "RENAMENX": { + "summary": "Renames a key only when the target key name doesn't exist.", + "since": "1.0.0", "group": "generic", "complexity": "O(1)", + "history": [ + [ + "3.2.0", + "The command no longer returns an error when source and destination names are the same." + ] + ], "acl_categories": [ "@keyspace", "@write", "@fast" ], - "arity": 2, + "arity": 3, "key_specs": [ { "begin_search": { @@ -10952,45 +14044,14 @@ } }, "RW": true, - "update": true - } - ], - "arguments": [ - { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 - } - ], - "command_flags": [ - "write", - "fast" - ] - }, - "PEXPIRE": { - "summary": "Sets the expiration time of a key in milliseconds.", - "since": "2.6.0", - "group": "generic", - "complexity": "O(1)", - "history": [ - [ - "7.0.0", - "Added options: `NX`, `XX`, `GT` and `LT`." - ] - ], - "acl_categories": [ - "@keyspace", - "@write", - "@fast" - ], - "arity": -3, - "key_specs": [ + "access": true, + "delete": true + }, { "begin_search": { "type": "index", "spec": { - "index": 1 + "index": 2 } }, "find_keys": { @@ -11001,8 +14062,8 @@ "limit": 0 } }, - "RW": true, - "update": true + "OW": true, + "insert": true } ], "arguments": [ @@ -11013,65 +14074,144 @@ "key_spec_index": 0 }, { - "name": "milliseconds", - "type": "integer", - "display_text": "milliseconds" - }, + "name": "newkey", + "type": "key", + "display_text": "newkey", + "key_spec_index": 1 + } + ], + "command_flags": [ + "write", + "fast" + ] + }, + "REPLCONF": { + "summary": "An internal command for configuring the replication stream.", + "since": "3.0.0", + "group": "server", + "complexity": "O(1)", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" + ], + "arity": -1, + "command_flags": [ + "admin", + "noscript", + "loading", + "stale", + "allow_busy" + ], + "doc_flags": [ + "syscmd" + ] + }, + "REPLICAOF": { + "summary": "Configures a server as replica of another, or promotes it to a master.", + "since": "5.0.0", + "group": "server", + "complexity": "O(1)", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" + ], + "arity": 3, + "arguments": [ { - "name": "condition", + "name": "args", "type": "oneof", - "since": "7.0.0", - "optional": true, "arguments": [ { - "name": "nx", - "type": "pure-token", - "display_text": "nx", - "token": "NX" - }, - { - "name": "xx", - "type": "pure-token", - "display_text": "xx", - "token": "XX" - }, - { - "name": "gt", - "type": "pure-token", - "display_text": "gt", - "token": "GT" + "name": "host-port", + "type": "block", + "arguments": [ + { + "name": "host", + "type": "string", + "display_text": "host" + }, + { + "name": "port", + "type": "integer", + "display_text": "port" + } + ] }, { - "name": "lt", - "type": "pure-token", - "display_text": "lt", - "token": "LT" + "name": "no-one", + "type": "block", + "arguments": [ + { + "name": "no", + "type": "pure-token", + "display_text": "no", + "token": "NO" + }, + { + "name": "one", + "type": "pure-token", + "display_text": "one", + "token": "ONE" + } + ] } ] } ], "command_flags": [ - "write", - "fast" + "admin", + "noscript", + "stale", + "no_async_loading" + ] + }, + "RESET": { + "summary": "Resets the connection.", + "since": "6.2.0", + "group": "connection", + "complexity": "O(1)", + "acl_categories": [ + "@fast", + "@connection" + ], + "arity": 1, + "command_flags": [ + "noscript", + "loading", + "stale", + "fast", + "no_auth", + "allow_busy" ] }, - "PEXPIREAT": { - "summary": "Sets the expiration time of a key to a Unix milliseconds timestamp.", + "RESTORE": { + "summary": "Creates a key from the serialized representation of a value.", "since": "2.6.0", "group": "generic", - "complexity": "O(1)", + "complexity": "O(1) to create the new key and additional O(N*M) to reconstruct the serialized value, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1). However for sorted set values the complexity is O(N*M*log(N)) because inserting values into sorted sets is O(log(N)).", "history": [ [ - "7.0.0", - "Added options: `NX`, `XX`, `GT` and `LT`." + "3.0.0", + "Added the `REPLACE` modifier." + ], + [ + "5.0.0", + "Added the `ABSTTL` modifier." + ], + [ + "5.0.0", + "Added the `IDLETIME` and `FREQ` options." ] ], "acl_categories": [ "@keyspace", "@write", - "@fast" + "@slow", + "@dangerous" ], - "arity": -3, + "arity": -4, "key_specs": [ { "begin_search": { @@ -11088,7 +14228,7 @@ "limit": 0 } }, - "RW": true, + "OW": true, "update": true } ], @@ -11100,103 +14240,79 @@ "key_spec_index": 0 }, { - "name": "unix-time-milliseconds", - "type": "unix-time", - "display_text": "unix-time-milliseconds" + "name": "ttl", + "type": "integer", + "display_text": "ttl" }, { - "name": "condition", - "type": "oneof", - "since": "7.0.0", - "optional": true, - "arguments": [ - { - "name": "nx", - "type": "pure-token", - "display_text": "nx", - "token": "NX" - }, - { - "name": "xx", - "type": "pure-token", - "display_text": "xx", - "token": "XX" - }, - { - "name": "gt", - "type": "pure-token", - "display_text": "gt", - "token": "GT" - }, - { - "name": "lt", - "type": "pure-token", - "display_text": "lt", - "token": "LT" - } - ] - } - ], - "command_flags": [ - "write", - "fast" - ] - }, - "PEXPIRETIME": { - "summary": "Returns the expiration time of a key as a Unix milliseconds timestamp.", - "since": "7.0.0", - "group": "generic", - "complexity": "O(1)", - "acl_categories": [ - "@keyspace", - "@read", - "@fast" - ], - "arity": 2, - "key_specs": [ + "name": "serialized-value", + "type": "string", + "display_text": "serialized-value" + }, { - "begin_search": { - "type": "index", - "spec": { - "index": 1 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "RO": true, - "access": true - } - ], - "arguments": [ + "name": "replace", + "type": "pure-token", + "display_text": "replace", + "token": "REPLACE", + "since": "3.0.0", + "optional": true + }, { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 + "name": "absttl", + "type": "pure-token", + "display_text": "absttl", + "token": "ABSTTL", + "since": "5.0.0", + "optional": true + }, + { + "name": "seconds", + "type": "integer", + "display_text": "seconds", + "token": "IDLETIME", + "since": "5.0.0", + "optional": true + }, + { + "name": "frequency", + "type": "integer", + "display_text": "frequency", + "token": "FREQ", + "since": "5.0.0", + "optional": true } ], "command_flags": [ - "readonly", - "fast" + "write", + "denyoom" ] }, - "PFADD": { - "summary": "Adds elements to a HyperLogLog key. Creates the key if it doesn't exist.", - "since": "2.8.9", - "group": "hyperloglog", - "complexity": "O(1) to add every element.", + "RESTORE-ASKING": { + "summary": "An internal command for migrating keys in a cluster.", + "since": "3.0.0", + "group": "server", + "complexity": "O(1) to create the new key and additional O(N*M) to reconstruct the serialized value, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1). However for sorted set values the complexity is O(N*M*log(N)) because inserting values into sorted sets is O(log(N)).", + "history": [ + [ + "3.0.0", + "Added the `REPLACE` modifier." + ], + [ + "5.0.0", + "Added the `ABSTTL` modifier." + ], + [ + "5.0.0", + "Added the `IDLETIME` and `FREQ` options." + ] + ], "acl_categories": [ + "@keyspace", "@write", - "@hyperloglog", - "@fast" + "@slow", + "@dangerous" ], - "arity": -2, + "arity": -4, "key_specs": [ { "begin_search": { @@ -11213,8 +14329,8 @@ "limit": 0 } }, - "RW": true, - "insert": true + "OW": true, + "update": true } ], "arguments": [ @@ -11225,83 +14341,98 @@ "key_spec_index": 0 }, { - "name": "element", + "name": "ttl", + "type": "integer", + "display_text": "ttl" + }, + { + "name": "serialized-value", "type": "string", - "display_text": "element", - "optional": true, - "multiple": true - } - ], - "command_flags": [ - "write", - "denyoom", - "fast" - ] - }, - "PFCOUNT": { - "summary": "Returns the approximated cardinality of the set(s) observed by the HyperLogLog key(s).", - "since": "2.8.9", - "group": "hyperloglog", - "complexity": "O(1) with a very small average constant time when called with a single key. O(N) with N being the number of keys, and much bigger constant times, when called with multiple keys.", - "acl_categories": [ - "@read", - "@hyperloglog", - "@slow" - ], - "arity": -2, - "key_specs": [ + "display_text": "serialized-value" + }, { - "notes": "RW because it may change the internal representation of the key, and propagate to replicas", - "begin_search": { - "type": "index", - "spec": { - "index": 1 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": -1, - "keystep": 1, - "limit": 0 - } - }, - "RW": true, - "access": true - } - ], - "arguments": [ + "name": "replace", + "type": "pure-token", + "display_text": "replace", + "token": "REPLACE", + "since": "3.0.0", + "optional": true + }, + { + "name": "absttl", + "type": "pure-token", + "display_text": "absttl", + "token": "ABSTTL", + "since": "5.0.0", + "optional": true + }, + { + "name": "seconds", + "type": "integer", + "display_text": "seconds", + "token": "IDLETIME", + "since": "5.0.0", + "optional": true + }, { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0, - "multiple": true + "name": "frequency", + "type": "integer", + "display_text": "frequency", + "token": "FREQ", + "since": "5.0.0", + "optional": true } ], "command_flags": [ - "readonly" + "write", + "denyoom", + "asking" + ], + "doc_flags": [ + "syscmd" ] }, - "PFDEBUG": { - "summary": "Internal commands for debugging HyperLogLog values.", - "since": "2.8.9", - "group": "hyperloglog", - "complexity": "N/A", + "ROLE": { + "summary": "Returns the replication role.", + "since": "2.8.12", + "group": "server", + "complexity": "O(1)", "acl_categories": [ - "@write", - "@hyperloglog", "@admin", - "@slow", + "@fast", "@dangerous" ], - "arity": 3, + "arity": 1, + "command_flags": [ + "noscript", + "loading", + "stale", + "fast" + ] + }, + "RPOP": { + "summary": "Returns and removes the last elements of a list. Deletes the list if the last element was popped.", + "since": "1.0.0", + "group": "list", + "complexity": "O(N) where N is the number of elements returned", + "history": [ + [ + "6.2.0", + "Added the `count` argument." + ] + ], + "acl_categories": [ + "@write", + "@list", + "@fast" + ], + "arity": -2, "key_specs": [ { "begin_search": { "type": "index", "spec": { - "index": 2 + "index": 1 } }, "find_keys": { @@ -11313,42 +14444,43 @@ } }, "RW": true, - "access": true + "access": true, + "delete": true } ], "arguments": [ - { - "name": "subcommand", - "type": "string", - "display_text": "subcommand" - }, { "name": "key", "type": "key", "display_text": "key", "key_spec_index": 0 + }, + { + "name": "count", + "type": "integer", + "display_text": "count", + "since": "6.2.0", + "optional": true } ], "command_flags": [ "write", - "denyoom", - "admin" - ], - "doc_flags": [ - "syscmd" + "fast" ] }, - "PFMERGE": { - "summary": "Merges one or more HyperLogLog values into a single key.", - "since": "2.8.9", - "group": "hyperloglog", - "complexity": "O(N) to merge N HyperLogLogs, but with high constant times.", + "RPOPLPUSH": { + "summary": "Returns the last element of a list after removing and pushing it to another list. Deletes the list if the last element was popped.", + "since": "1.2.0", + "group": "list", + "complexity": "O(1)", + "deprecated_since": "6.2.0", + "replaced_by": "`LMOVE` with the `RIGHT` and `LEFT` arguments", "acl_categories": [ "@write", - "@hyperloglog", + "@list", "@slow" ], - "arity": -2, + "arity": 3, "key_specs": [ { "begin_search": { @@ -11367,7 +14499,7 @@ }, "RW": true, "access": true, - "insert": true + "delete": true }, { "begin_search": { @@ -11379,94 +14511,54 @@ "find_keys": { "type": "range", "spec": { - "lastkey": -1, + "lastkey": 0, "keystep": 1, "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "insert": true } ], "arguments": [ { - "name": "destkey", + "name": "source", "type": "key", - "display_text": "destkey", + "display_text": "source", "key_spec_index": 0 }, { - "name": "sourcekey", + "name": "destination", "type": "key", - "display_text": "sourcekey", - "key_spec_index": 1, - "optional": true, - "multiple": true + "display_text": "destination", + "key_spec_index": 1 } ], "command_flags": [ "write", "denyoom" - ] - }, - "PFSELFTEST": { - "summary": "An internal command for testing HyperLogLog values.", - "since": "2.8.9", - "group": "hyperloglog", - "complexity": "N/A", - "acl_categories": [ - "@hyperloglog", - "@admin", - "@slow", - "@dangerous" - ], - "arity": 1, - "command_flags": [ - "admin" ], "doc_flags": [ - "syscmd" + "deprecated" ] }, - "PING": { - "summary": "Returns the server's liveliness response.", + "RPUSH": { + "summary": "Appends one or more elements to a list. Creates the key if it doesn't exist.", "since": "1.0.0", - "group": "connection", - "complexity": "O(1)", - "acl_categories": [ - "@fast", - "@connection" - ], - "arity": -1, - "arguments": [ - { - "name": "message", - "type": "string", - "display_text": "message", - "optional": true - } - ], - "command_flags": [ - "fast" + "group": "list", + "complexity": "O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.", + "history": [ + [ + "2.4.0", + "Accepts multiple `element` arguments." + ] ], - "hints": [ - "request_policy:all_shards", - "response_policy:all_succeeded" - ] - }, - "PSETEX": { - "summary": "Sets both string value and expiration time in milliseconds of a key. The key is created if it doesn't exist.", - "since": "2.6.0", - "group": "string", - "complexity": "O(1)", - "deprecated_since": "2.6.12", - "replaced_by": "`SET` with the `PX` argument", "acl_categories": [ "@write", - "@string", - "@slow" + "@list", + "@fast" ], - "arity": 4, + "arity": -3, "key_specs": [ { "begin_search": { @@ -11483,8 +14575,8 @@ "limit": 0 } }, - "OW": true, - "update": true + "RW": true, + "insert": true } ], "arguments": [ @@ -11495,95 +14587,35 @@ "key_spec_index": 0 }, { - "name": "milliseconds", - "type": "integer", - "display_text": "milliseconds" - }, - { - "name": "value", + "name": "element", "type": "string", - "display_text": "value" - } - ], - "command_flags": [ - "write", - "denyoom" - ], - "doc_flags": [ - "deprecated" - ] - }, - "PSUBSCRIBE": { - "summary": "Listens for messages published to channels that match one or more patterns.", - "since": "2.0.0", - "group": "pubsub", - "complexity": "O(N) where N is the number of patterns to subscribe to.", - "acl_categories": [ - "@pubsub", - "@slow" - ], - "arity": -2, - "arguments": [ - { - "name": "pattern", - "type": "pattern", - "display_text": "pattern", + "display_text": "element", "multiple": true } ], "command_flags": [ - "pubsub", - "noscript", - "loading", - "stale" - ] - }, - "PSYNC": { - "summary": "An internal command used in replication.", - "since": "2.8.0", - "group": "server", - "acl_categories": [ - "@admin", - "@slow", - "@dangerous" - ], - "arity": -3, - "arguments": [ - { - "name": "replicationid", - "type": "string", - "display_text": "replicationid" - }, - { - "name": "offset", - "type": "integer", - "display_text": "offset" - } - ], - "command_flags": [ - "admin", - "noscript", - "no_async_loading", - "no_multi" + "write", + "denyoom", + "fast" ] }, - "PTTL": { - "summary": "Returns the expiration time in milliseconds of a key.", - "since": "2.6.0", - "group": "generic", - "complexity": "O(1)", + "RPUSHX": { + "summary": "Appends an element to a list only when the list exists.", + "since": "2.2.0", + "group": "list", + "complexity": "O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.", "history": [ [ - "2.8.0", - "Added the -2 reply." + "4.0.0", + "Accepts multiple `element` arguments." ] ], "acl_categories": [ - "@keyspace", - "@read", + "@write", + "@list", "@fast" ], - "arity": 2, + "arity": -3, "key_specs": [ { "begin_search": { @@ -11600,8 +14632,8 @@ "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "insert": true } ], "arguments": [ @@ -11610,296 +14642,386 @@ "type": "key", "display_text": "key", "key_spec_index": 0 + }, + { + "name": "element", + "type": "string", + "display_text": "element", + "multiple": true } ], "command_flags": [ - "readonly", + "write", + "denyoom", "fast" - ], - "hints": [ - "nondeterministic_output" ] }, - "PUBLISH": { - "summary": "Posts a message to a channel.", - "since": "2.0.0", - "group": "pubsub", - "complexity": "O(N+M) where N is the number of clients subscribed to the receiving channel and M is the total number of subscribed patterns (by any client).", + "SADD": { + "summary": "Adds one or more members to a set. Creates the key if it doesn't exist.", + "since": "1.0.0", + "group": "set", + "complexity": "O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.", + "history": [ + [ + "2.4.0", + "Accepts multiple `member` arguments." + ] + ], "acl_categories": [ - "@pubsub", + "@write", + "@set", "@fast" ], - "arity": 3, + "arity": -3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "insert": true + } + ], "arguments": [ { - "name": "channel", - "type": "string", - "display_text": "channel" + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 }, { - "name": "message", + "name": "member", "type": "string", - "display_text": "message" + "display_text": "member", + "multiple": true } ], "command_flags": [ - "pubsub", - "loading", - "stale", + "write", + "denyoom", "fast" ] }, - "PUBSUB": { - "summary": "A container for Pub/Sub commands.", - "since": "2.8.0", - "group": "pubsub", - "complexity": "Depends on subcommand.", + "SAVE": { + "summary": "Synchronously saves the database(s) to disk.", + "since": "1.0.0", + "group": "server", + "complexity": "O(N) where N is the total number of keys in all databases", "acl_categories": [ - "@slow" + "@admin", + "@slow", + "@dangerous" ], - "arity": -2 + "arity": 1, + "command_flags": [ + "admin", + "noscript", + "no_async_loading", + "no_multi" + ] }, - "PUBSUB CHANNELS": { - "summary": "Returns the active channels.", + "SCAN": { + "summary": "Iterates over the key names in the database.", "since": "2.8.0", - "group": "pubsub", - "complexity": "O(N) where N is the number of active channels, and assuming constant time pattern matching (relatively short channels and patterns)", + "group": "generic", + "complexity": "O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection.", + "history": [ + [ + "6.0.0", + "Added the `TYPE` subcommand." + ] + ], "acl_categories": [ - "@pubsub", + "@keyspace", + "@read", "@slow" ], "arity": -2, "arguments": [ + { + "name": "cursor", + "type": "integer", + "display_text": "cursor" + }, { "name": "pattern", "type": "pattern", "display_text": "pattern", + "token": "MATCH", + "optional": true + }, + { + "name": "count", + "type": "integer", + "display_text": "count", + "token": "COUNT", + "optional": true + }, + { + "name": "type", + "type": "string", + "display_text": "type", + "token": "TYPE", + "since": "6.0.0", "optional": true } ], "command_flags": [ - "pubsub", - "loading", - "stale" - ] - }, - "PUBSUB HELP": { - "summary": "Returns helpful text about the different subcommands.", - "since": "6.2.0", - "group": "pubsub", - "complexity": "O(1)", - "acl_categories": [ - "@slow" + "readonly" ], - "arity": 2, - "command_flags": [ - "loading", - "stale" + "hints": [ + "nondeterministic_output", + "request_policy:special", + "response_policy:special" ] }, - "PUBSUB NUMPAT": { - "summary": "Returns a count of unique pattern subscriptions.", - "since": "2.8.0", - "group": "pubsub", + "SCARD": { + "summary": "Returns the number of members in a set.", + "since": "1.0.0", + "group": "set", "complexity": "O(1)", "acl_categories": [ - "@pubsub", - "@slow" + "@read", + "@set", + "@fast" ], "arity": 2, - "command_flags": [ - "pubsub", - "loading", - "stale" - ] - }, - "PUBSUB NUMSUB": { - "summary": "Returns a count of subscribers to channels.", - "since": "2.8.0", - "group": "pubsub", - "complexity": "O(N) for the NUMSUB subcommand, where N is the number of requested channels", - "acl_categories": [ - "@pubsub", - "@slow" + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true + } ], - "arity": -2, "arguments": [ { - "name": "channel", - "type": "string", - "display_text": "channel", - "optional": true, - "multiple": true + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 } ], "command_flags": [ - "pubsub", - "loading", - "stale" + "readonly", + "fast" ] }, - "PUBSUB SHARDCHANNELS": { - "summary": "Returns the active shard channels.", - "since": "7.0.0", - "group": "pubsub", - "complexity": "O(N) where N is the number of active shard channels, and assuming constant time pattern matching (relatively short shard channels).", + "SCRIPT": { + "summary": "A container for Lua scripts management commands.", + "since": "2.6.0", + "group": "scripting", + "complexity": "Depends on subcommand.", "acl_categories": [ - "@pubsub", "@slow" ], - "arity": -2, + "arity": -2 + }, + "SCRIPT DEBUG": { + "summary": "Sets the debug mode of server-side Lua scripts.", + "since": "3.2.0", + "group": "scripting", + "complexity": "O(1)", + "acl_categories": [ + "@slow", + "@scripting" + ], + "arity": 3, "arguments": [ { - "name": "pattern", - "type": "pattern", - "display_text": "pattern", - "optional": true + "name": "mode", + "type": "oneof", + "arguments": [ + { + "name": "yes", + "type": "pure-token", + "display_text": "yes", + "token": "YES" + }, + { + "name": "sync", + "type": "pure-token", + "display_text": "sync", + "token": "SYNC" + }, + { + "name": "no", + "type": "pure-token", + "display_text": "no", + "token": "NO" + } + ] } ], "command_flags": [ - "pubsub", - "loading", - "stale" + "noscript" ] }, - "PUBSUB SHARDNUMSUB": { - "summary": "Returns the count of subscribers of shard channels.", - "since": "7.0.0", - "group": "pubsub", - "complexity": "O(N) for the SHARDNUMSUB subcommand, where N is the number of requested shard channels", + "SCRIPT EXISTS": { + "summary": "Determines whether server-side Lua scripts exist in the script cache.", + "since": "2.6.0", + "group": "scripting", + "complexity": "O(N) with N being the number of scripts to check (so checking a single script is an O(1) operation).", "acl_categories": [ - "@pubsub", - "@slow" + "@slow", + "@scripting" ], - "arity": -2, + "arity": -3, "arguments": [ { - "name": "shardchannel", + "name": "sha1", "type": "string", - "display_text": "shardchannel", - "optional": true, + "display_text": "sha1", "multiple": true } ], "command_flags": [ - "pubsub", - "loading", - "stale" + "noscript" + ], + "hints": [ + "request_policy:all_shards", + "response_policy:agg_logical_and" ] }, - "PUNSUBSCRIBE": { - "summary": "Stops listening to messages published to channels that match one or more patterns.", - "since": "2.0.0", - "group": "pubsub", - "complexity": "O(N) where N is the number of patterns to unsubscribe.", + "SCRIPT FLUSH": { + "summary": "Removes all server-side Lua scripts from the script cache.", + "since": "2.6.0", + "group": "scripting", + "complexity": "O(N) with N being the number of scripts in cache", + "history": [ + [ + "6.2.0", + "Added the `ASYNC` and `SYNC` flushing mode modifiers." + ] + ], "acl_categories": [ - "@pubsub", - "@slow" + "@slow", + "@scripting" ], - "arity": -1, + "arity": -2, "arguments": [ { - "name": "pattern", - "type": "pattern", - "display_text": "pattern", + "name": "flush-type", + "type": "oneof", + "since": "6.2.0", "optional": true, - "multiple": true + "arguments": [ + { + "name": "async", + "type": "pure-token", + "display_text": "async", + "token": "ASYNC" + }, + { + "name": "sync", + "type": "pure-token", + "display_text": "sync", + "token": "SYNC" + } + ] } ], "command_flags": [ - "pubsub", - "noscript", - "loading", - "stale" + "noscript" + ], + "hints": [ + "request_policy:all_nodes", + "response_policy:all_succeeded" ] }, - "QUIT": { - "summary": "Closes the connection.", - "since": "1.0.0", - "group": "connection", + "SCRIPT HELP": { + "summary": "Returns helpful text about the different subcommands.", + "since": "5.0.0", + "group": "scripting", "complexity": "O(1)", - "deprecated_since": "7.2.0", - "replaced_by": "just closing the connection", "acl_categories": [ - "@fast", - "@connection" + "@slow", + "@scripting" ], - "arity": -1, + "arity": 2, "command_flags": [ - "noscript", "loading", - "stale", - "fast", - "no_auth", - "allow_busy" - ], - "doc_flags": [ - "deprecated" + "stale" ] }, - "RANDOMKEY": { - "summary": "Returns a random key name from the database.", - "since": "1.0.0", - "group": "generic", + "SCRIPT KILL": { + "summary": "Terminates a server-side Lua script during execution.", + "since": "2.6.0", + "group": "scripting", "complexity": "O(1)", "acl_categories": [ - "@keyspace", - "@read", - "@slow" + "@slow", + "@scripting" ], - "arity": 1, + "arity": 2, "command_flags": [ - "readonly" + "noscript", + "allow_busy" ], "hints": [ "request_policy:all_shards", - "response_policy:special", - "nondeterministic_output" + "response_policy:one_succeeded" ] }, - "READONLY": { - "summary": "Enables read-only queries for a connection to a Redis Cluster replica node.", - "since": "3.0.0", - "group": "cluster", - "complexity": "O(1)", + "SCRIPT LOAD": { + "summary": "Loads a server-side Lua script to the script cache.", + "since": "2.6.0", + "group": "scripting", + "complexity": "O(N) with N being the length in bytes of the script body.", "acl_categories": [ - "@fast", - "@connection" + "@slow", + "@scripting" ], - "arity": 1, - "command_flags": [ - "loading", - "stale", - "fast" - ] - }, - "READWRITE": { - "summary": "Enables read-write queries for a connection to a Reids Cluster replica node.", - "since": "3.0.0", - "group": "cluster", - "complexity": "O(1)", - "acl_categories": [ - "@fast", - "@connection" + "arity": 3, + "arguments": [ + { + "name": "script", + "type": "string", + "display_text": "script" + } ], - "arity": 1, "command_flags": [ - "loading", - "stale", - "fast" + "noscript", + "stale" + ], + "hints": [ + "request_policy:all_nodes", + "response_policy:all_succeeded" ] }, - "RENAME": { - "summary": "Renames a key and overwrites the destination.", + "SDIFF": { + "summary": "Returns the difference of multiple sets.", "since": "1.0.0", - "group": "generic", - "complexity": "O(1)", + "group": "set", + "complexity": "O(N) where N is the total number of elements in all given sets.", "acl_categories": [ - "@keyspace", - "@write", + "@read", + "@set", "@slow" ], - "arity": 3, + "arity": -2, "key_specs": [ { "begin_search": { @@ -11911,69 +15033,42 @@ "find_keys": { "type": "range", "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "RW": true, - "access": true, - "delete": true - }, - { - "begin_search": { - "type": "index", - "spec": { - "index": 2 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, + "lastkey": -1, "keystep": 1, "limit": 0 } }, - "OW": true, - "update": true + "RO": true, + "access": true } ], "arguments": [ { "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 - }, - { - "name": "newkey", - "type": "key", - "display_text": "newkey", - "key_spec_index": 1 + "type": "key", + "display_text": "key", + "key_spec_index": 0, + "multiple": true } ], "command_flags": [ - "write" + "readonly" + ], + "hints": [ + "nondeterministic_output_order" ] }, - "RENAMENX": { - "summary": "Renames a key only when the target key name doesn't exist.", + "SDIFFSTORE": { + "summary": "Stores the difference of multiple sets in a key.", "since": "1.0.0", - "group": "generic", - "complexity": "O(1)", - "history": [ - [ - "3.2.0", - "The command no longer returns an error when source and destination names are the same." - ] - ], + "group": "set", + "complexity": "O(N) where N is the total number of elements in all given sets.", "acl_categories": [ - "@keyspace", "@write", - "@fast" + "@set", + "@slow" ], - "arity": 3, + "arity": -3, "key_specs": [ { "begin_search": { @@ -11990,9 +15085,8 @@ "limit": 0 } }, - "RW": true, - "access": true, - "delete": true + "OW": true, + "update": true }, { "begin_search": { @@ -12004,264 +15098,94 @@ "find_keys": { "type": "range", "spec": { - "lastkey": 0, + "lastkey": -1, "keystep": 1, "limit": 0 } }, - "OW": true, - "insert": true + "RO": true, + "access": true } ], "arguments": [ { - "name": "key", + "name": "destination", "type": "key", - "display_text": "key", + "display_text": "destination", "key_spec_index": 0 }, { - "name": "newkey", + "name": "key", "type": "key", - "display_text": "newkey", - "key_spec_index": 1 + "display_text": "key", + "key_spec_index": 1, + "multiple": true } ], "command_flags": [ "write", - "fast" - ] - }, - "REPLCONF": { - "summary": "An internal command for configuring the replication stream.", - "since": "3.0.0", - "group": "server", - "complexity": "O(1)", - "acl_categories": [ - "@admin", - "@slow", - "@dangerous" - ], - "arity": -1, - "command_flags": [ - "admin", - "noscript", - "loading", - "stale", - "allow_busy" - ], - "doc_flags": [ - "syscmd" - ] - }, - "REPLICAOF": { - "summary": "Configures a server as replica of another, or promotes it to a master.", - "since": "5.0.0", - "group": "server", - "complexity": "O(1)", - "acl_categories": [ - "@admin", - "@slow", - "@dangerous" - ], - "arity": 3, - "arguments": [ - { - "name": "args", - "type": "oneof", - "arguments": [ - { - "name": "host-port", - "type": "block", - "arguments": [ - { - "name": "host", - "type": "string", - "display_text": "host" - }, - { - "name": "port", - "type": "integer", - "display_text": "port" - } - ] - }, - { - "name": "no-one", - "type": "block", - "arguments": [ - { - "name": "no", - "type": "pure-token", - "display_text": "no", - "token": "NO" - }, - { - "name": "one", - "type": "pure-token", - "display_text": "one", - "token": "ONE" - } - ] - } - ] - } - ], - "command_flags": [ - "admin", - "noscript", - "stale", - "no_async_loading" + "denyoom" ] }, - "RESET": { - "summary": "Resets the connection.", - "since": "6.2.0", + "SELECT": { + "summary": "Changes the selected database.", + "since": "1.0.0", "group": "connection", "complexity": "O(1)", "acl_categories": [ "@fast", "@connection" ], - "arity": 1, - "command_flags": [ - "noscript", - "loading", - "stale", - "fast", - "no_auth", - "allow_busy" - ] - }, - "RESTORE": { - "summary": "Creates a key from the serialized representation of a value.", - "since": "2.6.0", - "group": "generic", - "complexity": "O(1) to create the new key and additional O(N*M) to reconstruct the serialized value, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1). However for sorted set values the complexity is O(N*M*log(N)) because inserting values into sorted sets is O(log(N)).", - "history": [ - [ - "3.0.0", - "Added the `REPLACE` modifier." - ], - [ - "5.0.0", - "Added the `ABSTTL` modifier." - ], - [ - "5.0.0", - "Added the `IDLETIME` and `FREQ` options." - ] - ], - "acl_categories": [ - "@keyspace", - "@write", - "@slow", - "@dangerous" - ], - "arity": -4, - "key_specs": [ - { - "begin_search": { - "type": "index", - "spec": { - "index": 1 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "OW": true, - "update": true - } - ], + "arity": 2, "arguments": [ { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 - }, - { - "name": "ttl", - "type": "integer", - "display_text": "ttl" - }, - { - "name": "serialized-value", - "type": "string", - "display_text": "serialized-value" - }, - { - "name": "replace", - "type": "pure-token", - "display_text": "replace", - "token": "REPLACE", - "since": "3.0.0", - "optional": true - }, - { - "name": "absttl", - "type": "pure-token", - "display_text": "absttl", - "token": "ABSTTL", - "since": "5.0.0", - "optional": true - }, - { - "name": "seconds", - "type": "integer", - "display_text": "seconds", - "token": "IDLETIME", - "since": "5.0.0", - "optional": true - }, - { - "name": "frequency", + "name": "index", "type": "integer", - "display_text": "frequency", - "token": "FREQ", - "since": "5.0.0", - "optional": true + "display_text": "index" } ], "command_flags": [ - "write", - "denyoom" - ] - }, - "RESTORE-ASKING": { - "summary": "An internal command for migrating keys in a cluster.", - "since": "3.0.0", - "group": "server", - "complexity": "O(1) to create the new key and additional O(N*M) to reconstruct the serialized value, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1). However for sorted set values the complexity is O(N*M*log(N)) because inserting values into sorted sets is O(log(N)).", + "loading", + "stale", + "fast" + ] + }, + "SET": { + "summary": "Sets the string value of a key, ignoring its type. The key is created if it doesn't exist.", + "since": "1.0.0", + "group": "string", + "complexity": "O(1)", "history": [ [ - "3.0.0", - "Added the `REPLACE` modifier." + "2.6.12", + "Added the `EX`, `PX`, `NX` and `XX` options." ], [ - "5.0.0", - "Added the `ABSTTL` modifier." + "6.0.0", + "Added the `KEEPTTL` option." ], [ - "5.0.0", - "Added the `IDLETIME` and `FREQ` options." + "6.2.0", + "Added the `GET`, `EXAT` and `PXAT` option." + ], + [ + "7.0.0", + "Allowed the `NX` and `GET` options to be used together." + ], + [ + "8.4.0", + "Added 'IFEQ', 'IFNE', 'IFDEQ', 'IFDNE' options." ] ], "acl_categories": [ - "@keyspace", "@write", - "@slow", - "@dangerous" + "@string", + "@slow" ], - "arity": -4, + "arity": -3, "key_specs": [ { + "notes": "RW and ACCESS due to the optional `GET` argument", "begin_search": { "type": "index", "spec": { @@ -12276,8 +15200,10 @@ "limit": 0 } }, - "OW": true, - "update": true + "RW": true, + "access": true, + "update": true, + "variable_flags": true } ], "arguments": [ @@ -12288,92 +15214,125 @@ "key_spec_index": 0 }, { - "name": "ttl", - "type": "integer", - "display_text": "ttl" - }, - { - "name": "serialized-value", + "name": "value", "type": "string", - "display_text": "serialized-value" + "display_text": "value" }, { - "name": "replace", - "type": "pure-token", - "display_text": "replace", - "token": "REPLACE", - "since": "3.0.0", - "optional": true + "name": "condition", + "type": "oneof", + "since": "2.6.12", + "optional": true, + "arguments": [ + { + "name": "nx", + "type": "pure-token", + "display_text": "nx", + "token": "NX" + }, + { + "name": "xx", + "type": "pure-token", + "display_text": "xx", + "token": "XX" + }, + { + "name": "ifeq-value", + "type": "string", + "display_text": "ifeq-value", + "token": "IFEQ", + "since": "8.4.0" + }, + { + "name": "ifne-value", + "type": "string", + "display_text": "ifne-value", + "token": "IFNE", + "since": "8.4.0" + }, + { + "name": "ifdeq-digest", + "type": "integer", + "display_text": "ifdeq-digest", + "token": "IFDEQ", + "since": "8.4.0" + }, + { + "name": "ifdne-digest", + "type": "integer", + "display_text": "ifdne-digest", + "token": "IFDNE", + "since": "8.4.0" + } + ] }, { - "name": "absttl", + "name": "get", "type": "pure-token", - "display_text": "absttl", - "token": "ABSTTL", - "since": "5.0.0", - "optional": true - }, - { - "name": "seconds", - "type": "integer", - "display_text": "seconds", - "token": "IDLETIME", - "since": "5.0.0", + "display_text": "get", + "token": "GET", + "since": "6.2.0", "optional": true }, { - "name": "frequency", - "type": "integer", - "display_text": "frequency", - "token": "FREQ", - "since": "5.0.0", - "optional": true + "name": "expiration", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "seconds", + "type": "integer", + "display_text": "seconds", + "token": "EX", + "since": "2.6.12" + }, + { + "name": "milliseconds", + "type": "integer", + "display_text": "milliseconds", + "token": "PX", + "since": "2.6.12" + }, + { + "name": "unix-time-seconds", + "type": "unix-time", + "display_text": "unix-time-seconds", + "token": "EXAT", + "since": "6.2.0" + }, + { + "name": "unix-time-milliseconds", + "type": "unix-time", + "display_text": "unix-time-milliseconds", + "token": "PXAT", + "since": "6.2.0" + }, + { + "name": "keepttl", + "type": "pure-token", + "display_text": "keepttl", + "token": "KEEPTTL", + "since": "6.0.0" + } + ] } ], "command_flags": [ "write", - "denyoom", - "asking" - ], - "doc_flags": [ - "syscmd" + "denyoom" ] }, - "ROLE": { - "summary": "Returns the replication role.", - "since": "2.8.12", - "group": "server", + "SETBIT": { + "summary": "Sets or clears the bit at offset of the string value. Creates the key if it doesn't exist.", + "since": "2.2.0", + "group": "bitmap", "complexity": "O(1)", - "acl_categories": [ - "@admin", - "@fast", - "@dangerous" - ], - "arity": 1, - "command_flags": [ - "noscript", - "loading", - "stale", - "fast" - ] - }, - "RPOP": { - "summary": "Returns and removes the last elements of a list. Deletes the list if the last element was popped.", - "since": "1.0.0", - "group": "list", - "complexity": "O(N) where N is the number of elements returned", - "history": [ - [ - "6.2.0", - "Added the `count` argument." - ] - ], "acl_categories": [ "@write", - "@list", - "@fast" + "@bitmap", + "@slow" ], - "arity": -2, + "arity": 4, "key_specs": [ { "begin_search": { @@ -12392,7 +15351,7 @@ }, "RW": true, "access": true, - "delete": true + "update": true } ], "arguments": [ @@ -12403,31 +15362,34 @@ "key_spec_index": 0 }, { - "name": "count", + "name": "offset", "type": "integer", - "display_text": "count", - "since": "6.2.0", - "optional": true + "display_text": "offset" + }, + { + "name": "value", + "type": "integer", + "display_text": "value" } ], "command_flags": [ "write", - "fast" + "denyoom" ] }, - "RPOPLPUSH": { - "summary": "Returns the last element of a list after removing and pushing it to another list. Deletes the list if the last element was popped.", - "since": "1.2.0", - "group": "list", + "SETEX": { + "summary": "Sets the string value and expiration time of a key. Creates the key if it doesn't exist.", + "since": "2.0.0", + "group": "string", "complexity": "O(1)", - "deprecated_since": "6.2.0", - "replaced_by": "`LMOVE` with the `RIGHT` and `LEFT` arguments", + "deprecated_since": "2.6.12", + "replaced_by": "`SET` with the `EX` argument", "acl_categories": [ "@write", - "@list", + "@string", "@slow" ], - "arity": 3, + "arity": 4, "key_specs": [ { "begin_search": { @@ -12444,15 +15406,55 @@ "limit": 0 } }, - "RW": true, - "access": true, - "delete": true + "OW": true, + "update": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "seconds", + "type": "integer", + "display_text": "seconds" }, + { + "name": "value", + "type": "string", + "display_text": "value" + } + ], + "command_flags": [ + "write", + "denyoom" + ], + "doc_flags": [ + "deprecated" + ] + }, + "SETNX": { + "summary": "Set the string value of a key only when the key doesn't exist.", + "since": "1.0.0", + "group": "string", + "complexity": "O(1)", + "deprecated_since": "2.6.12", + "replaced_by": "`SET` with the `NX` argument", + "acl_categories": [ + "@write", + "@string", + "@fast" + ], + "arity": 3, + "key_specs": [ { "begin_search": { "type": "index", "spec": { - "index": 2 + "index": 1 } }, "find_keys": { @@ -12463,49 +15465,43 @@ "limit": 0 } }, - "RW": true, + "OW": true, "insert": true } ], "arguments": [ { - "name": "source", + "name": "key", "type": "key", - "display_text": "source", + "display_text": "key", "key_spec_index": 0 }, { - "name": "destination", - "type": "key", - "display_text": "destination", - "key_spec_index": 1 + "name": "value", + "type": "string", + "display_text": "value" } ], "command_flags": [ "write", - "denyoom" + "denyoom", + "fast" ], "doc_flags": [ "deprecated" ] }, - "RPUSH": { - "summary": "Appends one or more elements to a list. Creates the key if it doesn't exist.", - "since": "1.0.0", - "group": "list", - "complexity": "O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.", - "history": [ - [ - "2.4.0", - "Accepts multiple `element` arguments." - ] - ], + "SETRANGE": { + "summary": "Overwrites a part of a string value with another by an offset. Creates the key if it doesn't exist.", + "since": "2.2.0", + "group": "string", + "complexity": "O(1), not counting the time taken to copy the new string in place. Usually, this string is very small so the amortized complexity is O(1). Otherwise, complexity is O(M) with M being the length of the value argument.", "acl_categories": [ "@write", - "@list", - "@fast" + "@string", + "@slow" ], - "arity": -3, + "arity": 4, "key_specs": [ { "begin_search": { @@ -12523,7 +15519,7 @@ } }, "RW": true, - "insert": true + "update": true } ], "arguments": [ @@ -12534,35 +15530,103 @@ "key_spec_index": 0 }, { - "name": "element", + "name": "offset", + "type": "integer", + "display_text": "offset" + }, + { + "name": "value", "type": "string", - "display_text": "element", - "multiple": true + "display_text": "value" } ], "command_flags": [ "write", - "denyoom", - "fast" + "denyoom" ] }, - "RPUSHX": { - "summary": "Appends an element to a list only when the list exists.", - "since": "2.2.0", - "group": "list", - "complexity": "O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.", + "SHUTDOWN": { + "summary": "Synchronously saves the database(s) to disk and shuts down the Redis server.", + "since": "1.0.0", + "group": "server", + "complexity": "O(N) when saving, where N is the total number of keys in all databases when saving data, otherwise O(1)", "history": [ [ - "4.0.0", - "Accepts multiple `element` arguments." + "7.0.0", + "Added the `NOW`, `FORCE` and `ABORT` modifiers." ] ], "acl_categories": [ - "@write", - "@list", - "@fast" + "@admin", + "@slow", + "@dangerous" ], - "arity": -3, + "arity": -1, + "arguments": [ + { + "name": "save-selector", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "nosave", + "type": "pure-token", + "display_text": "nosave", + "token": "NOSAVE" + }, + { + "name": "save", + "type": "pure-token", + "display_text": "save", + "token": "SAVE" + } + ] + }, + { + "name": "now", + "type": "pure-token", + "display_text": "now", + "token": "NOW", + "since": "7.0.0", + "optional": true + }, + { + "name": "force", + "type": "pure-token", + "display_text": "force", + "token": "FORCE", + "since": "7.0.0", + "optional": true + }, + { + "name": "abort", + "type": "pure-token", + "display_text": "abort", + "token": "ABORT", + "since": "7.0.0", + "optional": true + } + ], + "command_flags": [ + "admin", + "noscript", + "loading", + "stale", + "no_multi", + "allow_busy" + ] + }, + "SINTER": { + "summary": "Returns the intersect of multiple sets.", + "since": "1.0.0", + "group": "set", + "complexity": "O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets.", + "acl_categories": [ + "@read", + "@set", + "@slow" + ], + "arity": -2, "key_specs": [ { "begin_search": { @@ -12574,13 +15638,13 @@ "find_keys": { "type": "range", "spec": { - "lastkey": 0, + "lastkey": -1, "keystep": 1, "limit": 0 } }, - "RW": true, - "insert": true + "RO": true, + "access": true } ], "arguments": [ @@ -12588,36 +15652,26 @@ "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0 - }, - { - "name": "element", - "type": "string", - "display_text": "element", + "key_spec_index": 0, "multiple": true } ], "command_flags": [ - "write", - "denyoom", - "fast" + "readonly" + ], + "hints": [ + "nondeterministic_output_order" ] }, - "SADD": { - "summary": "Adds one or more members to a set. Creates the key if it doesn't exist.", - "since": "1.0.0", + "SINTERCARD": { + "summary": "Returns the number of members of the intersect of multiple sets.", + "since": "7.0.0", "group": "set", - "complexity": "O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.", - "history": [ - [ - "2.4.0", - "Accepts multiple `member` arguments." - ] - ], + "complexity": "O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets.", "acl_categories": [ - "@write", + "@read", "@set", - "@fast" + "@slow" ], "arity": -3, "key_specs": [ @@ -12629,112 +15683,114 @@ } }, "find_keys": { - "type": "range", + "type": "keynum", "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 + "keynumidx": 0, + "firstkey": 1, + "keystep": 1 } }, - "RW": true, - "insert": true + "RO": true, + "access": true } ], "arguments": [ + { + "name": "numkeys", + "type": "integer", + "display_text": "numkeys" + }, { "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0 + "key_spec_index": 0, + "multiple": true }, { - "name": "member", - "type": "string", - "display_text": "member", - "multiple": true + "name": "limit", + "type": "integer", + "display_text": "limit", + "token": "LIMIT", + "optional": true } ], "command_flags": [ - "write", - "denyoom", - "fast" + "readonly", + "movablekeys" ] }, - "SAVE": { - "summary": "Synchronously saves the database(s) to disk.", + "SINTERSTORE": { + "summary": "Stores the intersect of multiple sets in a key.", "since": "1.0.0", - "group": "server", - "complexity": "O(N) where N is the total number of keys in all databases", - "acl_categories": [ - "@admin", - "@slow", - "@dangerous" - ], - "arity": 1, - "command_flags": [ - "admin", - "noscript", - "no_async_loading", - "no_multi" - ] - }, - "SCAN": { - "summary": "Iterates over the key names in the database.", - "since": "2.8.0", - "group": "generic", - "complexity": "O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection.", - "history": [ - [ - "6.0.0", - "Added the `TYPE` subcommand." - ] - ], + "group": "set", + "complexity": "O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets.", "acl_categories": [ - "@keyspace", - "@read", + "@write", + "@set", "@slow" ], - "arity": -2, - "arguments": [ + "arity": -3, + "key_specs": [ { - "name": "cursor", - "type": "integer", - "display_text": "cursor" + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "OW": true, + "update": true }, { - "name": "pattern", - "type": "pattern", - "display_text": "pattern", - "token": "MATCH", - "optional": true - }, + "begin_search": { + "type": "index", + "spec": { + "index": 2 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": -1, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ { - "name": "count", - "type": "integer", - "display_text": "count", - "token": "COUNT", - "optional": true + "name": "destination", + "type": "key", + "display_text": "destination", + "key_spec_index": 0 }, { - "name": "type", - "type": "string", - "display_text": "type", - "token": "TYPE", - "since": "6.0.0", - "optional": true + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 1, + "multiple": true } ], "command_flags": [ - "readonly" - ], - "hints": [ - "nondeterministic_output", - "request_policy:special", - "response_policy:special" + "write", + "denyoom" ] }, - "SCARD": { - "summary": "Returns the number of members in a set.", + "SISMEMBER": { + "summary": "Determines whether a member belongs to a set.", "since": "1.0.0", "group": "set", "complexity": "O(1)", @@ -12743,7 +15799,7 @@ "@set", "@fast" ], - "arity": 2, + "arity": 3, "key_specs": [ { "begin_search": { @@ -12769,6 +15825,11 @@ "type": "key", "display_text": "key", "key_spec_index": 0 + }, + { + "name": "member", + "type": "string", + "display_text": "member" } ], "command_flags": [ @@ -12776,136 +15837,123 @@ "fast" ] }, - "SCRIPT": { - "summary": "A container for Lua scripts management commands.", - "since": "2.6.0", - "group": "scripting", - "complexity": "Depends on subcommand.", - "acl_categories": [ - "@slow" - ], - "arity": -2 - }, - "SCRIPT DEBUG": { - "summary": "Sets the debug mode of server-side Lua scripts.", - "since": "3.2.0", - "group": "scripting", + "SLAVEOF": { + "summary": "Sets a Redis server as a replica of another, or promotes it to being a master.", + "since": "1.0.0", + "group": "server", "complexity": "O(1)", + "deprecated_since": "5.0.0", + "replaced_by": "`REPLICAOF`", "acl_categories": [ + "@admin", "@slow", - "@scripting" + "@dangerous" ], "arity": 3, "arguments": [ { - "name": "mode", + "name": "args", "type": "oneof", "arguments": [ { - "name": "yes", - "type": "pure-token", - "display_text": "yes", - "token": "YES" - }, - { - "name": "sync", - "type": "pure-token", - "display_text": "sync", - "token": "SYNC" + "name": "host-port", + "type": "block", + "arguments": [ + { + "name": "host", + "type": "string", + "display_text": "host" + }, + { + "name": "port", + "type": "integer", + "display_text": "port" + } + ] }, { - "name": "no", - "type": "pure-token", - "display_text": "no", - "token": "NO" + "name": "no-one", + "type": "block", + "arguments": [ + { + "name": "no", + "type": "pure-token", + "display_text": "no", + "token": "NO" + }, + { + "name": "one", + "type": "pure-token", + "display_text": "one", + "token": "ONE" + } + ] } ] } ], "command_flags": [ - "noscript" + "admin", + "noscript", + "stale", + "no_async_loading" + ], + "doc_flags": [ + "deprecated" ] }, - "SCRIPT EXISTS": { - "summary": "Determines whether server-side Lua scripts exist in the script cache.", - "since": "2.6.0", - "group": "scripting", - "complexity": "O(N) with N being the number of scripts to check (so checking a single script is an O(1) operation).", + "SLOWLOG": { + "summary": "A container for slow log commands.", + "since": "2.2.12", + "group": "server", + "complexity": "Depends on subcommand.", "acl_categories": [ - "@slow", - "@scripting" - ], - "arity": -3, - "arguments": [ - { - "name": "sha1", - "type": "string", - "display_text": "sha1", - "multiple": true - } - ], - "command_flags": [ - "noscript" + "@slow" ], - "hints": [ - "request_policy:all_shards", - "response_policy:agg_logical_and" - ] + "arity": -2 }, - "SCRIPT FLUSH": { - "summary": "Removes all server-side Lua scripts from the script cache.", - "since": "2.6.0", - "group": "scripting", - "complexity": "O(N) with N being the number of scripts in cache", + "SLOWLOG GET": { + "summary": "Returns the slow log's entries.", + "since": "2.2.12", + "group": "server", + "complexity": "O(N) where N is the number of entries returned", "history": [ [ - "6.2.0", - "Added the `ASYNC` and `SYNC` flushing mode modifiers." + "4.0.0", + "Added client IP address, port and name to the reply." ] ], "acl_categories": [ + "@admin", "@slow", - "@scripting" + "@dangerous" ], "arity": -2, "arguments": [ { - "name": "flush-type", - "type": "oneof", - "since": "6.2.0", - "optional": true, - "arguments": [ - { - "name": "async", - "type": "pure-token", - "display_text": "async", - "token": "ASYNC" - }, - { - "name": "sync", - "type": "pure-token", - "display_text": "sync", - "token": "SYNC" - } - ] + "name": "count", + "type": "integer", + "display_text": "count", + "optional": true } ], "command_flags": [ - "noscript" + "admin", + "loading", + "stale" ], "hints": [ "request_policy:all_nodes", - "response_policy:all_succeeded" + "nondeterministic_output" ] }, - "SCRIPT HELP": { - "summary": "Returns helpful text about the different subcommands.", - "since": "5.0.0", - "group": "scripting", + "SLOWLOG HELP": { + "summary": "Show helpful text about the different subcommands", + "since": "6.2.0", + "group": "server", "complexity": "O(1)", "acl_categories": [ - "@slow", - "@scripting" + "@slow" ], "arity": 2, "command_flags": [ @@ -12913,44 +15961,42 @@ "stale" ] }, - "SCRIPT KILL": { - "summary": "Terminates a server-side Lua script during execution.", - "since": "2.6.0", - "group": "scripting", + "SLOWLOG LEN": { + "summary": "Returns the number of entries in the slow log.", + "since": "2.2.12", + "group": "server", "complexity": "O(1)", "acl_categories": [ + "@admin", "@slow", - "@scripting" + "@dangerous" ], "arity": 2, "command_flags": [ - "noscript", - "allow_busy" + "admin", + "loading", + "stale" ], "hints": [ - "request_policy:all_shards", - "response_policy:one_succeeded" + "request_policy:all_nodes", + "response_policy:agg_sum", + "nondeterministic_output" ] }, - "SCRIPT LOAD": { - "summary": "Loads a server-side Lua script to the script cache.", - "since": "2.6.0", - "group": "scripting", - "complexity": "O(N) with N being the length in bytes of the script body.", + "SLOWLOG RESET": { + "summary": "Clears all entries from the slow log.", + "since": "2.2.12", + "group": "server", + "complexity": "O(N) where N is the number of entries in the slowlog", "acl_categories": [ + "@admin", "@slow", - "@scripting" - ], - "arity": 3, - "arguments": [ - { - "name": "script", - "type": "string", - "display_text": "script" - } + "@dangerous" ], + "arity": 2, "command_flags": [ - "noscript", + "admin", + "loading", "stale" ], "hints": [ @@ -12958,17 +16004,17 @@ "response_policy:all_succeeded" ] }, - "SDIFF": { - "summary": "Returns the difference of multiple sets.", + "SMEMBERS": { + "summary": "Returns all members of a set.", "since": "1.0.0", "group": "set", - "complexity": "O(N) where N is the total number of elements in all given sets.", + "complexity": "O(N) where N is the set cardinality.", "acl_categories": [ "@read", "@set", "@slow" ], - "arity": -2, + "arity": 2, "key_specs": [ { "begin_search": { @@ -12980,7 +16026,7 @@ "find_keys": { "type": "range", "spec": { - "lastkey": -1, + "lastkey": 0, "keystep": 1, "limit": 0 } @@ -12994,8 +16040,7 @@ "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0, - "multiple": true + "key_spec_index": 0 } ], "command_flags": [ @@ -13005,15 +16050,15 @@ "nondeterministic_output_order" ] }, - "SDIFFSTORE": { - "summary": "Stores the difference of multiple sets in a key.", - "since": "1.0.0", + "SMISMEMBER": { + "summary": "Determines whether multiple members belong to a set.", + "since": "6.2.0", "group": "set", - "complexity": "O(N) where N is the total number of elements in all given sets.", + "complexity": "O(N) where N is the number of elements being checked for membership", "acl_categories": [ - "@write", + "@read", "@set", - "@slow" + "@fast" ], "arity": -3, "key_specs": [ @@ -13032,103 +16077,42 @@ "limit": 0 } }, - "OW": true, - "update": true - }, - { - "begin_search": { - "type": "index", - "spec": { - "index": 2 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": -1, - "keystep": 1, - "limit": 0 - } - }, "RO": true, "access": true } ], "arguments": [ { - "name": "destination", + "name": "key", "type": "key", - "display_text": "destination", + "display_text": "key", "key_spec_index": 0 }, { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 1, + "name": "member", + "type": "string", + "display_text": "member", "multiple": true } ], "command_flags": [ - "write", - "denyoom" - ] - }, - "SELECT": { - "summary": "Changes the selected database.", - "since": "1.0.0", - "group": "connection", - "complexity": "O(1)", - "acl_categories": [ - "@fast", - "@connection" - ], - "arity": 2, - "arguments": [ - { - "name": "index", - "type": "integer", - "display_text": "index" - } - ], - "command_flags": [ - "loading", - "stale", + "readonly", "fast" ] }, - "SET": { - "summary": "Sets the string value of a key, ignoring its type. The key is created if it doesn't exist.", + "SMOVE": { + "summary": "Moves a member from one set to another.", "since": "1.0.0", - "group": "string", + "group": "set", "complexity": "O(1)", - "history": [ - [ - "2.6.12", - "Added the `EX`, `PX`, `NX` and `XX` options." - ], - [ - "6.0.0", - "Added the `KEEPTTL` option." - ], - [ - "6.2.0", - "Added the `GET`, `EXAT` and `PXAT` option." - ], - [ - "7.0.0", - "Allowed the `NX` and `GET` options to be used together." - ] - ], "acl_categories": [ "@write", - "@string", - "@slow" + "@set", + "@fast" ], - "arity": -3, + "arity": 4, "key_specs": [ { - "notes": "RW and ACCESS due to the optional `GET` argument", "begin_search": { "type": "index", "spec": { @@ -13145,109 +16129,65 @@ }, "RW": true, "access": true, - "update": true, - "variable_flags": true + "delete": true + }, + { + "begin_search": { + "type": "index", + "spec": { + "index": 2 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "insert": true } ], "arguments": [ { - "name": "key", + "name": "source", "type": "key", - "display_text": "key", + "display_text": "source", "key_spec_index": 0 - }, - { - "name": "value", - "type": "string", - "display_text": "value" - }, - { - "name": "condition", - "type": "oneof", - "since": "2.6.12", - "optional": true, - "arguments": [ - { - "name": "nx", - "type": "pure-token", - "display_text": "nx", - "token": "NX" - }, - { - "name": "xx", - "type": "pure-token", - "display_text": "xx", - "token": "XX" - } - ] - }, - { - "name": "get", - "type": "pure-token", - "display_text": "get", - "token": "GET", - "since": "6.2.0", - "optional": true - }, - { - "name": "expiration", - "type": "oneof", - "optional": true, - "arguments": [ - { - "name": "seconds", - "type": "integer", - "display_text": "seconds", - "token": "EX", - "since": "2.6.12" - }, - { - "name": "milliseconds", - "type": "integer", - "display_text": "milliseconds", - "token": "PX", - "since": "2.6.12" - }, - { - "name": "unix-time-seconds", - "type": "unix-time", - "display_text": "unix-time-seconds", - "token": "EXAT", - "since": "6.2.0" - }, - { - "name": "unix-time-milliseconds", - "type": "unix-time", - "display_text": "unix-time-milliseconds", - "token": "PXAT", - "since": "6.2.0" - }, - { - "name": "keepttl", - "type": "pure-token", - "display_text": "keepttl", - "token": "KEEPTTL", - "since": "6.0.0" - } - ] + }, + { + "name": "destination", + "type": "key", + "display_text": "destination", + "key_spec_index": 1 + }, + { + "name": "member", + "type": "string", + "display_text": "member" } ], "command_flags": [ "write", - "denyoom" + "fast" ] }, - "SETBIT": { - "summary": "Sets or clears the bit at offset of the string value. Creates the key if it doesn't exist.", - "since": "2.2.0", - "group": "bitmap", - "complexity": "O(1)", + "SORT": { + "summary": "Sorts the elements in a list, a set, or a sorted set, optionally storing the result.", + "since": "1.0.0", + "group": "generic", + "complexity": "O(N+M*log(M)) where N is the number of elements in the list or set to sort, and M the number of returned elements. When the elements are not sorted, complexity is O(N).", "acl_categories": [ "@write", - "@bitmap", - "@slow" + "@set", + "@sortedset", + "@list", + "@slow", + "@dangerous" ], - "arity": 4, + "arity": -2, "key_specs": [ { "begin_search": { @@ -13264,8 +16204,33 @@ "limit": 0 } }, - "RW": true, - "access": true, + "RO": true, + "access": true + }, + { + "notes": "For the optional BY/GET keyword. It is marked 'unknown' because the key names derive from the content of the key we sort", + "begin_search": { + "type": "unknown", + "spec": {} + }, + "find_keys": { + "type": "unknown", + "spec": {} + }, + "RO": true, + "access": true + }, + { + "notes": "For the optional STORE keyword. It is marked 'unknown' because the keyword can appear anywhere in the argument array", + "begin_search": { + "type": "unknown", + "spec": {} + }, + "find_keys": { + "type": "unknown", + "spec": {} + }, + "OW": true, "update": true } ], @@ -13277,34 +16242,96 @@ "key_spec_index": 0 }, { - "name": "offset", - "type": "integer", - "display_text": "offset" + "name": "by-pattern", + "type": "pattern", + "display_text": "pattern", + "key_spec_index": 1, + "token": "BY", + "optional": true }, { - "name": "value", - "type": "integer", - "display_text": "value" + "name": "limit", + "type": "block", + "token": "LIMIT", + "optional": true, + "arguments": [ + { + "name": "offset", + "type": "integer", + "display_text": "offset" + }, + { + "name": "count", + "type": "integer", + "display_text": "count" + } + ] + }, + { + "name": "get-pattern", + "type": "pattern", + "display_text": "pattern", + "key_spec_index": 1, + "token": "GET", + "optional": true, + "multiple": true, + "multiple_token": true + }, + { + "name": "order", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "asc", + "type": "pure-token", + "display_text": "asc", + "token": "ASC" + }, + { + "name": "desc", + "type": "pure-token", + "display_text": "desc", + "token": "DESC" + } + ] + }, + { + "name": "sorting", + "type": "pure-token", + "display_text": "sorting", + "token": "ALPHA", + "optional": true + }, + { + "name": "destination", + "type": "key", + "display_text": "destination", + "key_spec_index": 2, + "token": "STORE", + "optional": true } ], "command_flags": [ "write", - "denyoom" + "denyoom", + "movablekeys" ] }, - "SETEX": { - "summary": "Sets the string value and expiration time of a key. Creates the key if it doesn't exist.", - "since": "2.0.0", - "group": "string", - "complexity": "O(1)", - "deprecated_since": "2.6.12", - "replaced_by": "`SET` with the `EX` argument", + "SORT_RO": { + "summary": "Returns the sorted elements of a list, a set, or a sorted set.", + "since": "7.0.0", + "group": "generic", + "complexity": "O(N+M*log(M)) where N is the number of elements in the list or set to sort, and M the number of returned elements. When the elements are not sorted, complexity is O(N).", "acl_categories": [ - "@write", - "@string", - "@slow" + "@read", + "@set", + "@sortedset", + "@list", + "@slow", + "@dangerous" ], - "arity": 4, + "arity": -2, "key_specs": [ { "begin_search": { @@ -13321,8 +16348,21 @@ "limit": 0 } }, - "OW": true, - "update": true + "RO": true, + "access": true + }, + { + "notes": "For the optional BY/GET keyword. It is marked 'unknown' because the key names derive from the content of the key we sort", + "begin_search": { + "type": "unknown", + "spec": {} + }, + "find_keys": { + "type": "unknown", + "spec": {} + }, + "RO": true, + "access": true } ], "arguments": [ @@ -13333,37 +16373,90 @@ "key_spec_index": 0 }, { - "name": "seconds", - "type": "integer", - "display_text": "seconds" + "name": "by-pattern", + "type": "pattern", + "display_text": "pattern", + "key_spec_index": 1, + "token": "BY", + "optional": true }, { - "name": "value", - "type": "string", - "display_text": "value" + "name": "limit", + "type": "block", + "token": "LIMIT", + "optional": true, + "arguments": [ + { + "name": "offset", + "type": "integer", + "display_text": "offset" + }, + { + "name": "count", + "type": "integer", + "display_text": "count" + } + ] + }, + { + "name": "get-pattern", + "type": "pattern", + "display_text": "pattern", + "key_spec_index": 1, + "token": "GET", + "optional": true, + "multiple": true, + "multiple_token": true + }, + { + "name": "order", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "asc", + "type": "pure-token", + "display_text": "asc", + "token": "ASC" + }, + { + "name": "desc", + "type": "pure-token", + "display_text": "desc", + "token": "DESC" + } + ] + }, + { + "name": "sorting", + "type": "pure-token", + "display_text": "sorting", + "token": "ALPHA", + "optional": true } ], "command_flags": [ - "write", - "denyoom" + "readonly", + "movablekeys" + ] + }, + "SPOP": { + "summary": "Returns one or more random members from a set after removing them. Deletes the set if the last member was popped.", + "since": "1.0.0", + "group": "set", + "complexity": "Without the count argument O(1), otherwise O(N) where N is the value of the passed count.", + "history": [ + [ + "3.2.0", + "Added the `count` argument." + ] ], - "doc_flags": [ - "deprecated" - ] - }, - "SETNX": { - "summary": "Set the string value of a key only when the key doesn't exist.", - "since": "1.0.0", - "group": "string", - "complexity": "O(1)", - "deprecated_since": "2.6.12", - "replaced_by": "`SET` with the `NX` argument", "acl_categories": [ "@write", - "@string", + "@set", "@fast" ], - "arity": 3, + "arity": -2, "key_specs": [ { "begin_search": { @@ -13380,8 +16473,9 @@ "limit": 0 } }, - "OW": true, - "insert": true + "RW": true, + "access": true, + "delete": true } ], "arguments": [ @@ -13392,31 +16486,31 @@ "key_spec_index": 0 }, { - "name": "value", - "type": "string", - "display_text": "value" + "name": "count", + "type": "integer", + "display_text": "count", + "since": "3.2.0", + "optional": true } ], "command_flags": [ "write", - "denyoom", "fast" ], - "doc_flags": [ - "deprecated" + "hints": [ + "nondeterministic_output" ] }, - "SETRANGE": { - "summary": "Overwrites a part of a string value with another by an offset. Creates the key if it doesn't exist.", - "since": "2.2.0", - "group": "string", - "complexity": "O(1), not counting the time taken to copy the new string in place. Usually, this string is very small so the amortized complexity is O(1). Otherwise, complexity is O(M) with M being the length of the value argument.", + "SPUBLISH": { + "summary": "Post a message to a shard channel", + "since": "7.0.0", + "group": "pubsub", + "complexity": "O(N) where N is the number of clients subscribed to the receiving shard channel.", "acl_categories": [ - "@write", - "@string", - "@slow" + "@pubsub", + "@fast" ], - "arity": 4, + "arity": 3, "key_specs": [ { "begin_search": { @@ -13433,109 +16527,39 @@ "limit": 0 } }, - "RW": true, - "update": true + "not_key": true } ], "arguments": [ { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 - }, - { - "name": "offset", - "type": "integer", - "display_text": "offset" + "name": "shardchannel", + "type": "string", + "display_text": "shardchannel" }, { - "name": "value", + "name": "message", "type": "string", - "display_text": "value" + "display_text": "message" } ], "command_flags": [ - "write", - "denyoom" + "pubsub", + "loading", + "stale", + "fast" ] }, - "SHUTDOWN": { - "summary": "Synchronously saves the database(s) to disk and shuts down the Redis server.", + "SRANDMEMBER": { + "summary": "Get one or multiple random members from a set", "since": "1.0.0", - "group": "server", - "complexity": "O(N) when saving, where N is the total number of keys in all databases when saving data, otherwise O(1)", + "group": "set", + "complexity": "Without the count argument O(1), otherwise O(N) where N is the absolute value of the passed count.", "history": [ [ - "7.0.0", - "Added the `NOW`, `FORCE` and `ABORT` modifiers." + "2.6.0", + "Added the optional `count` argument." ] ], - "acl_categories": [ - "@admin", - "@slow", - "@dangerous" - ], - "arity": -1, - "arguments": [ - { - "name": "save-selector", - "type": "oneof", - "optional": true, - "arguments": [ - { - "name": "nosave", - "type": "pure-token", - "display_text": "nosave", - "token": "NOSAVE" - }, - { - "name": "save", - "type": "pure-token", - "display_text": "save", - "token": "SAVE" - } - ] - }, - { - "name": "now", - "type": "pure-token", - "display_text": "now", - "token": "NOW", - "since": "7.0.0", - "optional": true - }, - { - "name": "force", - "type": "pure-token", - "display_text": "force", - "token": "FORCE", - "since": "7.0.0", - "optional": true - }, - { - "name": "abort", - "type": "pure-token", - "display_text": "abort", - "token": "ABORT", - "since": "7.0.0", - "optional": true - } - ], - "command_flags": [ - "admin", - "noscript", - "loading", - "stale", - "no_multi", - "allow_busy" - ] - }, - "SINTER": { - "summary": "Returns the intersect of multiple sets.", - "since": "1.0.0", - "group": "set", - "complexity": "O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets.", "acl_categories": [ "@read", "@set", @@ -13553,7 +16577,7 @@ "find_keys": { "type": "range", "spec": { - "lastkey": -1, + "lastkey": 0, "keystep": 1, "limit": 0 } @@ -13567,83 +16591,38 @@ "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0, - "multiple": true - } - ], - "command_flags": [ - "readonly" - ], - "hints": [ - "nondeterministic_output_order" - ] - }, - "SINTERCARD": { - "summary": "Returns the number of members of the intersect of multiple sets.", - "since": "7.0.0", - "group": "set", - "complexity": "O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets.", - "acl_categories": [ - "@read", - "@set", - "@slow" - ], - "arity": -3, - "key_specs": [ - { - "begin_search": { - "type": "index", - "spec": { - "index": 1 - } - }, - "find_keys": { - "type": "keynum", - "spec": { - "keynumidx": 0, - "firstkey": 1, - "keystep": 1 - } - }, - "RO": true, - "access": true - } - ], - "arguments": [ - { - "name": "numkeys", - "type": "integer", - "display_text": "numkeys" - }, - { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0, - "multiple": true + "key_spec_index": 0 }, { - "name": "limit", + "name": "count", "type": "integer", - "display_text": "limit", - "token": "LIMIT", + "display_text": "count", + "since": "2.6.0", "optional": true } ], "command_flags": [ - "readonly", - "movablekeys" + "readonly" + ], + "hints": [ + "nondeterministic_output" ] }, - "SINTERSTORE": { - "summary": "Stores the intersect of multiple sets in a key.", + "SREM": { + "summary": "Removes one or more members from a set. Deletes the set if the last member was removed.", "since": "1.0.0", "group": "set", - "complexity": "O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets.", + "complexity": "O(N) where N is the number of members to be removed.", + "history": [ + [ + "2.4.0", + "Accepts multiple `member` arguments." + ] + ], "acl_categories": [ "@write", "@set", - "@slow" + "@fast" ], "arity": -3, "key_specs": [ @@ -13661,60 +16640,41 @@ "keystep": 1, "limit": 0 } - }, - "OW": true, - "update": true - }, - { - "begin_search": { - "type": "index", - "spec": { - "index": 2 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": -1, - "keystep": 1, - "limit": 0 - } - }, - "RO": true, - "access": true + }, + "RW": true, + "delete": true } ], "arguments": [ { - "name": "destination", + "name": "key", "type": "key", - "display_text": "destination", + "display_text": "key", "key_spec_index": 0 }, { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 1, + "name": "member", + "type": "string", + "display_text": "member", "multiple": true } ], "command_flags": [ "write", - "denyoom" + "fast" ] }, - "SISMEMBER": { - "summary": "Determines whether a member belongs to a set.", - "since": "1.0.0", + "SSCAN": { + "summary": "Iterates over members of a set.", + "since": "2.8.0", "group": "set", - "complexity": "O(1)", + "complexity": "O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection.", "acl_categories": [ "@read", "@set", - "@fast" + "@slow" ], - "arity": 3, + "arity": -3, "key_specs": [ { "begin_search": { @@ -13731,7 +16691,8 @@ "limit": 0 } }, - "RO": true + "RO": true, + "access": true } ], "arguments": [ @@ -13742,194 +16703,42 @@ "key_spec_index": 0 }, { - "name": "member", - "type": "string", - "display_text": "member" - } - ], - "command_flags": [ - "readonly", - "fast" - ] - }, - "SLAVEOF": { - "summary": "Sets a Redis server as a replica of another, or promotes it to being a master.", - "since": "1.0.0", - "group": "server", - "complexity": "O(1)", - "deprecated_since": "5.0.0", - "replaced_by": "`REPLICAOF`", - "acl_categories": [ - "@admin", - "@slow", - "@dangerous" - ], - "arity": 3, - "arguments": [ + "name": "cursor", + "type": "integer", + "display_text": "cursor" + }, { - "name": "args", - "type": "oneof", - "arguments": [ - { - "name": "host-port", - "type": "block", - "arguments": [ - { - "name": "host", - "type": "string", - "display_text": "host" - }, - { - "name": "port", - "type": "integer", - "display_text": "port" - } - ] - }, - { - "name": "no-one", - "type": "block", - "arguments": [ - { - "name": "no", - "type": "pure-token", - "display_text": "no", - "token": "NO" - }, - { - "name": "one", - "type": "pure-token", - "display_text": "one", - "token": "ONE" - } - ] - } - ] - } - ], - "command_flags": [ - "admin", - "noscript", - "stale", - "no_async_loading" - ], - "doc_flags": [ - "deprecated" - ] - }, - "SLOWLOG": { - "summary": "A container for slow log commands.", - "since": "2.2.12", - "group": "server", - "complexity": "Depends on subcommand.", - "acl_categories": [ - "@slow" - ], - "arity": -2 - }, - "SLOWLOG GET": { - "summary": "Returns the slow log's entries.", - "since": "2.2.12", - "group": "server", - "complexity": "O(N) where N is the number of entries returned", - "history": [ - [ - "4.0.0", - "Added client IP address, port and name to the reply." - ] - ], - "acl_categories": [ - "@admin", - "@slow", - "@dangerous" - ], - "arity": -2, - "arguments": [ + "name": "pattern", + "type": "pattern", + "display_text": "pattern", + "token": "MATCH", + "optional": true + }, { "name": "count", "type": "integer", "display_text": "count", + "token": "COUNT", "optional": true } ], "command_flags": [ - "admin", - "loading", - "stale" - ], - "hints": [ - "request_policy:all_nodes", - "nondeterministic_output" - ] - }, - "SLOWLOG HELP": { - "summary": "Show helpful text about the different subcommands", - "since": "6.2.0", - "group": "server", - "complexity": "O(1)", - "acl_categories": [ - "@slow" - ], - "arity": 2, - "command_flags": [ - "loading", - "stale" - ] - }, - "SLOWLOG LEN": { - "summary": "Returns the number of entries in the slow log.", - "since": "2.2.12", - "group": "server", - "complexity": "O(1)", - "acl_categories": [ - "@admin", - "@slow", - "@dangerous" - ], - "arity": 2, - "command_flags": [ - "admin", - "loading", - "stale" + "readonly" ], "hints": [ - "request_policy:all_nodes", - "response_policy:agg_sum", "nondeterministic_output" ] }, - "SLOWLOG RESET": { - "summary": "Clears all entries from the slow log.", - "since": "2.2.12", - "group": "server", - "complexity": "O(N) where N is the number of entries in the slowlog", - "acl_categories": [ - "@admin", - "@slow", - "@dangerous" - ], - "arity": 2, - "command_flags": [ - "admin", - "loading", - "stale" - ], - "hints": [ - "request_policy:all_nodes", - "response_policy:all_succeeded" - ] - }, - "SMEMBERS": { - "summary": "Returns all members of a set.", - "since": "1.0.0", - "group": "set", - "complexity": "O(N) where N is the set cardinality.", + "SSUBSCRIBE": { + "summary": "Listens for messages published to shard channels.", + "since": "7.0.0", + "group": "pubsub", + "complexity": "O(N) where N is the number of shard channels to subscribe to.", "acl_categories": [ - "@read", - "@set", + "@pubsub", "@slow" ], - "arity": 2, + "arity": -2, "key_specs": [ { "begin_search": { @@ -13941,41 +16750,41 @@ "find_keys": { "type": "range", "spec": { - "lastkey": 0, + "lastkey": -1, "keystep": 1, "limit": 0 } }, - "RO": true, - "access": true + "not_key": true } ], "arguments": [ { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 + "name": "shardchannel", + "type": "string", + "display_text": "shardchannel", + "multiple": true } ], "command_flags": [ - "readonly" - ], - "hints": [ - "nondeterministic_output_order" + "denyoom", + "pubsub", + "noscript", + "loading", + "stale" ] }, - "SMISMEMBER": { - "summary": "Determines whether multiple members belong to a set.", - "since": "6.2.0", - "group": "set", - "complexity": "O(N) where N is the number of elements being checked for membership", + "STRLEN": { + "summary": "Returns the length of a string value.", + "since": "2.2.0", + "group": "string", + "complexity": "O(1)", "acl_categories": [ "@read", - "@set", + "@string", "@fast" ], - "arity": -3, + "arity": 2, "key_specs": [ { "begin_search": { @@ -13992,8 +16801,7 @@ "limit": 0 } }, - "RO": true, - "access": true + "RO": true } ], "arguments": [ @@ -14002,28 +16810,50 @@ "type": "key", "display_text": "key", "key_spec_index": 0 - }, + } + ], + "command_flags": [ + "readonly", + "fast" + ] + }, + "SUBSCRIBE": { + "summary": "Listens for messages published to channels.", + "since": "2.0.0", + "group": "pubsub", + "complexity": "O(N) where N is the number of channels to subscribe to.", + "acl_categories": [ + "@pubsub", + "@slow" + ], + "arity": -2, + "arguments": [ { - "name": "member", + "name": "channel", "type": "string", - "display_text": "member", + "display_text": "channel", "multiple": true } ], "command_flags": [ - "readonly", - "fast" + "denyoom", + "pubsub", + "noscript", + "loading", + "stale" ] }, - "SMOVE": { - "summary": "Moves a member from one set to another.", + "SUBSTR": { + "summary": "Returns a substring from a string value.", "since": "1.0.0", - "group": "set", - "complexity": "O(1)", + "group": "string", + "complexity": "O(N) where N is the length of the returned string. The complexity is ultimately determined by the returned length, but because creating a substring from an existing string is very cheap, it can be considered O(1) for small strings.", + "deprecated_since": "2.0.0", + "replaced_by": "`GETRANGE`", "acl_categories": [ - "@write", - "@set", - "@fast" + "@read", + "@string", + "@slow" ], "arity": 4, "key_specs": [ @@ -14042,65 +16872,44 @@ "limit": 0 } }, - "RW": true, - "access": true, - "delete": true - }, - { - "begin_search": { - "type": "index", - "spec": { - "index": 2 - } - }, - "find_keys": { - "type": "range", - "spec": { - "lastkey": 0, - "keystep": 1, - "limit": 0 - } - }, - "RW": true, - "insert": true + "RO": true, + "access": true } ], "arguments": [ { - "name": "source", + "name": "key", "type": "key", - "display_text": "source", + "display_text": "key", "key_spec_index": 0 }, { - "name": "destination", - "type": "key", - "display_text": "destination", - "key_spec_index": 1 + "name": "start", + "type": "integer", + "display_text": "start" }, { - "name": "member", - "type": "string", - "display_text": "member" + "name": "end", + "type": "integer", + "display_text": "end" } ], "command_flags": [ - "write", - "fast" + "readonly" + ], + "doc_flags": [ + "deprecated" ] }, - "SORT": { - "summary": "Sorts the elements in a list, a set, or a sorted set, optionally storing the result.", + "SUNION": { + "summary": "Returns the union of multiple sets.", "since": "1.0.0", - "group": "generic", - "complexity": "O(N+M*log(M)) where N is the number of elements in the list or set to sort, and M the number of returned elements. When the elements are not sorted, complexity is O(N).", + "group": "set", + "complexity": "O(N) where N is the total number of elements in all given sets.", "acl_categories": [ - "@write", + "@read", "@set", - "@sortedset", - "@list", - "@slow", - "@dangerous" + "@slow" ], "arity": -2, "key_specs": [ @@ -14114,39 +16923,13 @@ "find_keys": { "type": "range", "spec": { - "lastkey": 0, + "lastkey": -1, "keystep": 1, "limit": 0 } }, "RO": true, "access": true - }, - { - "notes": "For the optional BY/GET keyword. It is marked 'unknown' because the key names derive from the content of the key we sort", - "begin_search": { - "type": "unknown", - "spec": {} - }, - "find_keys": { - "type": "unknown", - "spec": {} - }, - "RO": true, - "access": true - }, - { - "notes": "For the optional STORE keyword. It is marked 'unknown' because the keyword can appear anywhere in the argument array", - "begin_search": { - "type": "unknown", - "spec": {} - }, - "find_keys": { - "type": "unknown", - "spec": {} - }, - "OW": true, - "update": true } ], "arguments": [ @@ -14154,224 +16937,96 @@ "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0 - }, - { - "name": "by-pattern", - "type": "pattern", - "display_text": "pattern", - "key_spec_index": 1, - "token": "BY", - "optional": true - }, - { - "name": "limit", - "type": "block", - "token": "LIMIT", - "optional": true, - "arguments": [ - { - "name": "offset", - "type": "integer", - "display_text": "offset" - }, - { - "name": "count", - "type": "integer", - "display_text": "count" - } - ] - }, - { - "name": "get-pattern", - "type": "pattern", - "display_text": "pattern", - "key_spec_index": 1, - "token": "GET", - "optional": true, - "multiple": true, - "multiple_token": true - }, - { - "name": "order", - "type": "oneof", - "optional": true, - "arguments": [ - { - "name": "asc", - "type": "pure-token", - "display_text": "asc", - "token": "ASC" - }, - { - "name": "desc", - "type": "pure-token", - "display_text": "desc", - "token": "DESC" - } - ] - }, - { - "name": "sorting", - "type": "pure-token", - "display_text": "sorting", - "token": "ALPHA", - "optional": true - }, - { - "name": "destination", - "type": "key", - "display_text": "destination", - "key_spec_index": 2, - "token": "STORE", - "optional": true + "key_spec_index": 0, + "multiple": true } ], "command_flags": [ - "write", - "denyoom", - "movablekeys" + "readonly" + ], + "hints": [ + "nondeterministic_output_order" ] }, - "SORT_RO": { - "summary": "Returns the sorted elements of a list, a set, or a sorted set.", - "since": "7.0.0", - "group": "generic", - "complexity": "O(N+M*log(M)) where N is the number of elements in the list or set to sort, and M the number of returned elements. When the elements are not sorted, complexity is O(N).", + "SUNIONSTORE": { + "summary": "Stores the union of multiple sets in a key.", + "since": "1.0.0", + "group": "set", + "complexity": "O(N) where N is the total number of elements in all given sets.", "acl_categories": [ - "@read", + "@write", "@set", - "@sortedset", - "@list", - "@slow", - "@dangerous" + "@slow" ], - "arity": -2, + "arity": -3, "key_specs": [ { "begin_search": { "type": "index", "spec": { - "index": 1 + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "OW": true, + "update": true + }, + { + "begin_search": { + "type": "index", + "spec": { + "index": 2 } }, "find_keys": { "type": "range", "spec": { - "lastkey": 0, + "lastkey": -1, "keystep": 1, "limit": 0 } }, "RO": true, "access": true - }, - { - "notes": "For the optional BY/GET keyword. It is marked 'unknown' because the key names derive from the content of the key we sort", - "begin_search": { - "type": "unknown", - "spec": {} - }, - "find_keys": { - "type": "unknown", - "spec": {} - }, - "RO": true, - "access": true } ], "arguments": [ { - "name": "key", + "name": "destination", "type": "key", - "display_text": "key", + "display_text": "destination", "key_spec_index": 0 }, { - "name": "by-pattern", - "type": "pattern", - "display_text": "pattern", - "key_spec_index": 1, - "token": "BY", - "optional": true - }, - { - "name": "limit", - "type": "block", - "token": "LIMIT", - "optional": true, - "arguments": [ - { - "name": "offset", - "type": "integer", - "display_text": "offset" - }, - { - "name": "count", - "type": "integer", - "display_text": "count" - } - ] - }, - { - "name": "get-pattern", - "type": "pattern", - "display_text": "pattern", + "name": "key", + "type": "key", + "display_text": "key", "key_spec_index": 1, - "token": "GET", - "optional": true, - "multiple": true, - "multiple_token": true - }, - { - "name": "order", - "type": "oneof", - "optional": true, - "arguments": [ - { - "name": "asc", - "type": "pure-token", - "display_text": "asc", - "token": "ASC" - }, - { - "name": "desc", - "type": "pure-token", - "display_text": "desc", - "token": "DESC" - } - ] - }, - { - "name": "sorting", - "type": "pure-token", - "display_text": "sorting", - "token": "ALPHA", - "optional": true + "multiple": true } ], "command_flags": [ - "readonly", - "movablekeys" + "write", + "denyoom" ] }, - "SPOP": { - "summary": "Returns one or more random members from a set after removing them. Deletes the set if the last member was popped.", - "since": "1.0.0", - "group": "set", - "complexity": "Without the count argument O(1), otherwise O(N) where N is the value of the passed count.", - "history": [ - [ - "3.2.0", - "Added the `count` argument." - ] - ], + "SUNSUBSCRIBE": { + "summary": "Stops listening to messages posted to shard channels.", + "since": "7.0.0", + "group": "pubsub", + "complexity": "O(N) where N is the number of shard channels to unsubscribe.", "acl_categories": [ - "@write", - "@set", - "@fast" + "@pubsub", + "@slow" ], - "arity": -2, + "arity": -1, "key_specs": [ { "begin_search": { @@ -14383,49 +17038,105 @@ "find_keys": { "type": "range", "spec": { - "lastkey": 0, + "lastkey": -1, "keystep": 1, "limit": 0 } }, - "RW": true, - "access": true, - "delete": true + "not_key": true } ], "arguments": [ { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 + "name": "shardchannel", + "type": "string", + "display_text": "shardchannel", + "optional": true, + "multiple": true + } + ], + "command_flags": [ + "pubsub", + "noscript", + "loading", + "stale" + ] + }, + "SWAPDB": { + "summary": "Swaps two Redis databases.", + "since": "4.0.0", + "group": "server", + "complexity": "O(N) where N is the count of clients watching or blocking on keys from both databases.", + "acl_categories": [ + "@keyspace", + "@write", + "@fast", + "@dangerous" + ], + "arity": 3, + "arguments": [ + { + "name": "index1", + "type": "integer", + "display_text": "index1" }, { - "name": "count", + "name": "index2", "type": "integer", - "display_text": "count", - "since": "3.2.0", - "optional": true + "display_text": "index2" } ], "command_flags": [ "write", "fast" + ] + }, + "SYNC": { + "summary": "An internal command used in replication.", + "since": "1.0.0", + "group": "server", + "acl_categories": [ + "@admin", + "@slow", + "@dangerous" + ], + "arity": 1, + "command_flags": [ + "admin", + "noscript", + "no_async_loading", + "no_multi" + ] + }, + "TIME": { + "summary": "Returns the server time.", + "since": "2.6.0", + "group": "server", + "complexity": "O(1)", + "acl_categories": [ + "@fast" + ], + "arity": 1, + "command_flags": [ + "loading", + "stale", + "fast" ], "hints": [ "nondeterministic_output" ] }, - "SPUBLISH": { - "summary": "Post a message to a shard channel", - "since": "7.0.0", - "group": "pubsub", - "complexity": "O(N) where N is the number of clients subscribed to the receiving shard channel.", + "TOUCH": { + "summary": "Returns the number of existing keys out of those specified after updating the time they were last accessed.", + "since": "3.2.1", + "group": "generic", + "complexity": "O(N) where N is the number of keys that will be touched.", "acl_categories": [ - "@pubsub", + "@keyspace", + "@read", "@fast" ], - "arity": 3, + "arity": -2, "key_specs": [ { "begin_search": { @@ -14437,50 +17148,96 @@ "find_keys": { "type": "range", "spec": { - "lastkey": 0, + "lastkey": -1, "keystep": 1, "limit": 0 } }, - "not_key": true + "RO": true } ], "arguments": [ { - "name": "shardchannel", - "type": "string", - "display_text": "shardchannel" - }, + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0, + "multiple": true + } + ], + "command_flags": [ + "readonly", + "fast" + ], + "hints": [ + "request_policy:multi_shard", + "response_policy:agg_sum" + ] + }, + "TRIMSLOTS": { + "summary": "Trim the keys that belong to specified slots.", + "since": "8.4.0", + "group": "server", + "complexity": "O(N) where N is the total number of keys in all databases", + "acl_categories": [ + "@keyspace", + "@write", + "@slow", + "@dangerous" + ], + "arity": -5, + "arguments": [ { - "name": "message", - "type": "string", - "display_text": "message" + "name": "ranges", + "type": "block", + "token": "RANGES", + "arguments": [ + { + "name": "numranges", + "type": "integer", + "display_text": "numranges" + }, + { + "name": "slots", + "type": "block", + "multiple": true, + "arguments": [ + { + "name": "startslot", + "type": "integer", + "display_text": "startslot" + }, + { + "name": "endslot", + "type": "integer", + "display_text": "endslot" + } + ] + } + ] } ], "command_flags": [ - "pubsub", - "loading", - "stale", - "fast" + "write" ] }, - "SRANDMEMBER": { - "summary": "Get one or multiple random members from a set", + "TTL": { + "summary": "Returns the expiration time in seconds of a key.", "since": "1.0.0", - "group": "set", - "complexity": "Without the count argument O(1), otherwise O(N) where N is the absolute value of the passed count.", + "group": "generic", + "complexity": "O(1)", "history": [ [ - "2.6.0", - "Added the optional `count` argument." + "2.8.0", + "Added the -2 reply." ] ], "acl_categories": [ + "@keyspace", "@read", - "@set", - "@slow" + "@fast" ], - "arity": -2, + "arity": 2, "key_specs": [ { "begin_search": { @@ -14507,39 +17264,27 @@ "type": "key", "display_text": "key", "key_spec_index": 0 - }, - { - "name": "count", - "type": "integer", - "display_text": "count", - "since": "2.6.0", - "optional": true } ], "command_flags": [ - "readonly" + "readonly", + "fast" ], "hints": [ "nondeterministic_output" ] }, - "SREM": { - "summary": "Removes one or more members from a set. Deletes the set if the last member was removed.", + "TYPE": { + "summary": "Determines the type of value stored at a key.", "since": "1.0.0", - "group": "set", - "complexity": "O(N) where N is the number of members to be removed.", - "history": [ - [ - "2.4.0", - "Accepts multiple `member` arguments." - ] - ], + "group": "generic", + "complexity": "O(1)", "acl_categories": [ - "@write", - "@set", + "@keyspace", + "@read", "@fast" ], - "arity": -3, + "arity": 2, "key_specs": [ { "begin_search": { @@ -14556,8 +17301,7 @@ "limit": 0 } }, - "RW": true, - "delete": true + "RO": true } ], "arguments": [ @@ -14566,30 +17310,24 @@ "type": "key", "display_text": "key", "key_spec_index": 0 - }, - { - "name": "member", - "type": "string", - "display_text": "member", - "multiple": true } ], "command_flags": [ - "write", + "readonly", "fast" ] }, - "SSCAN": { - "summary": "Iterates over members of a set.", - "since": "2.8.0", - "group": "set", - "complexity": "O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection.", + "UNLINK": { + "summary": "Asynchronously deletes one or more keys.", + "since": "4.0.0", + "group": "generic", + "complexity": "O(1) for each key removed regardless of its size. Then the command does O(N) work in a different thread in order to reclaim memory, where N is the number of allocations the deleted objects where composed of.", "acl_categories": [ - "@read", - "@set", - "@slow" + "@keyspace", + "@write", + "@fast" ], - "arity": -3, + "arity": -2, "key_specs": [ { "begin_search": { @@ -14601,13 +17339,13 @@ "find_keys": { "type": "range", "spec": { - "lastkey": 0, + "lastkey": -1, "keystep": 1, "limit": 0 } }, - "RO": true, - "access": true + "RM": true, + "delete": true } ], "arguments": [ @@ -14615,45 +17353,68 @@ "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0 - }, - { - "name": "cursor", - "type": "integer", - "display_text": "cursor" - }, - { - "name": "pattern", - "type": "pattern", - "display_text": "pattern", - "token": "MATCH", - "optional": true - }, - { - "name": "count", - "type": "integer", - "display_text": "count", - "token": "COUNT", - "optional": true + "key_spec_index": 0, + "multiple": true } ], "command_flags": [ - "readonly" + "write", + "fast" ], "hints": [ - "nondeterministic_output" + "request_policy:multi_shard", + "response_policy:agg_sum" ] }, - "SSUBSCRIBE": { - "summary": "Listens for messages published to shard channels.", - "since": "7.0.0", + "UNSUBSCRIBE": { + "summary": "Stops listening to messages posted to channels.", + "since": "2.0.0", "group": "pubsub", - "complexity": "O(N) where N is the number of shard channels to subscribe to.", + "complexity": "O(N) where N is the number of channels to unsubscribe.", "acl_categories": [ "@pubsub", "@slow" ], - "arity": -2, + "arity": -1, + "arguments": [ + { + "name": "channel", + "type": "string", + "display_text": "channel", + "optional": true, + "multiple": true + } + ], + "command_flags": [ + "pubsub", + "noscript", + "loading", + "stale" + ] + }, + "UNWATCH": { + "summary": "Forgets about watched keys of a transaction.", + "since": "2.2.0", + "group": "transactions", + "complexity": "O(1)", + "acl_categories": [ + "@fast", + "@transaction" + ], + "arity": 1, + "command_flags": [ + "noscript", + "loading", + "stale", + "fast", + "allow_busy" + ] + }, + "VADD": { + "summary": "Add one or more elements to a vector set, or update its vector if it already exists", + "since": "8.0.0", + "group": "module", + "arity": -5, "key_specs": [ { "begin_search": { @@ -14665,39 +17426,129 @@ "find_keys": { "type": "range", "spec": { - "lastkey": -1, + "lastkey": 0, "keystep": 1, "limit": 0 } }, - "not_key": true + "RW": true, + "access": true, + "update": true } ], "arguments": [ { - "name": "shardchannel", + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "reduce", + "type": "block", + "token": "REDUCE", + "optional": true, + "arguments": [ + { + "name": "dim", + "type": "integer", + "display_text": "dim" + } + ] + }, + { + "name": "format", + "type": "oneof", + "arguments": [ + { + "name": "fp32", + "type": "pure-token", + "display_text": "fp32", + "token": "FP32" + }, + { + "name": "values", + "type": "pure-token", + "display_text": "values", + "token": "VALUES" + } + ] + }, + { + "name": "vector", "type": "string", - "display_text": "shardchannel", - "multiple": true + "display_text": "vector" + }, + { + "name": "element", + "type": "string", + "display_text": "element" + }, + { + "name": "cas", + "type": "pure-token", + "display_text": "cas", + "token": "CAS", + "optional": true + }, + { + "name": "quant_type", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "noquant", + "type": "pure-token", + "display_text": "noquant", + "token": "NOQUANT" + }, + { + "name": "bin", + "type": "pure-token", + "display_text": "bin", + "token": "BIN" + }, + { + "name": "q8", + "type": "pure-token", + "display_text": "q8", + "token": "Q8" + } + ] + }, + { + "name": "build-exploration-factor", + "type": "integer", + "display_text": "build-exploration-factor", + "token": "EF", + "optional": true + }, + { + "name": "attributes", + "type": "string", + "display_text": "attributes", + "token": "SETATTR", + "optional": true + }, + { + "name": "numlinks", + "type": "integer", + "display_text": "numlinks", + "token": "M", + "optional": true } ], "command_flags": [ - "pubsub", - "noscript", - "loading", - "stale" - ] - }, - "STRLEN": { - "summary": "Returns the length of a string value.", - "since": "2.2.0", - "group": "string", - "complexity": "O(1)", - "acl_categories": [ - "@read", - "@string", - "@fast" + "write", + "denyoom", + "module" ], + "module": "vectorset" + }, + "VCARD": { + "summary": "Return the number of elements in a vector set", + "since": "8.0.0", + "group": "module", "arity": 2, "key_specs": [ { @@ -14715,7 +17566,9 @@ "limit": 0 } }, - "RO": true + "RW": true, + "access": true, + "update": true } ], "arguments": [ @@ -14728,47 +17581,16 @@ ], "command_flags": [ "readonly", + "module", "fast" - ] - }, - "SUBSCRIBE": { - "summary": "Listens for messages published to channels.", - "since": "2.0.0", - "group": "pubsub", - "complexity": "O(N) where N is the number of channels to subscribe to.", - "acl_categories": [ - "@pubsub", - "@slow" - ], - "arity": -2, - "arguments": [ - { - "name": "channel", - "type": "string", - "display_text": "channel", - "multiple": true - } ], - "command_flags": [ - "pubsub", - "noscript", - "loading", - "stale" - ] + "module": "vectorset" }, - "SUBSTR": { - "summary": "Returns a substring from a string value.", - "since": "1.0.0", - "group": "string", - "complexity": "O(N) where N is the length of the returned string. The complexity is ultimately determined by the returned length, but because creating a substring from an existing string is very cheap, it can be considered O(1) for small strings.", - "deprecated_since": "2.0.0", - "replaced_by": "`GETRANGE`", - "acl_categories": [ - "@read", - "@string", - "@slow" - ], - "arity": 4, + "VDIM": { + "summary": "Return the dimension of vectors in the vector set", + "since": "8.0.0", + "group": "module", + "arity": 2, "key_specs": [ { "begin_search": { @@ -14785,8 +17607,9 @@ "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "access": true, + "update": true } ], "arguments": [ @@ -14795,36 +17618,20 @@ "type": "key", "display_text": "key", "key_spec_index": 0 - }, - { - "name": "start", - "type": "integer", - "display_text": "start" - }, - { - "name": "end", - "type": "integer", - "display_text": "end" } ], "command_flags": [ - "readonly" + "readonly", + "module", + "fast" ], - "doc_flags": [ - "deprecated" - ] + "module": "vectorset" }, - "SUNION": { - "summary": "Returns the union of multiple sets.", - "since": "1.0.0", - "group": "set", - "complexity": "O(N) where N is the total number of elements in all given sets.", - "acl_categories": [ - "@read", - "@set", - "@slow" - ], - "arity": -2, + "VEMB": { + "summary": "Return the vector associated with an element", + "since": "8.0.0", + "group": "module", + "arity": -3, "key_specs": [ { "begin_search": { @@ -14836,13 +17643,14 @@ "find_keys": { "type": "range", "spec": { - "lastkey": -1, + "lastkey": 0, "keystep": 1, "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "access": true, + "update": true } ], "arguments": [ @@ -14850,28 +17658,33 @@ "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0, - "multiple": true + "key_spec_index": 0 + }, + { + "name": "element", + "type": "string", + "display_text": "element" + }, + { + "name": "raw", + "type": "pure-token", + "display_text": "raw", + "token": "RAW", + "optional": true } ], "command_flags": [ - "readonly" + "readonly", + "module", + "fast" ], - "hints": [ - "nondeterministic_output_order" - ] + "module": "vectorset" }, - "SUNIONSTORE": { - "summary": "Stores the union of multiple sets in a key.", - "since": "1.0.0", - "group": "set", - "complexity": "O(N) where N is the total number of elements in all given sets.", - "acl_categories": [ - "@write", - "@set", - "@slow" - ], - "arity": -3, + "VGETATTR": { + "summary": "Retrieve the JSON attributes of elements", + "since": "8.0.0", + "group": "module", + "arity": 3, "key_specs": [ { "begin_search": { @@ -14888,58 +17701,77 @@ "limit": 0 } }, - "OW": true, + "RW": true, + "access": true, "update": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 }, + { + "name": "element", + "type": "string", + "display_text": "element" + } + ], + "command_flags": [ + "readonly", + "module", + "fast" + ], + "module": "vectorset" + }, + "VINFO": { + "summary": "Return information about a vector set", + "since": "8.0.0", + "group": "module", + "arity": 2, + "key_specs": [ { "begin_search": { "type": "index", "spec": { - "index": 2 + "index": 1 } }, "find_keys": { "type": "range", "spec": { - "lastkey": -1, + "lastkey": 0, "keystep": 1, "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "access": true, + "update": true } ], "arguments": [ - { - "name": "destination", - "type": "key", - "display_text": "destination", - "key_spec_index": 0 - }, { "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 1, - "multiple": true + "key_spec_index": 0 } ], "command_flags": [ - "write", - "denyoom" - ] - }, - "SUNSUBSCRIBE": { - "summary": "Stops listening to messages posted to shard channels.", - "since": "7.0.0", - "group": "pubsub", - "complexity": "O(N) where N is the number of shard channels to unsubscribe.", - "acl_categories": [ - "@pubsub", - "@slow" + "readonly", + "module", + "fast" ], - "arity": -1, + "module": "vectorset" + }, + "VISMEMBER": { + "summary": "Check if an element exists in a vector set", + "since": "8.2.0", + "group": "module", + "arity": 3, "key_specs": [ { "begin_search": { @@ -14951,104 +17783,92 @@ "find_keys": { "type": "range", "spec": { - "lastkey": -1, + "lastkey": 0, "keystep": 1, "limit": 0 } }, - "not_key": true + "RW": true, + "access": true, + "update": true } ], "arguments": [ { - "name": "shardchannel", + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "element", "type": "string", - "display_text": "shardchannel", - "optional": true, - "multiple": true + "display_text": "element" } ], "command_flags": [ - "pubsub", - "noscript", - "loading", - "stale" - ] - }, - "SWAPDB": { - "summary": "Swaps two Redis databases.", - "since": "4.0.0", - "group": "server", - "complexity": "O(N) where N is the count of clients watching or blocking on keys from both databases.", - "acl_categories": [ - "@keyspace", - "@write", - "@fast", - "@dangerous" + "readonly", + "module" ], - "arity": 3, - "arguments": [ - { - "name": "index1", - "type": "integer", - "display_text": "index1" - }, + "module": "vectorset" + }, + "VLINKS": { + "summary": "Return the neighbors of an element at each layer in the HNSW graph", + "since": "8.0.0", + "group": "module", + "arity": -3, + "key_specs": [ { - "name": "index2", - "type": "integer", - "display_text": "index2" + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "access": true, + "update": true } ], - "command_flags": [ - "write", - "fast" - ] - }, - "SYNC": { - "summary": "An internal command used in replication.", - "since": "1.0.0", - "group": "server", - "acl_categories": [ - "@admin", - "@slow", - "@dangerous" - ], - "arity": 1, - "command_flags": [ - "admin", - "noscript", - "no_async_loading", - "no_multi" - ] - }, - "TIME": { - "summary": "Returns the server time.", - "since": "2.6.0", - "group": "server", - "complexity": "O(1)", - "acl_categories": [ - "@fast" + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "element", + "type": "string", + "display_text": "element" + }, + { + "name": "withscores", + "type": "pure-token", + "display_text": "withscores", + "token": "WITHSCORES", + "optional": true + } ], - "arity": 1, "command_flags": [ - "loading", - "stale", + "readonly", + "module", "fast" ], - "hints": [ - "nondeterministic_output" - ] + "module": "vectorset" }, - "TOUCH": { - "summary": "Returns the number of existing keys out of those specified after updating the time they were last accessed.", - "since": "3.2.1", - "group": "generic", - "complexity": "O(N) where N is the number of keys that will be touched.", - "acl_categories": [ - "@keyspace", - "@read", - "@fast" - ], + "VRANDMEMBER": { + "summary": "Return one or multiple random members from a vector set", + "since": "8.0.0", + "group": "module", "arity": -2, "key_specs": [ { @@ -15061,12 +17881,14 @@ "find_keys": { "type": "range", "spec": { - "lastkey": -1, + "lastkey": 0, "keystep": 1, "limit": 0 } }, - "RO": true + "RW": true, + "access": true, + "update": true } ], "arguments": [ @@ -15074,36 +17896,26 @@ "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0, - "multiple": true + "key_spec_index": 0 + }, + { + "name": "count", + "type": "integer", + "display_text": "count", + "optional": true } ], "command_flags": [ "readonly", - "fast" + "module" ], - "hints": [ - "request_policy:multi_shard", - "response_policy:agg_sum" - ] + "module": "vectorset" }, - "TTL": { - "summary": "Returns the expiration time in seconds of a key.", - "since": "1.0.0", - "group": "generic", - "complexity": "O(1)", - "history": [ - [ - "2.8.0", - "Added the -2 reply." - ] - ], - "acl_categories": [ - "@keyspace", - "@read", - "@fast" - ], - "arity": 2, + "VRANGE": { + "summary": "Return vector set elements in a lex range", + "since": "8.4.0", + "group": "module", + "arity": -4, "key_specs": [ { "begin_search": { @@ -15120,8 +17932,9 @@ "limit": 0 } }, - "RO": true, - "access": true + "RW": true, + "access": true, + "update": true } ], "arguments": [ @@ -15130,27 +17943,35 @@ "type": "key", "display_text": "key", "key_spec_index": 0 + }, + { + "name": "start", + "type": "string", + "display_text": "start" + }, + { + "name": "end", + "type": "string", + "display_text": "end" + }, + { + "name": "count", + "type": "integer", + "display_text": "count", + "optional": true } ], "command_flags": [ "readonly", - "fast" + "module" ], - "hints": [ - "nondeterministic_output" - ] + "module": "vectorset" }, - "TYPE": { - "summary": "Determines the type of value stored at a key.", - "since": "1.0.0", - "group": "generic", - "complexity": "O(1)", - "acl_categories": [ - "@keyspace", - "@read", - "@fast" - ], - "arity": 2, + "VREM": { + "summary": "Remove an element from a vector set", + "since": "8.0.0", + "group": "module", + "arity": 3, "key_specs": [ { "begin_search": { @@ -15167,7 +17988,9 @@ "limit": 0 } }, - "RO": true + "RW": true, + "access": true, + "update": true } ], "arguments": [ @@ -15176,24 +17999,24 @@ "type": "key", "display_text": "key", "key_spec_index": 0 + }, + { + "name": "element", + "type": "string", + "display_text": "element" } ], "command_flags": [ - "readonly", - "fast" - ] - }, - "UNLINK": { - "summary": "Asynchronously deletes one or more keys.", - "since": "4.0.0", - "group": "generic", - "complexity": "O(1) for each key removed regardless of its size. Then the command does O(N) work in a different thread in order to reclaim memory, where N is the number of allocations the deleted objects where composed of.", - "acl_categories": [ - "@keyspace", - "@write", - "@fast" + "write", + "module" ], - "arity": -2, + "module": "vectorset" + }, + "VSETATTR": { + "summary": "Associate or remove the JSON attributes of elements", + "since": "8.0.0", + "group": "module", + "arity": 4, "key_specs": [ { "begin_search": { @@ -15205,13 +18028,14 @@ "find_keys": { "type": "range", "spec": { - "lastkey": -1, + "lastkey": 0, "keystep": 1, "limit": 0 } }, - "RM": true, - "delete": true + "RW": true, + "access": true, + "update": true } ], "arguments": [ @@ -15219,62 +18043,157 @@ "name": "key", "type": "key", "display_text": "key", - "key_spec_index": 0, - "multiple": true + "key_spec_index": 0 + }, + { + "name": "element", + "type": "string", + "display_text": "element" + }, + { + "name": "json", + "type": "string", + "display_text": "json" } ], "command_flags": [ "write", + "module", "fast" ], - "hints": [ - "request_policy:multi_shard", - "response_policy:agg_sum" - ] + "module": "vectorset" }, - "UNSUBSCRIBE": { - "summary": "Stops listening to messages posted to channels.", - "since": "2.0.0", - "group": "pubsub", - "complexity": "O(N) where N is the number of channels to unsubscribe.", - "acl_categories": [ - "@pubsub", - "@slow" + "VSIM": { + "summary": "Return elements by vector similarity", + "since": "8.0.0", + "group": "module", + "arity": -4, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "access": true, + "update": true + } ], - "arity": -1, "arguments": [ { - "name": "channel", + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "format", + "type": "oneof", + "arguments": [ + { + "name": "ele", + "type": "pure-token", + "display_text": "ele", + "token": "ELE" + }, + { + "name": "fp32", + "type": "pure-token", + "display_text": "fp32", + "token": "FP32" + }, + { + "name": "values", + "type": "pure-token", + "display_text": "values", + "token": "VALUES" + } + ] + }, + { + "name": "vector_or_element", + "type": "string", + "display_text": "vector_or_element" + }, + { + "name": "withscores", + "type": "pure-token", + "display_text": "withscores", + "token": "WITHSCORES", + "optional": true + }, + { + "name": "withattribs", + "type": "pure-token", + "display_text": "withattribs", + "token": "WITHATTRIBS", + "optional": true + }, + { + "name": "count", + "type": "integer", + "display_text": "count", + "token": "COUNT", + "optional": true + }, + { + "name": "max_distance", + "type": "double", + "display_text": "max_distance", + "token": "EPSILON", + "optional": true + }, + { + "name": "search-exploration-factor", + "type": "integer", + "display_text": "search-exploration-factor", + "token": "EF", + "optional": true + }, + { + "name": "expression", "type": "string", - "display_text": "channel", - "optional": true, - "multiple": true + "display_text": "expression", + "token": "FILTER", + "optional": true + }, + { + "name": "max-filtering-effort", + "type": "integer", + "display_text": "max-filtering-effort", + "token": "FILTER-EF", + "optional": true + }, + { + "name": "truth", + "type": "pure-token", + "display_text": "truth", + "token": "TRUTH", + "optional": true + }, + { + "name": "nothread", + "type": "pure-token", + "display_text": "nothread", + "token": "NOTHREAD", + "optional": true } ], "command_flags": [ - "pubsub", - "noscript", - "loading", - "stale" - ] - }, - "UNWATCH": { - "summary": "Forgets about watched keys of a transaction.", - "since": "2.2.0", - "group": "transactions", - "complexity": "O(1)", - "acl_categories": [ - "@fast", - "@transaction" + "readonly", + "module" ], - "arity": 1, - "command_flags": [ - "noscript", - "loading", - "stale", - "fast", - "allow_busy" - ] + "module": "vectorset" }, "WAIT": { "summary": "Blocks until the asynchronous replication of all preceding write commands sent by the connection is completed.", @@ -15444,6 +18363,99 @@ "fast" ] }, + "XACKDEL": { + "summary": "Acknowledges and deletes one or multiple messages for a stream consumer group.", + "since": "8.2.0", + "group": "stream", + "complexity": "O(1) for each message ID processed.", + "acl_categories": [ + "@write", + "@stream", + "@fast" + ], + "arity": -6, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "update": true, + "delete": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "group", + "type": "string", + "display_text": "group" + }, + { + "name": "condition", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "keepref", + "type": "pure-token", + "display_text": "keepref", + "token": "KEEPREF" + }, + { + "name": "delref", + "type": "pure-token", + "display_text": "delref", + "token": "DELREF" + }, + { + "name": "acked", + "type": "pure-token", + "display_text": "acked", + "token": "ACKED" + } + ] + }, + { + "name": "ids", + "type": "block", + "token": "IDS", + "arguments": [ + { + "name": "numids", + "type": "integer", + "display_text": "numids" + }, + { + "name": "id", + "type": "string", + "display_text": "id", + "multiple": true + } + ] + } + ], + "command_flags": [ + "write", + "fast" + ] + }, "XADD": { "summary": "Appends a new message to a stream. Creates the key if it doesn't exist.", "since": "5.0.0", @@ -15457,6 +18469,10 @@ [ "7.0.0", "Added support for the `-*` explicit ID form." + ], + [ + "8.2.0", + "Added the `KEEPREF`, `DELREF` and `ACKED` options." ] ], "acl_categories": [ @@ -15501,6 +18517,62 @@ "since": "6.2.0", "optional": true }, + { + "name": "condition", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "keepref", + "type": "pure-token", + "display_text": "keepref", + "token": "KEEPREF" + }, + { + "name": "delref", + "type": "pure-token", + "display_text": "delref", + "token": "DELREF" + }, + { + "name": "acked", + "type": "pure-token", + "display_text": "acked", + "token": "ACKED" + } + ] + }, + { + "name": "idmp", + "type": "oneof", + "since": "8.6.0", + "optional": true, + "arguments": [ + { + "name": "pid", + "type": "string", + "display_text": "pid", + "token": "IDMPAUTO" + }, + { + "name": "idmp", + "type": "block", + "token": "IDMP", + "arguments": [ + { + "name": "pid", + "type": "string", + "display_text": "pid" + }, + { + "name": "iid", + "type": "string", + "display_text": "iid" + } + ] + } + ] + }, { "name": "trim", "type": "block", @@ -15690,6 +18762,64 @@ "nondeterministic_output" ] }, + "XCFGSET": { + "summary": "Sets the IDMP configuration parameters for a stream.", + "since": "8.6.0", + "group": "stream", + "complexity": "O(1)", + "acl_categories": [ + "@write", + "@stream", + "@fast" + ], + "arity": -2, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "update": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "idmp-duration", + "type": "integer", + "display_text": "idmp-duration", + "token": "IDMP-DURATION", + "optional": true + }, + { + "name": "idmp-maxsize", + "type": "integer", + "display_text": "idmp-maxsize", + "token": "IDMP-MAXSIZE", + "optional": true + } + ], + "command_flags": [ + "write", + "fast" + ] + }, "XCLAIM": { "summary": "Changes, or acquires, ownership of a message in a consumer group, as if the message was delivered a consumer group member.", "since": "5.0.0", @@ -15785,24 +18915,74 @@ "optional": true }, { - "name": "lastid", + "name": "lastid", + "type": "string", + "display_text": "lastid", + "token": "LASTID", + "optional": true + } + ], + "command_flags": [ + "write", + "fast" + ], + "hints": [ + "nondeterministic_output" + ] + }, + "XDEL": { + "summary": "Returns the number of messages after removing them from a stream.", + "since": "5.0.0", + "group": "stream", + "complexity": "O(1) for each single item to delete in the stream, regardless of the stream size.", + "acl_categories": [ + "@write", + "@stream", + "@fast" + ], + "arity": -3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "delete": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "id", "type": "string", - "display_text": "lastid", - "token": "LASTID", - "optional": true + "display_text": "id", + "multiple": true } ], "command_flags": [ "write", "fast" - ], - "hints": [ - "nondeterministic_output" ] }, - "XDEL": { - "summary": "Returns the number of messages after removing them from a stream.", - "since": "5.0.0", + "XDELEX": { + "summary": "Deletes one or multiple entries from the stream.", + "since": "8.2.0", "group": "stream", "complexity": "O(1) for each single item to delete in the stream, regardless of the stream size.", "acl_categories": [ @@ -15810,7 +18990,7 @@ "@stream", "@fast" ], - "arity": -3, + "arity": -5, "key_specs": [ { "begin_search": { @@ -15839,10 +19019,47 @@ "key_spec_index": 0 }, { - "name": "id", - "type": "string", - "display_text": "id", - "multiple": true + "name": "condition", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "keepref", + "type": "pure-token", + "display_text": "keepref", + "token": "KEEPREF" + }, + { + "name": "delref", + "type": "pure-token", + "display_text": "delref", + "token": "DELREF" + }, + { + "name": "acked", + "type": "pure-token", + "display_text": "acked", + "token": "ACKED" + } + ] + }, + { + "name": "ids", + "type": "block", + "token": "IDS", + "arguments": [ + { + "name": "numids", + "type": "integer", + "display_text": "numids" + }, + { + "name": "id", + "type": "string", + "display_text": "id", + "multiple": true + } + ] } ], "command_flags": [ @@ -16194,6 +19411,66 @@ "write" ] }, + "XIDMPRECORD": { + "summary": "An internal command for setting IDMP metadata on an existing stream message.", + "since": "8.6.2", + "group": "stream", + "complexity": "O(1)", + "acl_categories": [ + "@write", + "@stream", + "@fast" + ], + "arity": 5, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "update": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "pid", + "type": "string", + "display_text": "pid" + }, + { + "name": "iid", + "type": "string", + "display_text": "iid" + }, + { + "name": "stream-id", + "type": "string", + "display_text": "stream-id" + } + ], + "command_flags": [ + "write", + "denyoom", + "fast" + ] + }, "XINFO": { "summary": "A container for stream introspection commands.", "since": "5.0.0", @@ -16342,6 +19619,14 @@ [ "7.2.0", "Added the `active-time` field, and changed the meaning of `seen-time`." + ], + [ + "8.6.0", + "Added the `idmp-duration`, `idmp-maxsize`, `pids-tracked`, `iids-tracked`, `iids-added` and `iids-duplicates` fields for IDMP tracking." + ], + [ + "8.8.0", + "Added the `nacked-count` field to consumer groups in `FULL` output." ] ], "acl_categories": [ @@ -16445,6 +19730,111 @@ "fast" ] }, + "XNACK": { + "summary": "Releases claimed messages back to the group's PEL without acknowledging them, making them available for re-delivery.", + "since": "8.8.0", + "group": "stream", + "complexity": "O(1) for each message ID processed.", + "acl_categories": [ + "@write", + "@stream", + "@fast" + ], + "arity": -7, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "update": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "group", + "type": "string", + "display_text": "group" + }, + { + "name": "mode", + "type": "oneof", + "arguments": [ + { + "name": "silent", + "type": "pure-token", + "display_text": "silent", + "token": "SILENT" + }, + { + "name": "fail", + "type": "pure-token", + "display_text": "fail", + "token": "FAIL" + }, + { + "name": "fatal", + "type": "pure-token", + "display_text": "fatal", + "token": "FATAL" + } + ] + }, + { + "name": "ids", + "type": "block", + "token": "IDS", + "arguments": [ + { + "name": "numids", + "type": "integer", + "display_text": "numids" + }, + { + "name": "id", + "type": "string", + "display_text": "id", + "multiple": true + } + ] + }, + { + "name": "count", + "type": "integer", + "display_text": "count", + "token": "RETRYCOUNT", + "optional": true + }, + { + "name": "force", + "type": "pure-token", + "display_text": "force", + "token": "FORCE", + "optional": true + } + ], + "command_flags": [ + "write", + "fast" + ] + }, "XPENDING": { "summary": "Returns the information and entries from a stream consumer group's pending entries list.", "since": "5.0.0", @@ -16743,6 +20133,13 @@ "token": "BLOCK", "optional": true }, + { + "name": "min-idle-time", + "type": "integer", + "display_text": "min-idle-time", + "token": "CLAIM", + "optional": true + }, { "name": "noack", "type": "pure-token", @@ -16924,6 +20321,10 @@ [ "6.2.0", "Added the `MINID` trimming strategy and the `LIMIT` option." + ], + [ + "8.2.0", + "Added the `KEEPREF`, `DELREF` and `ACKED` options." ] ], "acl_categories": [ @@ -17013,6 +20414,31 @@ "token": "LIMIT", "since": "6.2.0", "optional": true + }, + { + "name": "condition", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "keepref", + "type": "pure-token", + "display_text": "keepref", + "token": "KEEPREF" + }, + { + "name": "delref", + "type": "pure-token", + "display_text": "delref", + "token": "DELREF" + }, + { + "name": "acked", + "type": "pure-token", + "display_text": "acked", + "token": "ACKED" + } + ] } ] } @@ -17446,6 +20872,12 @@ "since": "6.2.0", "group": "sorted-set", "complexity": "O(N*K)+O(M*log(M)) worst case with N being the smallest input sorted set, K being the number of input sorted sets and M being the number of elements in the resulting sorted set.", + "history": [ + [ + "8.8.0", + "Added `COUNT` aggregate option." + ] + ], "acl_categories": [ "@read", "@sortedset", @@ -17516,6 +20948,13 @@ "type": "pure-token", "display_text": "max", "token": "MAX" + }, + { + "name": "count", + "type": "pure-token", + "display_text": "count", + "token": "COUNT", + "since": "8.8.0" } ] }, @@ -17594,6 +21033,12 @@ "since": "2.0.0", "group": "sorted-set", "complexity": "O(N*K)+O(M*log(M)) worst case with N being the smallest input sorted set, K being the number of input sorted sets and M being the number of elements in the resulting sorted set.", + "history": [ + [ + "8.8.0", + "Added `COUNT` aggregate option." + ] + ], "acl_categories": [ "@write", "@sortedset", @@ -17688,6 +21133,13 @@ "type": "pure-token", "display_text": "max", "token": "MAX" + }, + { + "name": "count", + "type": "pure-token", + "display_text": "count", + "token": "COUNT", + "since": "8.8.0" } ] } @@ -19134,6 +22586,12 @@ "since": "6.2.0", "group": "sorted-set", "complexity": "O(N)+O(M*log(M)) with N being the sum of the sizes of the input sorted sets, and M being the number of elements in the resulting sorted set.", + "history": [ + [ + "8.8.0", + "Added `COUNT` aggregate option." + ] + ], "acl_categories": [ "@read", "@sortedset", @@ -19204,6 +22662,13 @@ "type": "pure-token", "display_text": "max", "token": "MAX" + }, + { + "name": "count", + "type": "pure-token", + "display_text": "count", + "token": "COUNT", + "since": "8.8.0" } ] }, @@ -19225,6 +22690,12 @@ "since": "2.0.0", "group": "sorted-set", "complexity": "O(N)+O(M log(M)) with N being the sum of the sizes of the input sorted sets, and M being the number of elements in the resulting sorted set.", + "history": [ + [ + "8.8.0", + "Added `COUNT` aggregate option." + ] + ], "acl_categories": [ "@write", "@sortedset", @@ -19319,6 +22790,13 @@ "type": "pure-token", "display_text": "max", "token": "MAX" + }, + { + "name": "count", + "type": "pure-token", + "display_text": "count", + "token": "COUNT", + "since": "8.8.0" } ] } diff --git a/data/commands_core.json b/data/commands_core.json index 1c25fe87b1..3fc9a464ae 100644 --- a/data/commands_core.json +++ b/data/commands_core.json @@ -402,6 +402,1122 @@ "fast" ] }, + "ARCOUNT": { + "summary": "Returns the number of non-empty elements in an array.", + "since": "8.8.0", + "group": "array", + "complexity": "O(1)", + "acl_categories": [ + "@read", + "@array", + "@fast" + ], + "arity": 2, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + } + ], + "command_flags": [ + "readonly", + "fast" + ] + }, + "ARDEL": { + "summary": "Deletes elements at the specified indices in an array.", + "since": "8.8.0", + "group": "array", + "complexity": "O(N) where N is the number of indices to delete", + "acl_categories": [ + "@write", + "@array", + "@fast" + ], + "arity": -3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "delete": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "index", + "type": "integer", + "display_text": "index", + "multiple": true + } + ], + "command_flags": [ + "write", + "fast" + ] + }, + "ARDELRANGE": { + "summary": "Deletes elements in one or more ranges.", + "since": "8.8.0", + "group": "array", + "complexity": "Proportional to the number of existing elements / slices touched, not to the numeric span of the requested ranges", + "acl_categories": [ + "@write", + "@array", + "@slow" + ], + "arity": -4, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "delete": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "range", + "type": "block", + "multiple": true, + "arguments": [ + { + "name": "start", + "type": "integer", + "display_text": "start" + }, + { + "name": "end", + "type": "integer", + "display_text": "end" + } + ] + } + ], + "command_flags": [ + "write" + ] + }, + "ARGET": { + "summary": "Gets the value at an index in an array.", + "since": "8.8.0", + "group": "array", + "complexity": "O(1)", + "acl_categories": [ + "@read", + "@array", + "@fast" + ], + "arity": 3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "index", + "type": "integer", + "display_text": "index" + } + ], + "command_flags": [ + "readonly", + "fast" + ] + }, + "ARGETRANGE": { + "summary": "Gets values in a range of indices.", + "since": "8.8.0", + "group": "array", + "complexity": "O(N) where N is the range length", + "acl_categories": [ + "@read", + "@array", + "@slow" + ], + "arity": 4, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "start", + "type": "integer", + "display_text": "start" + }, + { + "name": "end", + "type": "integer", + "display_text": "end" + } + ], + "command_flags": [ + "readonly" + ] + }, + "ARGREP": { + "summary": "Searches array elements in a range using textual predicates.", + "since": "8.8.0", + "group": "array", + "complexity": "O(P * C) where P is the number of visited positions in touched slices and C is the cost of evaluating the predicates on one existing element.", + "acl_categories": [ + "@read", + "@array", + "@slow" + ], + "arity": -6, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "start", + "type": "string", + "display_text": "start" + }, + { + "name": "end", + "type": "string", + "display_text": "end" + }, + { + "name": "predicate", + "type": "oneof", + "multiple": true, + "arguments": [ + { + "name": "exact", + "type": "block", + "arguments": [ + { + "name": "exact", + "type": "pure-token", + "display_text": "exact", + "token": "EXACT" + }, + { + "name": "string", + "type": "string", + "display_text": "string" + } + ] + }, + { + "name": "match", + "type": "block", + "arguments": [ + { + "name": "match", + "type": "pure-token", + "display_text": "match", + "token": "MATCH" + }, + { + "name": "string", + "type": "string", + "display_text": "string" + } + ] + }, + { + "name": "glob", + "type": "block", + "arguments": [ + { + "name": "glob", + "type": "pure-token", + "display_text": "glob", + "token": "GLOB" + }, + { + "name": "pattern", + "type": "string", + "display_text": "pattern" + } + ] + }, + { + "name": "re", + "type": "block", + "arguments": [ + { + "name": "re", + "type": "pure-token", + "display_text": "re", + "token": "RE" + }, + { + "name": "pattern", + "type": "string", + "display_text": "pattern" + } + ] + } + ] + }, + { + "name": "options", + "type": "oneof", + "optional": true, + "multiple": true, + "arguments": [ + { + "name": "and", + "type": "pure-token", + "display_text": "and", + "token": "AND" + }, + { + "name": "or", + "type": "pure-token", + "display_text": "or", + "token": "OR" + }, + { + "name": "limit", + "type": "integer", + "display_text": "limit", + "token": "LIMIT" + }, + { + "name": "withvalues", + "type": "pure-token", + "display_text": "withvalues", + "token": "WITHVALUES" + }, + { + "name": "nocase", + "type": "pure-token", + "display_text": "nocase", + "token": "NOCASE" + } + ] + } + ], + "command_flags": [ + "readonly" + ] + }, + "ARINFO": { + "summary": "Returns metadata about an array.", + "since": "8.8.0", + "group": "array", + "complexity": "O(1), or O(N) with FULL option where N is the number of slices.", + "acl_categories": [ + "@read", + "@array", + "@slow" + ], + "arity": -2, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "full", + "type": "pure-token", + "display_text": "full", + "token": "FULL", + "optional": true + } + ], + "command_flags": [ + "readonly" + ] + }, + "ARINSERT": { + "summary": "Inserts one or more values at consecutive indices.", + "since": "8.8.0", + "group": "array", + "complexity": "O(N) where N is the number of values", + "acl_categories": [ + "@write", + "@array", + "@fast" + ], + "arity": -3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "update": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "value", + "type": "string", + "display_text": "value", + "multiple": true + } + ], + "command_flags": [ + "write", + "denyoom", + "fast" + ] + }, + "ARLASTITEMS": { + "summary": "Returns the most recently inserted elements.", + "since": "8.8.0", + "group": "array", + "complexity": "O(N) where N is the count", + "acl_categories": [ + "@read", + "@array", + "@slow" + ], + "arity": -3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "count", + "type": "integer", + "display_text": "count" + }, + { + "name": "rev", + "type": "pure-token", + "display_text": "rev", + "token": "REV", + "optional": true + } + ], + "command_flags": [ + "readonly" + ] + }, + "ARLEN": { + "summary": "Returns the length of an array (max index + 1).", + "since": "8.8.0", + "group": "array", + "complexity": "O(1)", + "acl_categories": [ + "@read", + "@array", + "@fast" + ], + "arity": 2, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + } + ], + "command_flags": [ + "readonly", + "fast" + ] + }, + "ARMGET": { + "summary": "Gets values at multiple indices in an array.", + "since": "8.8.0", + "group": "array", + "complexity": "O(N) where N is the number of indices", + "acl_categories": [ + "@read", + "@array", + "@fast" + ], + "arity": -3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "index", + "type": "integer", + "display_text": "index", + "multiple": true + } + ], + "command_flags": [ + "readonly", + "fast" + ] + }, + "ARMSET": { + "summary": "Sets multiple index-value pairs in an array.", + "since": "8.8.0", + "group": "array", + "complexity": "O(N) where N is the number of pairs", + "acl_categories": [ + "@write", + "@array", + "@fast" + ], + "arity": -4, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "update": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "data", + "type": "block", + "multiple": true, + "arguments": [ + { + "name": "index", + "type": "integer", + "display_text": "index" + }, + { + "name": "value", + "type": "string", + "display_text": "value" + } + ] + } + ], + "command_flags": [ + "write", + "denyoom", + "fast" + ] + }, + "ARNEXT": { + "summary": "Returns the next index ARINSERT would use.", + "since": "8.8.0", + "group": "array", + "complexity": "O(1)", + "acl_categories": [ + "@read", + "@array", + "@fast" + ], + "arity": 2, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + } + ], + "command_flags": [ + "readonly", + "fast" + ] + }, + "AROP": { + "summary": "Performs aggregate operations on array elements in a range.", + "since": "8.8.0", + "group": "array", + "complexity": "O(P) where P is visited positions in touched slices (dense scanned slots + sparse entries), with worst-case O(|end-start|+1) and typical case close to O(N), where N is the number of existing elements in range.", + "acl_categories": [ + "@read", + "@array", + "@slow" + ], + "arity": -5, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "start", + "type": "integer", + "display_text": "start" + }, + { + "name": "end", + "type": "integer", + "display_text": "end" + }, + { + "name": "operation", + "type": "oneof", + "arguments": [ + { + "name": "sum", + "type": "pure-token", + "display_text": "sum", + "token": "SUM" + }, + { + "name": "min", + "type": "pure-token", + "display_text": "min", + "token": "MIN" + }, + { + "name": "max", + "type": "pure-token", + "display_text": "max", + "token": "MAX" + }, + { + "name": "and", + "type": "pure-token", + "display_text": "and", + "token": "AND" + }, + { + "name": "or", + "type": "pure-token", + "display_text": "or", + "token": "OR" + }, + { + "name": "xor", + "type": "pure-token", + "display_text": "xor", + "token": "XOR" + }, + { + "name": "match", + "type": "block", + "arguments": [ + { + "name": "match", + "type": "pure-token", + "display_text": "match", + "token": "MATCH" + }, + { + "name": "value", + "type": "string", + "display_text": "value" + } + ] + }, + { + "name": "used", + "type": "pure-token", + "display_text": "used", + "token": "USED" + } + ] + } + ], + "command_flags": [ + "readonly" + ] + }, + "ARRING": { + "summary": "Inserts values into a ring buffer of specified size, wrapping and truncating as needed.", + "since": "8.8.0", + "group": "array", + "complexity": "O(M) normally, O(N+M) on ring resize, where N is the maximum of the old and new ring size and M is the number of inserted values", + "acl_categories": [ + "@write", + "@array", + "@slow" + ], + "arity": -4, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "update": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "size", + "type": "integer", + "display_text": "size" + }, + { + "name": "value", + "type": "string", + "display_text": "value", + "multiple": true + } + ], + "command_flags": [ + "write", + "denyoom" + ] + }, + "ARSCAN": { + "summary": "Iterates existing elements in a range, returning index-value pairs.", + "since": "8.8.0", + "group": "array", + "complexity": "O(P) where P is visited positions in touched slices (dense scanned slots + sparse entries), with worst-case O(|end-start|+1) and typical case close to O(N), where N is the number of existing elements in range.", + "acl_categories": [ + "@read", + "@array", + "@slow" + ], + "arity": -4, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RO": true, + "access": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "start", + "type": "integer", + "display_text": "start" + }, + { + "name": "end", + "type": "integer", + "display_text": "end" + }, + { + "name": "limit", + "type": "integer", + "display_text": "limit", + "token": "LIMIT", + "optional": true + } + ], + "command_flags": [ + "readonly" + ] + }, + "ARSEEK": { + "summary": "Sets the ARINSERT / ARRING cursor to a specific index.", + "since": "8.8.0", + "group": "array", + "complexity": "O(1)", + "acl_categories": [ + "@write", + "@array", + "@fast" + ], + "arity": 3, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "update": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "index", + "type": "integer", + "display_text": "index" + } + ], + "command_flags": [ + "write", + "fast" + ] + }, + "ARSET": { + "summary": "Sets one or more contiguous values starting at an index in an array.", + "since": "8.8.0", + "group": "array", + "complexity": "O(N) where N is the number of values", + "acl_categories": [ + "@write", + "@array", + "@fast" + ], + "arity": -4, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "update": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "index", + "type": "integer", + "display_text": "index" + }, + { + "name": "value", + "type": "string", + "display_text": "value", + "multiple": true + } + ], + "command_flags": [ + "write", + "denyoom", + "fast" + ] + }, "ASKING": { "summary": "Signals that a cluster client is following an -ASK redirect.", "since": "3.0.0", @@ -2533,6 +3649,7 @@ ], "command_flags": [ "admin", + "loading", "stale" ], "hints": [ @@ -2751,6 +3868,7 @@ ], "arity": 2, "command_flags": [ + "loading", "stale" ], "hints": [ @@ -2774,6 +3892,7 @@ } ], "command_flags": [ + "loading", "stale" ] }, @@ -2787,6 +3906,7 @@ ], "arity": 2, "command_flags": [ + "loading", "stale" ], "hints": [ @@ -2928,6 +4048,7 @@ ], "arity": 2, "command_flags": [ + "loading", "stale" ] }, @@ -2941,6 +4062,7 @@ ], "arity": 2, "command_flags": [ + "loading", "stale" ], "hints": [ @@ -2957,6 +4079,7 @@ ], "arity": 2, "command_flags": [ + "loading", "stale" ], "hints": [ @@ -2983,6 +4106,7 @@ ], "command_flags": [ "admin", + "loading", "stale" ], "hints": [ @@ -3185,6 +4309,7 @@ ], "command_flags": [ "admin", + "loading", "stale" ], "doc_flags": [ @@ -8269,6 +9394,20 @@ "response_policy:special" ] }, + "HOTKEYS HELP": { + "summary": "Return helpful text about HOTKEYS command parameters.", + "since": "8.6.1", + "group": "server", + "complexity": "O(1)", + "acl_categories": [ + "@slow" + ], + "arity": 2, + "command_flags": [ + "loading", + "stale" + ] + }, "HOTKEYS RESET": { "summary": "Release the resources used for hotkey tracking.", "since": "8.6.0", @@ -9451,23 +10590,176 @@ "keystep": 1, "limit": 0 } - }, - "RW": true, - "access": true, - "update": true - } - ], - "arguments": [ - { - "name": "key", - "type": "key", - "display_text": "key", - "key_spec_index": 0 + }, + "RW": true, + "access": true, + "update": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "increment", + "type": "double", + "display_text": "increment" + } + ], + "command_flags": [ + "write", + "denyoom", + "fast" + ] + }, + "INCREX": { + "summary": "Increments the numeric value of a key by a number and sets its expiration time. Uses 0 as initial value if the key doesn't exist.", + "since": "8.8.0", + "group": "string", + "complexity": "O(1)", + "acl_categories": [ + "@write", + "@string", + "@fast" + ], + "arity": -2, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "access": true, + "update": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "increment", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "float", + "type": "double", + "display_text": "float", + "token": "BYFLOAT" + }, + { + "name": "integer", + "type": "integer", + "display_text": "integer", + "token": "BYINT" + } + ] + }, + { + "name": "overflow-block", + "type": "oneof", + "token": "OVERFLOW", + "summary": "Out-of-bounds policy; defaults to FAIL. Missing LBOUND/UBOUND default to the type limits (LLONG_MIN/LLONG_MAX for BYINT, -LDBL_MAX/LDBL_MAX for BYFLOAT).", + "optional": true, + "arguments": [ + { + "name": "fail", + "type": "pure-token", + "display_text": "fail", + "token": "FAIL" + }, + { + "name": "sat", + "type": "pure-token", + "display_text": "sat", + "token": "SAT" + }, + { + "name": "reject", + "type": "pure-token", + "display_text": "reject", + "token": "REJECT" + } + ] + }, + { + "name": "lowerbound", + "type": "string", + "display_text": "lowerbound", + "token": "LBOUND", + "summary": "Integer when used with BYINT, floating-point when used with BYFLOAT.", + "optional": true + }, + { + "name": "upperbound", + "type": "string", + "display_text": "upperbound", + "token": "UBOUND", + "summary": "Integer when used with BYINT, floating-point when used with BYFLOAT.", + "optional": true + }, + { + "name": "expiration", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "seconds", + "type": "integer", + "display_text": "seconds", + "token": "EX" + }, + { + "name": "milliseconds", + "type": "integer", + "display_text": "milliseconds", + "token": "PX" + }, + { + "name": "unix-time-seconds", + "type": "unix-time", + "display_text": "unix-time-seconds", + "token": "EXAT" + }, + { + "name": "unix-time-milliseconds", + "type": "unix-time", + "display_text": "unix-time-milliseconds", + "token": "PXAT" + }, + { + "name": "persist", + "type": "pure-token", + "display_text": "persist", + "token": "PERSIST" + } + ] }, { - "name": "increment", - "type": "double", - "display_text": "increment" + "name": "enx", + "type": "pure-token", + "display_text": "enx", + "token": "ENX", + "summary": "Only set the expiration if the key currently has no TTL. Requires one of EX/PX/EXAT/PXAT; cannot be combined with PERSIST.", + "optional": true } ], "command_flags": [ @@ -12292,6 +13584,7 @@ } ], "command_flags": [ + "denyoom", "pubsub", "noscript", "loading", @@ -15474,6 +16767,7 @@ } ], "command_flags": [ + "denyoom", "pubsub", "noscript", "loading", @@ -15542,6 +16836,7 @@ } ], "command_flags": [ + "denyoom", "pubsub", "noscript", "loading", @@ -17250,35 +18545,20 @@ { "name": "idmp", "type": "oneof", + "since": "8.6.0", "optional": true, "arguments": [ { - "name": "idmpauto-with-pid", - "type": "block", - "arguments": [ - { - "name": "idmpauto-token", - "type": "pure-token", - "display_text": "idmpauto-token", - "token": "IDMPAUTO" - }, - { - "name": "pid", - "type": "string", - "display_text": "pid" - } - ] + "name": "pid", + "type": "string", + "display_text": "pid", + "token": "IDMPAUTO" }, { - "name": "idmp-with-pid-iid", + "name": "idmp", "type": "block", + "token": "IDMP", "arguments": [ - { - "name": "idmp-token", - "type": "pure-token", - "display_text": "idmp-token", - "token": "IDMP" - }, { "name": "pid", "type": "string", @@ -17521,40 +18801,18 @@ "key_spec_index": 0 }, { - "name": "idmp-duration-block", - "type": "block", - "optional": true, - "arguments": [ - { - "name": "idmp-duration-token", - "type": "pure-token", - "display_text": "idmp-duration-token", - "token": "IDMP-DURATION" - }, - { - "name": "duration", - "type": "integer", - "display_text": "duration" - } - ] + "name": "idmp-duration", + "type": "integer", + "display_text": "idmp-duration", + "token": "IDMP-DURATION", + "optional": true }, { - "name": "idmp-maxsize-block", - "type": "block", - "optional": true, - "arguments": [ - { - "name": "idmp-maxsize-token", - "type": "pure-token", - "display_text": "idmp-maxsize-token", - "token": "IDMP-MAXSIZE" - }, - { - "name": "maxsize", - "type": "integer", - "display_text": "maxsize" - } - ] + "name": "idmp-maxsize", + "type": "integer", + "display_text": "idmp-maxsize", + "token": "IDMP-MAXSIZE", + "optional": true } ], "command_flags": [ @@ -18153,6 +19411,66 @@ "write" ] }, + "XIDMPRECORD": { + "summary": "An internal command for setting IDMP metadata on an existing stream message.", + "since": "8.6.2", + "group": "stream", + "complexity": "O(1)", + "acl_categories": [ + "@write", + "@stream", + "@fast" + ], + "arity": 5, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "update": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "pid", + "type": "string", + "display_text": "pid" + }, + { + "name": "iid", + "type": "string", + "display_text": "iid" + }, + { + "name": "stream-id", + "type": "string", + "display_text": "stream-id" + } + ], + "command_flags": [ + "write", + "denyoom", + "fast" + ] + }, "XINFO": { "summary": "A container for stream introspection commands.", "since": "5.0.0", @@ -18305,6 +19623,10 @@ [ "8.6.0", "Added the `idmp-duration`, `idmp-maxsize`, `pids-tracked`, `iids-tracked`, `iids-added` and `iids-duplicates` fields for IDMP tracking." + ], + [ + "8.8.0", + "Added the `nacked-count` field to consumer groups in `FULL` output." ] ], "acl_categories": [ @@ -18408,6 +19730,111 @@ "fast" ] }, + "XNACK": { + "summary": "Releases claimed messages back to the group's PEL without acknowledging them, making them available for re-delivery.", + "since": "8.8.0", + "group": "stream", + "complexity": "O(1) for each message ID processed.", + "acl_categories": [ + "@write", + "@stream", + "@fast" + ], + "arity": -7, + "key_specs": [ + { + "begin_search": { + "type": "index", + "spec": { + "index": 1 + } + }, + "find_keys": { + "type": "range", + "spec": { + "lastkey": 0, + "keystep": 1, + "limit": 0 + } + }, + "RW": true, + "update": true + } + ], + "arguments": [ + { + "name": "key", + "type": "key", + "display_text": "key", + "key_spec_index": 0 + }, + { + "name": "group", + "type": "string", + "display_text": "group" + }, + { + "name": "mode", + "type": "oneof", + "arguments": [ + { + "name": "silent", + "type": "pure-token", + "display_text": "silent", + "token": "SILENT" + }, + { + "name": "fail", + "type": "pure-token", + "display_text": "fail", + "token": "FAIL" + }, + { + "name": "fatal", + "type": "pure-token", + "display_text": "fatal", + "token": "FATAL" + } + ] + }, + { + "name": "ids", + "type": "block", + "token": "IDS", + "arguments": [ + { + "name": "numids", + "type": "integer", + "display_text": "numids" + }, + { + "name": "id", + "type": "string", + "display_text": "id", + "multiple": true + } + ] + }, + { + "name": "count", + "type": "integer", + "display_text": "count", + "token": "RETRYCOUNT", + "optional": true + }, + { + "name": "force", + "type": "pure-token", + "display_text": "force", + "token": "FORCE", + "optional": true + } + ], + "command_flags": [ + "write", + "fast" + ] + }, "XPENDING": { "summary": "Returns the information and entries from a stream consumer group's pending entries list.", "since": "5.0.0", @@ -19445,6 +20872,12 @@ "since": "6.2.0", "group": "sorted-set", "complexity": "O(N*K)+O(M*log(M)) worst case with N being the smallest input sorted set, K being the number of input sorted sets and M being the number of elements in the resulting sorted set.", + "history": [ + [ + "8.8.0", + "Added `COUNT` aggregate option." + ] + ], "acl_categories": [ "@read", "@sortedset", @@ -19515,6 +20948,13 @@ "type": "pure-token", "display_text": "max", "token": "MAX" + }, + { + "name": "count", + "type": "pure-token", + "display_text": "count", + "token": "COUNT", + "since": "8.8.0" } ] }, @@ -19593,6 +21033,12 @@ "since": "2.0.0", "group": "sorted-set", "complexity": "O(N*K)+O(M*log(M)) worst case with N being the smallest input sorted set, K being the number of input sorted sets and M being the number of elements in the resulting sorted set.", + "history": [ + [ + "8.8.0", + "Added `COUNT` aggregate option." + ] + ], "acl_categories": [ "@write", "@sortedset", @@ -19687,6 +21133,13 @@ "type": "pure-token", "display_text": "max", "token": "MAX" + }, + { + "name": "count", + "type": "pure-token", + "display_text": "count", + "token": "COUNT", + "since": "8.8.0" } ] } @@ -21133,6 +22586,12 @@ "since": "6.2.0", "group": "sorted-set", "complexity": "O(N)+O(M*log(M)) with N being the sum of the sizes of the input sorted sets, and M being the number of elements in the resulting sorted set.", + "history": [ + [ + "8.8.0", + "Added `COUNT` aggregate option." + ] + ], "acl_categories": [ "@read", "@sortedset", @@ -21203,6 +22662,13 @@ "type": "pure-token", "display_text": "max", "token": "MAX" + }, + { + "name": "count", + "type": "pure-token", + "display_text": "count", + "token": "COUNT", + "since": "8.8.0" } ] }, @@ -21224,6 +22690,12 @@ "since": "2.0.0", "group": "sorted-set", "complexity": "O(N)+O(M log(M)) with N being the sum of the sizes of the input sorted sets, and M being the number of elements in the resulting sorted set.", + "history": [ + [ + "8.8.0", + "Added `COUNT` aggregate option." + ] + ], "acl_categories": [ "@write", "@sortedset", @@ -21318,6 +22790,13 @@ "type": "pure-token", "display_text": "max", "token": "MAX" + }, + { + "name": "count", + "type": "pure-token", + "display_text": "count", + "token": "COUNT", + "since": "8.8.0" } ] } diff --git a/data/commands_redisearch.json b/data/commands_redisearch.json index 116a196795..10d5210951 100644 --- a/data/commands_redisearch.json +++ b/data/commands_redisearch.json @@ -37,6 +37,28 @@ "optional": true, "summary": "Specifies the type of data to index, such as HASH or JSON." }, + { + "name": "indexall", + "token": "INDEXALL", + "type": "oneof", + "optional": true, + "since": "8.0.0", + "arguments": [ + { + "name": "enable", + "type": "pure-token", + "token": "ENABLE", + "summary": "Maintains an inverted index of all document IDs for wildcard queries." + }, + { + "name": "disable", + "type": "pure-token", + "token": "DISABLE", + "summary": "Does not maintain an inverted index of all document IDs (default behavior)." + } + ], + "summary": "When enabled, maintains an inverted index of all document IDs to optimize wildcard queries in heavy update scenarios." + }, { "name": "prefix", "type": "block", @@ -211,6 +233,11 @@ "type": "pure-token", "token": "GEO" }, + { + "name": "geoshape", + "type": "pure-token", + "token": "GEOSHAPE" + }, { "name": "vector", "type": "pure-token", @@ -1296,98 +1323,232 @@ }, { "name": "reduce", - "type": "block", + "type": "oneof", "optional": true, "multiple": true, "arguments": [ { - "name": "reduce", - "token": "REDUCE", - "type": "pure-token" - }, - { - "name": "function", - "type": "oneof", + "name": "generic_reduce", + "type": "block", + "summary": "Applies a reducer function, like `SUM` or `COUNT`, on grouped results.", "arguments": [ { - "name": "count", - "type": "pure-token", - "token": "COUNT" + "name": "reduce", + "token": "REDUCE", + "type": "pure-token" }, { - "name": "count_distinct", - "type": "pure-token", - "token": "COUNT_DISTINCT" + "name": "function", + "type": "oneof", + "arguments": [ + { + "name": "count", + "type": "pure-token", + "token": "COUNT" + }, + { + "name": "count_distinct", + "type": "pure-token", + "token": "COUNT_DISTINCT" + }, + { + "name": "count_distinctish", + "type": "pure-token", + "token": "COUNT_DISTINCTISH" + }, + { + "name": "sum", + "type": "pure-token", + "token": "SUM" + }, + { + "name": "min", + "type": "pure-token", + "token": "MIN" + }, + { + "name": "max", + "type": "pure-token", + "token": "MAX" + }, + { + "name": "avg", + "type": "pure-token", + "token": "AVG" + }, + { + "name": "stddev", + "type": "pure-token", + "token": "STDDEV" + }, + { + "name": "quantile", + "type": "pure-token", + "token": "QUANTILE" + }, + { + "name": "tolist", + "type": "pure-token", + "token": "TOLIST" + }, + { + "name": "first_value", + "type": "pure-token", + "token": "FIRST_VALUE" + }, + { + "name": "random_sample", + "type": "pure-token", + "token": "RANDOM_SAMPLE" + } + ] }, { - "name": "count_distinctish", - "type": "pure-token", - "token": "COUNT_DISTINCTISH" + "name": "nargs", + "type": "integer" }, { - "name": "sum", - "type": "pure-token", - "token": "SUM" + "name": "arg", + "type": "string", + "multiple": true }, { - "name": "min", - "type": "pure-token", - "token": "MIN" - }, + "name": "name", + "type": "string", + "token": "AS", + "optional": true + } + ] + }, + { + "name": "collect_reduce", + "type": "block", + "since": "8.8.0", + "arguments": [ { - "name": "max", - "type": "pure-token", - "token": "MAX" + "name": "reduce", + "token": "REDUCE", + "type": "pure-token" }, { - "name": "avg", + "name": "collect_token", "type": "pure-token", - "token": "AVG" + "token": "COLLECT" }, { - "name": "stddev", - "type": "pure-token", - "token": "STDDEV" + "name": "nargs", + "type": "integer" }, { - "name": "quantile", - "type": "pure-token", - "token": "QUANTILE" + "name": "fields", + "type": "block", + "arguments": [ + { + "name": "fields_token", + "type": "pure-token", + "token": "FIELDS" + }, + { + "name": "fields_spec", + "type": "oneof", + "arguments": [ + { + "name": "all", + "type": "pure-token", + "token": "*" + }, + { + "name": "explicit", + "type": "block", + "arguments": [ + { + "name": "num_fields", + "type": "integer" + }, + { + "name": "field", + "type": "string", + "multiple": true + } + ] + } + ] + } + ] }, { - "name": "tolist", - "type": "pure-token", - "token": "TOLIST" + "name": "sortby", + "type": "block", + "optional": true, + "arguments": [ + { + "name": "sortby_token", + "type": "pure-token", + "token": "SORTBY" + }, + { + "name": "nargs", + "type": "integer" + }, + { + "name": "key", + "type": "block", + "multiple": true, + "arguments": [ + { + "name": "field", + "type": "string" + }, + { + "name": "order", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "asc", + "type": "pure-token", + "token": "ASC" + }, + { + "name": "desc", + "type": "pure-token", + "token": "DESC" + } + ] + } + ] + } + ] }, { - "name": "first_value", - "type": "pure-token", - "token": "FIRST_VALUE" + "name": "limit", + "type": "block", + "optional": true, + "arguments": [ + { + "name": "limit_token", + "type": "pure-token", + "token": "LIMIT" + }, + { + "name": "offset", + "type": "integer" + }, + { + "name": "count", + "type": "integer" + } + ] }, { - "name": "random_sample", - "type": "pure-token", - "token": "RANDOM_SAMPLE" + "name": "name", + "type": "string", + "token": "AS", + "optional": true } ] - }, - { - "name": "nargs", - "type": "integer" - }, - { - "name": "arg", - "type": "string", - "multiple": true - }, - { - "name": "name", - "type": "string", - "token": "AS", - "optional": true } - ], - "summary": "Applies a reducer function, like `SUM` or `COUNT`, on grouped results." + ] } ], "summary": "Groups results by specified fields, often used for aggregations." @@ -1895,7 +2056,7 @@ "group": "search" }, "FT.PROFILE": { - "summary": "Performs a `FT.SEARCH` or `FT.AGGREGATE` command and collects performance information", + "summary": "Performs a `FT.SEARCH`, `FT.AGGREGATE`, or `FT.HYBRID` command and collects performance information", "complexity": "O(N)", "arguments": [ { @@ -1916,6 +2077,11 @@ "name": "aggregate", "type": "pure-token", "token": "AGGREGATE" + }, + { + "name": "hybrid", + "type": "pure-token", + "token": "HYBRID" } ] }, @@ -2067,6 +2233,13 @@ "token": "EF_RUNTIME", "optional": true }, + { + "name": "shard_k_ratio", + "type": "double", + "token": "SHARD_K_RATIO", + "optional": true, + "since": "8.6.1" + }, { "name": "yield_score_as", "type": "string", @@ -2360,95 +2533,229 @@ }, { "name": "reduce", - "type": "block", + "type": "oneof", "optional": true, "multiple": true, "arguments": [ { - "name": "reduce", - "type": "pure-token", - "token": "REDUCE" - }, - { - "name": "function", - "type": "oneof", + "name": "generic_reduce", + "type": "block", "arguments": [ { - "name": "count", + "name": "reduce", "type": "pure-token", - "token": "COUNT" + "token": "REDUCE" }, { - "name": "count_distinct", - "type": "pure-token", - "token": "COUNT_DISTINCT" + "name": "function", + "type": "oneof", + "arguments": [ + { + "name": "count", + "type": "pure-token", + "token": "COUNT" + }, + { + "name": "count_distinct", + "type": "pure-token", + "token": "COUNT_DISTINCT" + }, + { + "name": "count_distinctish", + "type": "pure-token", + "token": "COUNT_DISTINCTISH" + }, + { + "name": "sum", + "type": "pure-token", + "token": "SUM" + }, + { + "name": "min", + "type": "pure-token", + "token": "MIN" + }, + { + "name": "max", + "type": "pure-token", + "token": "MAX" + }, + { + "name": "avg", + "type": "pure-token", + "token": "AVG" + }, + { + "name": "stddev", + "type": "pure-token", + "token": "STDDEV" + }, + { + "name": "quantile", + "type": "pure-token", + "token": "QUANTILE" + }, + { + "name": "tolist", + "type": "pure-token", + "token": "TOLIST" + }, + { + "name": "first_value", + "type": "pure-token", + "token": "FIRST_VALUE" + }, + { + "name": "random_sample", + "type": "pure-token", + "token": "RANDOM_SAMPLE" + } + ] }, { - "name": "count_distinctish", - "type": "pure-token", - "token": "COUNT_DISTINCTISH" + "name": "nargs", + "type": "integer" }, { - "name": "sum", - "type": "pure-token", - "token": "SUM" + "name": "arg", + "type": "string", + "multiple": true }, { - "name": "min", - "type": "pure-token", - "token": "MIN" - }, + "name": "name", + "type": "string", + "token": "AS", + "optional": true + } + ] + }, + { + "name": "collect_reduce", + "type": "block", + "since": "8.8.0", + "arguments": [ { - "name": "max", + "name": "reduce", "type": "pure-token", - "token": "MAX" + "token": "REDUCE" }, { - "name": "avg", + "name": "collect_token", "type": "pure-token", - "token": "AVG" + "token": "COLLECT" }, { - "name": "stddev", - "type": "pure-token", - "token": "STDDEV" + "name": "nargs", + "type": "integer" }, { - "name": "quantile", - "type": "pure-token", - "token": "QUANTILE" + "name": "fields", + "type": "block", + "arguments": [ + { + "name": "fields_token", + "type": "pure-token", + "token": "FIELDS" + }, + { + "name": "fields_spec", + "type": "oneof", + "arguments": [ + { + "name": "all", + "type": "pure-token", + "token": "*" + }, + { + "name": "explicit", + "type": "block", + "arguments": [ + { + "name": "num_fields", + "type": "integer" + }, + { + "name": "field", + "type": "string", + "multiple": true + } + ] + } + ] + } + ] }, { - "name": "tolist", - "type": "pure-token", - "token": "TOLIST" + "name": "sortby", + "type": "block", + "optional": true, + "arguments": [ + { + "name": "sortby_token", + "type": "pure-token", + "token": "SORTBY" + }, + { + "name": "nargs", + "type": "integer" + }, + { + "name": "key", + "type": "block", + "multiple": true, + "arguments": [ + { + "name": "field", + "type": "string" + }, + { + "name": "order", + "type": "oneof", + "optional": true, + "arguments": [ + { + "name": "asc", + "type": "pure-token", + "token": "ASC" + }, + { + "name": "desc", + "type": "pure-token", + "token": "DESC" + } + ] + } + ] + } + ] }, { - "name": "first_value", - "type": "pure-token", - "token": "FIRST_VALUE" + "name": "limit", + "type": "block", + "optional": true, + "arguments": [ + { + "name": "limit_token", + "type": "pure-token", + "token": "LIMIT" + }, + { + "name": "offset", + "type": "integer" + }, + { + "name": "count", + "type": "integer" + } + ] }, { - "name": "random_sample", - "type": "pure-token", - "token": "RANDOM_SAMPLE" + "name": "name", + "type": "string", + "token": "AS", + "optional": true } ] - }, - { - "name": "nargs", - "type": "integer" - }, - { - "name": "arg", - "type": "string", - "multiple": true - }, - { - "name": "name", - "type": "string", - "token": "AS", - "optional": true } ] } diff --git a/data/commands_redisjson.json b/data/commands_redisjson.json index c3119eeed8..fcf4855f8a 100644 --- a/data/commands_redisjson.json +++ b/data/commands_redisjson.json @@ -134,6 +134,39 @@ } ], "optional": true + }, + { + "name": "fpha", + "type": "block", + "arguments": [ + { + "name": "fpha-type", + "type": "oneof", + "arguments": [ + { + "name": "FP16", + "type": "pure-token", + "token": "FP16" + }, + { + "name": "BF16", + "type": "pure-token", + "token": "BF16" + }, + { + "name": "FP32", + "type": "pure-token", + "token": "FP32" + }, + { + "name": "FP64", + "type": "pure-token", + "token": "FP64" + } + ] + } + ], + "optional": true } ], "since": "1.0.0", @@ -532,4 +565,4 @@ "since": "1.0.0", "group": "json" } -} +} \ No newline at end of file diff --git a/data/commands_redistimeseries.json b/data/commands_redistimeseries.json index edd317e6dc..482a0947d0 100644 --- a/data/commands_redistimeseries.json +++ b/data/commands_redistimeseries.json @@ -635,89 +635,9 @@ "optional": true }, { - "type": "oneof", + "type": "string", "token": "AGGREGATION", - "name": "aggregator", - "arguments": [ - { - "name": "avg", - "type": "pure-token", - "token": "AVG" - }, - { - "name": "first", - "type": "pure-token", - "token": "FIRST" - }, - { - "name": "last", - "type": "pure-token", - "token": "LAST" - }, - { - "name": "min", - "type": "pure-token", - "token": "MIN" - }, - { - "name": "max", - "type": "pure-token", - "token": "MAX" - }, - { - "name": "sum", - "type": "pure-token", - "token": "SUM" - }, - { - "name": "range", - "type": "pure-token", - "token": "RANGE" - }, - { - "name": "count", - "type": "pure-token", - "token": "COUNT" - }, - { - "name": "std.p", - "type": "pure-token", - "token": "STD.P" - }, - { - "name": "std.s", - "type": "pure-token", - "token": "STD.S" - }, - { - "name": "var.p", - "type": "pure-token", - "token": "VAR.P" - }, - { - "name": "var.s", - "type": "pure-token", - "token": "VAR.S" - }, - { - "name": "twa", - "type": "pure-token", - "token": "TWA", - "since": "1.8.0" - }, - { - "name": "countnan", - "type": "pure-token", - "token": "COUNTNAN", - "since": "8.6.0" - }, - { - "name": "countall", - "type": "pure-token", - "token": "COUNTALL", - "since": "8.6.0" - } - ] + "name": "aggregators" }, { "name": "bucketDuration", @@ -810,89 +730,9 @@ "optional": true }, { - "type": "oneof", + "type": "string", "token": "AGGREGATION", - "name": "aggregator", - "arguments": [ - { - "name": "avg", - "type": "pure-token", - "token": "AVG" - }, - { - "name": "first", - "type": "pure-token", - "token": "FIRST" - }, - { - "name": "last", - "type": "pure-token", - "token": "LAST" - }, - { - "name": "min", - "type": "pure-token", - "token": "MIN" - }, - { - "name": "max", - "type": "pure-token", - "token": "MAX" - }, - { - "name": "sum", - "type": "pure-token", - "token": "SUM" - }, - { - "name": "range", - "type": "pure-token", - "token": "RANGE" - }, - { - "name": "count", - "type": "pure-token", - "token": "COUNT" - }, - { - "name": "std.p", - "type": "pure-token", - "token": "STD.P" - }, - { - "name": "std.s", - "type": "pure-token", - "token": "STD.S" - }, - { - "name": "var.p", - "type": "pure-token", - "token": "VAR.P" - }, - { - "name": "var.s", - "type": "pure-token", - "token": "VAR.S" - }, - { - "name": "twa", - "type": "pure-token", - "token": "TWA", - "since": "1.8.0" - }, - { - "name": "countnan", - "type": "pure-token", - "token": "COUNTNAN", - "since": "8.6.0" - }, - { - "name": "countall", - "type": "pure-token", - "token": "COUNTALL", - "since": "8.6.0" - } - ] + "name": "aggregators" }, { "name": "bucketDuration", @@ -1041,89 +881,9 @@ "optional": true }, { - "type": "oneof", + "type": "string", "token": "AGGREGATION", - "name": "aggregator", - "arguments": [ - { - "name": "avg", - "type": "pure-token", - "token": "AVG" - }, - { - "name": "first", - "type": "pure-token", - "token": "FIRST" - }, - { - "name": "last", - "type": "pure-token", - "token": "LAST" - }, - { - "name": "min", - "type": "pure-token", - "token": "MIN" - }, - { - "name": "max", - "type": "pure-token", - "token": "MAX" - }, - { - "name": "sum", - "type": "pure-token", - "token": "SUM" - }, - { - "name": "range", - "type": "pure-token", - "token": "RANGE" - }, - { - "name": "count", - "type": "pure-token", - "token": "COUNT" - }, - { - "name": "std.p", - "type": "pure-token", - "token": "STD.P" - }, - { - "name": "std.s", - "type": "pure-token", - "token": "STD.S" - }, - { - "name": "var.p", - "type": "pure-token", - "token": "VAR.P" - }, - { - "name": "var.s", - "type": "pure-token", - "token": "VAR.S" - }, - { - "name": "twa", - "type": "pure-token", - "token": "TWA", - "since": "1.8.0" - }, - { - "name": "countnan", - "type": "pure-token", - "token": "COUNTNAN", - "since": "8.6.0" - }, - { - "name": "countall", - "type": "pure-token", - "token": "COUNTALL", - "since": "8.6.0" - } - ] + "name": "aggregators" }, { "name": "bucketDuration", @@ -1298,89 +1058,9 @@ "optional": true }, { - "type": "oneof", + "type": "string", "token": "AGGREGATION", - "name": "aggregator", - "arguments": [ - { - "name": "avg", - "type": "pure-token", - "token": "AVG" - }, - { - "name": "first", - "type": "pure-token", - "token": "FIRST" - }, - { - "name": "last", - "type": "pure-token", - "token": "LAST" - }, - { - "name": "min", - "type": "pure-token", - "token": "MIN" - }, - { - "name": "max", - "type": "pure-token", - "token": "MAX" - }, - { - "name": "sum", - "type": "pure-token", - "token": "SUM" - }, - { - "name": "range", - "type": "pure-token", - "token": "RANGE" - }, - { - "name": "count", - "type": "pure-token", - "token": "COUNT" - }, - { - "name": "std.p", - "type": "pure-token", - "token": "STD.P" - }, - { - "name": "std.s", - "type": "pure-token", - "token": "STD.S" - }, - { - "name": "var.p", - "type": "pure-token", - "token": "VAR.P" - }, - { - "name": "var.s", - "type": "pure-token", - "token": "VAR.S" - }, - { - "name": "twa", - "type": "pure-token", - "token": "TWA", - "since": "1.8.0" - }, - { - "name": "countnan", - "type": "pure-token", - "token": "COUNTNAN", - "since": "8.6.0" - }, - { - "name": "countall", - "type": "pure-token", - "token": "COUNTALL", - "since": "8.6.0" - } - ] + "name": "aggregators" }, { "name": "bucketDuration", diff --git a/layouts/commands/list.html b/layouts/commands/list.html index ecb4e27895..f8ee13ba27 100644 --- a/layouts/commands/list.html +++ b/layouts/commands/list.html @@ -29,6 +29,7 @@

Commands

{{ $id }} {{ end */}} + @@ -41,6 +42,7 @@

Commands

+ diff --git a/static/images/railroad/arcount.svg b/static/images/railroad/arcount.svg new file mode 100644 index 0000000000..449c2d0943 --- /dev/null +++ b/static/images/railroad/arcount.svg @@ -0,0 +1,49 @@ + + + + + + + + +ARCOUNT +key \ No newline at end of file diff --git a/static/images/railroad/ardel.svg b/static/images/railroad/ardel.svg new file mode 100644 index 0000000000..7e7a67a2c3 --- /dev/null +++ b/static/images/railroad/ardel.svg @@ -0,0 +1,52 @@ + + + + + + + + +ARDEL +key + +index + \ No newline at end of file diff --git a/static/images/railroad/ardelrange.svg b/static/images/railroad/ardelrange.svg new file mode 100644 index 0000000000..67159f5b27 --- /dev/null +++ b/static/images/railroad/ardelrange.svg @@ -0,0 +1,54 @@ + + + + + + + + +ARDELRANGE +key + + +start +end + \ No newline at end of file diff --git a/static/images/railroad/arget.svg b/static/images/railroad/arget.svg new file mode 100644 index 0000000000..4f9a340501 --- /dev/null +++ b/static/images/railroad/arget.svg @@ -0,0 +1,50 @@ + + + + + + + + +ARGET +key +index \ No newline at end of file diff --git a/static/images/railroad/argetrange.svg b/static/images/railroad/argetrange.svg new file mode 100644 index 0000000000..be807787f8 --- /dev/null +++ b/static/images/railroad/argetrange.svg @@ -0,0 +1,51 @@ + + + + + + + + +ARGETRANGE +key +start +end \ No newline at end of file diff --git a/static/images/railroad/argrep.svg b/static/images/railroad/argrep.svg new file mode 100644 index 0000000000..1f6dc38c0c --- /dev/null +++ b/static/images/railroad/argrep.svg @@ -0,0 +1,105 @@ + + + + + + + + +ARGREP +key +start +end + + + +EXACT +string + +MATCH +string + +GLOB +pattern + +RE +pattern + + + + + +EXACT +string + +MATCH +string + +GLOB +pattern + +RE +pattern + + + + + +AND +OR + +LIMIT +limit +WITHVALUES +NOCASE + + + + +AND +OR + +LIMIT +limit +WITHVALUES +NOCASE + \ No newline at end of file diff --git a/static/images/railroad/arinfo.svg b/static/images/railroad/arinfo.svg new file mode 100644 index 0000000000..6b8bf8eb17 --- /dev/null +++ b/static/images/railroad/arinfo.svg @@ -0,0 +1,52 @@ + + + + + + + + +ARINFO +key + + +FULL \ No newline at end of file diff --git a/static/images/railroad/arinsert.svg b/static/images/railroad/arinsert.svg new file mode 100644 index 0000000000..ef44bb179f --- /dev/null +++ b/static/images/railroad/arinsert.svg @@ -0,0 +1,52 @@ + + + + + + + + +ARINSERT +key + +value + \ No newline at end of file diff --git a/static/images/railroad/arlastitems.svg b/static/images/railroad/arlastitems.svg new file mode 100644 index 0000000000..2d73636d66 --- /dev/null +++ b/static/images/railroad/arlastitems.svg @@ -0,0 +1,53 @@ + + + + + + + + +ARLASTITEMS +key +count + + +REV \ No newline at end of file diff --git a/static/images/railroad/arlen.svg b/static/images/railroad/arlen.svg new file mode 100644 index 0000000000..8ae79e708c --- /dev/null +++ b/static/images/railroad/arlen.svg @@ -0,0 +1,49 @@ + + + + + + + + +ARLEN +key \ No newline at end of file diff --git a/static/images/railroad/armget.svg b/static/images/railroad/armget.svg new file mode 100644 index 0000000000..d9a5ebb92d --- /dev/null +++ b/static/images/railroad/armget.svg @@ -0,0 +1,52 @@ + + + + + + + + +ARMGET +key + +index + \ No newline at end of file diff --git a/static/images/railroad/armset.svg b/static/images/railroad/armset.svg new file mode 100644 index 0000000000..f0a648ba3f --- /dev/null +++ b/static/images/railroad/armset.svg @@ -0,0 +1,54 @@ + + + + + + + + +ARMSET +key + + +index +value + \ No newline at end of file diff --git a/static/images/railroad/arnext.svg b/static/images/railroad/arnext.svg new file mode 100644 index 0000000000..75ed7dd197 --- /dev/null +++ b/static/images/railroad/arnext.svg @@ -0,0 +1,49 @@ + + + + + + + + +ARNEXT +key \ No newline at end of file diff --git a/static/images/railroad/arop.svg b/static/images/railroad/arop.svg new file mode 100644 index 0000000000..aef97625a4 --- /dev/null +++ b/static/images/railroad/arop.svg @@ -0,0 +1,62 @@ + + + + + + + + +AROP +key +start +end + +SUM +MIN +MAX +AND +OR +XOR + +MATCH +value +USED \ No newline at end of file diff --git a/static/images/railroad/arring.svg b/static/images/railroad/arring.svg new file mode 100644 index 0000000000..e983a83bf7 --- /dev/null +++ b/static/images/railroad/arring.svg @@ -0,0 +1,53 @@ + + + + + + + + +ARRING +key +size + +value + \ No newline at end of file diff --git a/static/images/railroad/arscan.svg b/static/images/railroad/arscan.svg new file mode 100644 index 0000000000..e2015af59c --- /dev/null +++ b/static/images/railroad/arscan.svg @@ -0,0 +1,56 @@ + + + + + + + + +ARSCAN +key +start +end + + + +LIMIT +limit \ No newline at end of file diff --git a/static/images/railroad/arseek.svg b/static/images/railroad/arseek.svg new file mode 100644 index 0000000000..ece6494763 --- /dev/null +++ b/static/images/railroad/arseek.svg @@ -0,0 +1,50 @@ + + + + + + + + +ARSEEK +key +index \ No newline at end of file diff --git a/static/images/railroad/arset.svg b/static/images/railroad/arset.svg new file mode 100644 index 0000000000..ae24f184ea --- /dev/null +++ b/static/images/railroad/arset.svg @@ -0,0 +1,53 @@ + + + + + + + + +ARSET +key +index + +value + \ No newline at end of file diff --git a/static/images/railroad/ft.aggregate.svg b/static/images/railroad/ft.aggregate.svg index 73e02e3db3..565ad4f76c 100644 --- a/static/images/railroad/ft.aggregate.svg +++ b/static/images/railroad/ft.aggregate.svg @@ -1,4 +1,4 @@ - + - + FT.AGGREGATE index query @@ -68,102 +68,233 @@ circle { fill: #DC382D !important; stroke: #DC382D !important; } LOAD * - - - - + + + + GROUPBY nargs property - - - - - -REDUCE -function -nargs - -arg - - - - -AS -name - - - - - - -SORTBY -nargs - - - - -property - -ASC -DESC - - - - -MAX -num - - - - - -APPLY -expression - -AS -name - - - - -LIMIT -offset -num - - - -FILTER -filter - - - -WITHCURSOR - - - -COUNT -read_size - - - -MAXIDLE -idle_time - - - -PARAMS -nargs - - -name -value - - - - -DIALECT -dialect \ No newline at end of file + + + + +REDUCE + + + +COUNT +COUNT_DISTINCT +COUNT_DISTINCTISH +SUM +MIN +MAX +AVG +STDDEV +QUANTILE +TOLIST +FIRST_VALUE +RANDOM_SAMPLE +nargs + +arg + + +COLLECT +nargs + + + +FIELDS +num_fields + +field + +FIELDS * + + + +SORTBY +nargs + + +field + + + +ASC +DESC + + + + +LIMIT +offset +count + + + +AS +name + + + + + + +SORTBY +nargs + + + + +property + +ASC +DESC + + + + +MAX +num + + + + + +APPLY + +exists +exists + +log +log + +abs +abs + +ceil +ceil + +floor +floor + +log2 +log2 + +exp +exp + +sqrt +sqrt + +upper +upper + +lower +lower + +startswith +startswith + +contains +contains + +strlen +strlen + +substr +substr + +format +format + +matched_terms +matched_terms + +split +split + +timefmt +timefmt + +parsetime +parsetime + +day +day + +hour +hour + +minute +minute + +month +month + +dayofweek +dayofweek + +dayofmonth +dayofmonth + +dayofyear +dayofyear + +year +year + +monthofyear +monthofyear + +geodistance +geodistance + +AS +name + + + + +LIMIT +offset +num + + + +FILTER +filter + + + +WITHCURSOR + + + +COUNT +read_size + + + +MAXIDLE +idle_time + + + +PARAMS +nargs + + +name +value + + + + +DIALECT +dialect \ No newline at end of file diff --git a/static/images/railroad/ft.hybrid.svg b/static/images/railroad/ft.hybrid.svg index 2010cb4a50..7de82a5fca 100644 --- a/static/images/railroad/ft.hybrid.svg +++ b/static/images/railroad/ft.hybrid.svg @@ -1,4 +1,4 @@ - + - + FT.HYBRID index @@ -60,195 +60,333 @@ circle { fill: #DC382D !important; stroke: #DC382D !important; } YIELD_SCORE_AS yield_score_as - + VSIM field vector - - - - -KNN -count - -K -k - - - -EF_RUNTIME -ef_runtime - - - -YIELD_SCORE_AS -yield_score_as - -RANGE -count - -RADIUS -radius - - - -EPSILON -epsilon - - - -YIELD_SCORE_AS -yield_score_as - - - -FILTER -filter - - - -COMBINE - - -RRF -count - - - -CONSTANT -constant - - - -WINDOW -window - - - -YIELD_SCORE_AS -yield_score_as - -LINEAR -count - - - - -ALPHA -alpha - -BETA -beta - - - -WINDOW -window - - - -YIELD_SCORE_AS -yield_score_as - - - -LIMIT -offset -num - - - - - -SORTBY -sortby - - - -ASC -DESC -NOSORT - - - -PARAMS -nargs - - -name -value - - - - -TIMEOUT -timeout - - - -FORMAT -format - - - - -LOAD -count - -field - - - -LOAD * - - - -GROUPBY -nproperties - -property - - - - - -REDUCE - -COUNT -COUNT_DISTINCT -COUNT_DISTINCTISH -SUM -MIN -MAX -AVG -STDDEV -QUANTILE -TOLIST -FIRST_VALUE -RANDOM_SAMPLE -nargs - -arg - - - - -AS -name - - - - - - -APPLY -expression - -AS -name - - - - -FILTER -filter \ No newline at end of file + + + + +KNN +count + +K +k + + + +EF_RUNTIME +ef_runtime + + + +SHARD_K_RATIO +shard_k_ratio + + + +YIELD_SCORE_AS +yield_score_as + +RANGE +count + +RADIUS +radius + + + +EPSILON +epsilon + + + +YIELD_SCORE_AS +yield_score_as + + + +FILTER +filter + + + +COMBINE + + +RRF +count + + + +CONSTANT +constant + + + +WINDOW +window + + + +YIELD_SCORE_AS +yield_score_as + +LINEAR +count + + + + +ALPHA +alpha + +BETA +beta + + + +WINDOW +window + + + +YIELD_SCORE_AS +yield_score_as + + + +LIMIT +offset +num + + + + + +SORTBY +sortby + + + +ASC +DESC +NOSORT + + + +PARAMS +nargs + + +name +value + + + + +TIMEOUT +timeout + + + +FORMAT +format + + + + +LOAD +count + +field + + + +LOAD * + + + +GROUPBY +nproperties + +property + + + + + +REDUCE + + + +COUNT +COUNT_DISTINCT +COUNT_DISTINCTISH +SUM +MIN +MAX +AVG +STDDEV +QUANTILE +TOLIST +FIRST_VALUE +RANDOM_SAMPLE +nargs + +arg + + +COLLECT +nargs + + + +FIELDS +num_fields + +field + +FIELDS * + + + +SORTBY +nargs + + +field + + + +ASC +DESC + + + + +LIMIT +offset +count + + + +AS +name + + + + + + +APPLY + +exists +exists + +log +log + +abs +abs + +ceil +ceil + +floor +floor + +log2 +log2 + +exp +exp + +sqrt +sqrt + +upper +upper + +lower +lower + +startswith +startswith + +contains +contains + +strlen +strlen + +substr +substr + +format +format + +matched_terms +matched_terms + +split +split + +timefmt +timefmt + +parsetime +parsetime + +day +day + +hour +hour + +minute +minute + +month +month + +dayofweek +dayofweek + +dayofmonth +dayofmonth + +dayofyear +dayofyear + +year +year + +monthofyear +monthofyear + +geodistance +geodistance + +AS +name + + + + +FILTER +count +filter_expression + + + +POLICY + +ADHOC +BATCHES + + + +BATCH_SIZE +batch_size_value \ No newline at end of file diff --git a/static/images/railroad/increx.svg b/static/images/railroad/increx.svg new file mode 100644 index 0000000000..4dd0594bfb --- /dev/null +++ b/static/images/railroad/increx.svg @@ -0,0 +1,90 @@ + + + + + + + + +INCREX +key + + + + +BYFLOAT +float + +BYINT +integer + + +SATURATE + + + +LBOUND +lowerbound + + + +UBOUND +upperbound + + + + +EX +seconds + +PX +milliseconds + +EXAT +unix-time-seconds + +PXAT +unix-time-milliseconds +PERSIST + + +ENX \ No newline at end of file diff --git a/static/images/railroad/json.set.svg b/static/images/railroad/json.set.svg index bdc4abfb2d..a732cf08e5 100644 --- a/static/images/railroad/json.set.svg +++ b/static/images/railroad/json.set.svg @@ -1,4 +1,4 @@ - + - + JSON.SET key path @@ -53,4 +53,13 @@ circle { fill: #DC382D !important; stroke: #DC382D !important; } NX -XX \ No newline at end of file +XX + + + +FPHA + +FP16 +BF16 +FP32 +FP64 \ No newline at end of file diff --git a/static/images/railroad/ts.mrange.svg b/static/images/railroad/ts.mrange.svg index 8e422fa8c2..c4949d5188 100644 --- a/static/images/railroad/ts.mrange.svg +++ b/static/images/railroad/ts.mrange.svg @@ -1,4 +1,4 @@ - + - + TS.MRANGE fromTimestamp toTimestamp @@ -78,64 +78,51 @@ circle { fill: #DC382D !important; stroke: #DC382D !important; } COUNT count - - - + + + ALIGN value - -AGGREGATION - -AVG -FIRST -LAST -MIN -MAX -SUM -RANGE -COUNT -STD.P -STD.S -VAR.P -VAR.S -TWA -bucketDuration - - -BUCKETTIMESTAMP - - -EMPTY - - -FILTER - -l=v -l!=v -l= -l!= -l=(v1,v2,...) -l!=(v1,v2,...) - - - - -FILTER - -l=v -l!=v -l= -l!= -l=(v1,v2,...) -l!=(v1,v2,...) - - - - -GROUPBY -label -REDUCE -reducer \ No newline at end of file + +AGGREGATION +aggregators +bucketDuration + + +BUCKETTIMESTAMP + + +EMPTY + + +FILTER + +l=v +l!=v +l= +l!= +l=(v1,v2,...) +l!=(v1,v2,...) + + + + +FILTER + +l=v +l!=v +l= +l!= +l=(v1,v2,...) +l!=(v1,v2,...) + + + + +GROUPBY +label +REDUCE +reducer \ No newline at end of file diff --git a/static/images/railroad/ts.mrevrange.svg b/static/images/railroad/ts.mrevrange.svg index c7aa3437a1..cbc1eae947 100644 --- a/static/images/railroad/ts.mrevrange.svg +++ b/static/images/railroad/ts.mrevrange.svg @@ -1,4 +1,4 @@ - + - + TS.MREVRANGE fromTimestamp toTimestamp - -LATEST + +LATEST @@ -78,64 +78,51 @@ circle { fill: #DC382D !important; stroke: #DC382D !important; } COUNT count - - - + + + ALIGN value - -AGGREGATION - -AVG -FIRST -LAST -MIN -MAX -SUM -RANGE -COUNT -STD.P -STD.S -VAR.P -VAR.S -TWA -bucketDuration - - -BUCKETTIMESTAMP - - -EMPTY - - -FILTER - -l=v -l!=v -l= -l!= -l=(v1,v2,...) -l!=(v1,v2,...) - - - - -FILTER - -l=v -l!=v -l= -l!= -l=(v1,v2,...) -l!=(v1,v2,...) - - - - -GROUPBY -label -REDUCE -reducer \ No newline at end of file + +AGGREGATION +aggregators +bucketDuration + + +BUCKETTIMESTAMP + + +EMPTY + + +FILTER + +l=v +l!=v +l= +l!= +l=(v1,v2,...) +l!=(v1,v2,...) + + + + +FILTER + +l=v +l!=v +l= +l!= +l=(v1,v2,...) +l!=(v1,v2,...) + + + + +GROUPBY +label +REDUCE +reducer \ No newline at end of file diff --git a/static/images/railroad/ts.range.svg b/static/images/railroad/ts.range.svg index 295c82a2aa..cfffdcad2e 100644 --- a/static/images/railroad/ts.range.svg +++ b/static/images/railroad/ts.range.svg @@ -1,4 +1,4 @@ - + - + TS.RANGE key fromTimestamp @@ -70,34 +70,21 @@ circle { fill: #DC382D !important; stroke: #DC382D !important; } COUNT count - - - + + + ALIGN value - -AGGREGATION - -AVG -FIRST -LAST -MIN -MAX -SUM -RANGE -COUNT -STD.P -STD.S -VAR.P -VAR.S -TWA -bucketDuration - - -BUCKETTIMESTAMP - - -EMPTY \ No newline at end of file + +AGGREGATION +aggregators +bucketDuration + + +BUCKETTIMESTAMP + + +EMPTY \ No newline at end of file diff --git a/static/images/railroad/ts.revrange.svg b/static/images/railroad/ts.revrange.svg index 164c7297b9..83769d4403 100644 --- a/static/images/railroad/ts.revrange.svg +++ b/static/images/railroad/ts.revrange.svg @@ -1,4 +1,4 @@ - + - + TS.REVRANGE key fromTimestamp @@ -70,34 +70,29 @@ circle { fill: #DC382D !important; stroke: #DC382D !important; } COUNT count - - - + + + ALIGN value - -AGGREGATION - -AVG -FIRST -LAST -MIN -MAX -SUM -RANGE -COUNT -STD.P -STD.S -VAR.P -VAR.S -TWA -bucketDuration - - -BUCKETTIMESTAMP - - -EMPTY \ No newline at end of file + +AGGREGATION +aggregators +bucketDuration + + + +BUCKETTIMESTAMP + +- +start ++ +end +~ +mid + + +EMPTY \ No newline at end of file diff --git a/static/images/railroad/xidmprecord.svg b/static/images/railroad/xidmprecord.svg new file mode 100644 index 0000000000..8f58ac9797 --- /dev/null +++ b/static/images/railroad/xidmprecord.svg @@ -0,0 +1,52 @@ + + + + + + + + +XIDMPRECORD +key +pid +iid +stream-id \ No newline at end of file diff --git a/static/images/railroad/xnack.svg b/static/images/railroad/xnack.svg new file mode 100644 index 0000000000..537a092535 --- /dev/null +++ b/static/images/railroad/xnack.svg @@ -0,0 +1,68 @@ + + + + + + + + +XNACK +key +group + +SILENT +FAIL +FATAL + +IDS +numids + +id + + + + +RETRYCOUNT +count + + +FORCE \ No newline at end of file diff --git a/static/images/railroad/zinter.svg b/static/images/railroad/zinter.svg index 87c1256379..65ebf44ca5 100644 --- a/static/images/railroad/zinter.svg +++ b/static/images/railroad/zinter.svg @@ -1,4 +1,4 @@ - + - + ZINTER numkeys @@ -57,14 +57,15 @@ circle { fill: #DC382D !important; stroke: #DC382D !important; } weight - - - + + + AGGREGATE - -SUM -MIN -MAX - - -WITHSCORES \ No newline at end of file + +SUM +MIN +MAX +COUNT + + +WITHSCORES \ No newline at end of file diff --git a/static/images/railroad/zinterstore.svg b/static/images/railroad/zinterstore.svg index 20ea29f26e..845f3d0173 100644 --- a/static/images/railroad/zinterstore.svg +++ b/static/images/railroad/zinterstore.svg @@ -1,4 +1,4 @@ - + - + ZINTERSTORE destination numkeys @@ -58,11 +58,12 @@ circle { fill: #DC382D !important; stroke: #DC382D !important; } weight - - - + + + AGGREGATE - -SUM -MIN -MAX \ No newline at end of file + +SUM +MIN +MAX +COUNT \ No newline at end of file diff --git a/static/images/railroad/zunion.svg b/static/images/railroad/zunion.svg index 8d8d68043a..f51fa35588 100644 --- a/static/images/railroad/zunion.svg +++ b/static/images/railroad/zunion.svg @@ -1,4 +1,4 @@ - + - + ZUNION numkeys @@ -57,14 +57,15 @@ circle { fill: #DC382D !important; stroke: #DC382D !important; } weight - - - + + + AGGREGATE - -SUM -MIN -MAX - - -WITHSCORES \ No newline at end of file + +SUM +MIN +MAX +COUNT + + +WITHSCORES \ No newline at end of file diff --git a/static/images/railroad/zunionstore.svg b/static/images/railroad/zunionstore.svg index a3bd8a3993..f69a758460 100644 --- a/static/images/railroad/zunionstore.svg +++ b/static/images/railroad/zunionstore.svg @@ -1,4 +1,4 @@ - + - + ZUNIONSTORE destination numkeys @@ -58,11 +58,12 @@ circle { fill: #DC382D !important; stroke: #DC382D !important; } weight - - - + + + AGGREGATE - -SUM -MIN -MAX \ No newline at end of file + +SUM +MIN +MAX +COUNT \ No newline at end of file