url
stringlengths
38
157
content
stringlengths
72
15.1M
https://redis.io/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-109/.html
<section class="prose w-full py-12 max-w-none"> <h1> Redis Enterprise Software release notes 7.2.4-109 (May 2024) </h1> <p class="text-lg -mt-5 mb-10"> Bug fixes. </p> <p> This is a maintenance release for ​ <a href="https://redis.com/redis-enterprise-software/download-center/software/"> ​Redis Enterprise Software version 7.2.4 </a> . </p> <h2 id="highlights"> Highlights </h2> <p> This version offers: </p> <ul> <li> Bug fixes </li> </ul> <h2 id="new-in-this-release"> New in this release </h2> <h3 id="enhancements"> Enhancements </h3> <h4 id="redis-modules"> Redis modules </h4> <p> Redis Enterprise Software versions 7.2.4-109 includes the following Redis Stack modules: </p> <ul> <li> <p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/redisearch-2.8-release-notes"> RediSearch 2.8.9 </a> </p> </li> <li> <p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisjson/redisjson-2.6-release-notes"> RedisJSON 2.6.6 </a> </p> </li> <li> <p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redistimeseries/redistimeseries-1.10-release-notes"> RedisTimeSeries 1.10.6 </a> </p> </li> <li> <p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisbloom/redisbloom-2.6-release-notes"> RedisBloom 2.6.11 </a> </p> </li> <li> <p> <a href="https://github.com/RedisGears/RedisGears/releases/tag/v2.0.17-m18"> RedisGears 2.0.17 </a> </p> </li> </ul> <h3 id="resolved-issues"> Resolved issues </h3> <ul> <li> <p> RS121673: Search commands no longer return an error after fixing incorrect configuration. </p> </li> <li> <p> RS123237: CRDT syncer prevents potential data mismatches or data loss due to missing keys when removing and re-adding a cluster in an Active-Active setup with at least three participating clusters after removing older clusters without re-adding them. </p> </li> <li> <p> RS122221: <code> redis-server </code> creates PID file only after binding to a socket. </p> </li> </ul> <h2 id="version-changes"> Version changes </h2> <h3 id="supported-platforms"> Supported platforms </h3> <p> The following table provides a snapshot of supported platforms as of this Redis Enterprise Software release. See the <a href="/docs/latest/operate/rs/references/supported-platforms/"> supported platforms reference </a> for more details about operating system compatibility. </p> <p> <span title="Check mark icon"> βœ… </span> Supported – The platform is supported for this version of Redis Enterprise Software and Redis Stack modules. </p> <p> <span class="font-serif" title="Warning icon"> ⚠️ </span> Deprecation warning – The platform is still supported for this version of Redis Enterprise Software, but support will be removed in a future release. </p> <table> <thead> <tr> <th> Redis Enterprise <br/> major versions </th> <th style="text-align:center"> 7.4 </th> <th style="text-align:center"> 7.2 </th> <th style="text-align:center"> 6.4 </th> <th style="text-align:center"> 6.2 </th> </tr> </thead> <tbody> <tr> <td> <strong> Release date </strong> </td> <td style="text-align:center"> Feb 2024 </td> <td style="text-align:center"> Aug 2023 </td> <td style="text-align:center"> Feb 2023 </td> <td style="text-align:center"> Aug 2021 </td> </tr> <tr> <td> <a href="/docs/latest/operate/rs/installing-upgrading/product-lifecycle/#endoflife-schedule"> <strong> End-of-life date </strong> </a> </td> <td style="text-align:center"> Determined after <br/> next major release </td> <td style="text-align:center"> July 2025 </td> <td style="text-align:center"> Feb 2025 </td> <td style="text-align:center"> Aug 2024 </td> </tr> <tr> <td> <strong> Platforms </strong> </td> <td style="text-align:center"> </td> <td style="text-align:center"> </td> <td style="text-align:center"> </td> <td style="text-align:center"> </td> </tr> <tr> <td> RHEL 9 &amp; <br/> compatible distros <sup> <a href="#table-note-1"> 1 </a> </sup> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> <td style="text-align:center"> – </td> <td style="text-align:center"> – </td> <td style="text-align:center"> – </td> </tr> <tr> <td> RHEL 8 &amp; <br/> compatible distros <sup> <a href="#table-note-1"> 1 </a> </sup> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> </tr> <tr> <td> RHEL 7 &amp; <br/> compatible distros <sup> <a href="#table-note-1"> 1 </a> </sup> </td> <td style="text-align:center"> – </td> <td style="text-align:center"> <span class="font-serif" title="Deprecated"> ⚠️ </span> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> </tr> <tr> <td> Ubuntu 20.04 <sup> <a href="#table-note-2"> 2 </a> </sup> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> <td style="text-align:center"> – </td> </tr> <tr> <td> Ubuntu 18.04 <sup> <a href="#table-note-2"> 2 </a> </sup> </td> <td style="text-align:center"> <span class="font-serif" title="Deprecated"> ⚠️ </span> </td> <td style="text-align:center"> <span class="font-serif" title="Deprecated"> ⚠️ </span> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> </tr> <tr> <td> Ubuntu 16.04 <sup> <a href="#table-note-2"> 2 </a> </sup> </td> <td style="text-align:center"> – </td> <td style="text-align:center"> <span class="font-serif" title="Deprecated"> ⚠️ </span> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> </tr> <tr> <td> Amazon Linux 2 </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> <td style="text-align:center"> – </td> </tr> <tr> <td> Amazon Linux 1 </td> <td style="text-align:center"> – </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> </tr> <tr> <td> Kubernetes <sup> <a href="#table-note-3"> 3 </a> </sup> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> </tr> <tr> <td> Docker <sup> <a href="#table-note-4"> 4 </a> </sup> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> <td style="text-align:center"> <span title="Supported"> βœ… </span> </td> </tr> </tbody> </table> <ol> <li> <p> <a name="table-note-1" style="display: block; height: 80px; margin-top: -80px;"> </a> The RHEL-compatible distributions CentOS, CentOS Stream, Alma, and Rocky are supported if they have full RHEL compatibility. Oracle Linux running the Red Hat Compatible Kernel (RHCK) is supported, but the Unbreakable Enterprise Kernel (UEK) is not supported. </p> </li> <li> <p> <a name="table-note-2" style="display: block; height: 80px; margin-top: -80px;"> </a> The server version of Ubuntu is recommended for production installations. The desktop version is only recommended for development deployments. </p> </li> <li> <p> <a name="table-note-3" style="display: block; height: 80px; margin-top: -80px;"> </a> See the <a href="/docs/latest/operate/kubernetes/reference/supported_k8s_distributions/"> Redis Enterprise for Kubernetes documentation </a> for details about support per version and Kubernetes distribution. </p> </li> <li> <p> <a name="table-note-4" style="display: block; height: 80px; margin-top: -80px;"> </a> <a href="/docs/latest/operate/rs/installing-upgrading/quickstarts/docker-quickstart/"> Docker images </a> of Redis Enterprise Software are certified for development and testing only. </p> </li> </ol> <h2 id="downloads"> Downloads </h2> <p> The following table shows the MD5 checksums for the available packages: </p> <table> <thead> <tr> <th> Package </th> <th> MD5 checksum (7.2.4-109 May release) </th> </tr> </thead> <tbody> <tr> <td> Ubuntu 18 </td> <td> ae041ffa0eee0652afe69767683a64e4 </td> </tr> <tr> <td> Ubuntu 20 </td> <td> 9e33c630f357a657eed8f084eec70d8d </td> </tr> <tr> <td> Red Hat Enterprise Linux (RHEL) 7 </td> <td> 8f3c56ad8ae2a790a31e2253eaaa1ccc </td> </tr> <tr> <td> Red Hat Enterprise Linux (RHEL) 8 </td> <td> 974c6815bfd53bf74e349b2beae1780f </td> </tr> <tr> <td> Amazon Linux 2 </td> <td> 70c7a8560ee96d72065132e77cb79fe0 </td> </tr> </tbody> </table> <h2 id="security"> Security </h2> <h4 id="open-source-redis-security-fixes-compatibility"> Open source Redis security fixes compatibility </h4> <p> As part of Redis's commitment to security, Redis Enterprise Software implements the latest <a href="https://github.com/redis/redis/releases"> security fixes </a> available with <a href="https://github.com/redis/redis"> open source Redis </a> . Redis Enterprise has already included the fixes for the relevant CVEs. </p> <p> Some CVEs announced for open source Redis do not affect Redis Enterprise due to different or additional functionality available in Redis Enterprise that is not available in open source Redis. </p> <p> Redis Enterprise 7.2.4-109 supports open source Redis 7.2, 6.2, and 6.0. Below is the list of open source Redis CVEs fixed by version. </p> <p> Redis 7.2.x: </p> <ul> <li> <p> (CVE-2024-31449) An authenticated user may use a specially crafted Lua script to trigger a stack buffer overflow in the bit library, which may potentially lead to remote code execution. </p> </li> <li> <p> (CVE-2024-31228) An authenticated user can trigger a denial-of-service by using specially crafted, long string match patterns on supported commands such as <code> KEYS </code> , <code> SCAN </code> , <code> PSUBSCRIBE </code> , <code> FUNCTION LIST </code> , <code> COMMAND LIST </code> , and ACL definitions. Matching of extremely long patterns may result in unbounded recursion, leading to stack overflow and process crashes. </p> </li> <li> <p> (CVE-2023-41056) In some cases, Redis may incorrectly handle resizing of memory buffers, which can result in incorrect accounting of buffer sizes and lead to heap overflow and potential remote code execution. </p> </li> <li> <p> (CVE-2023-41053) Redis does not correctly identify keys accessed by <code> SORT_RO </code> and, as a result, may grant users executing this command access to keys that are not explicitly authorized by the ACL configuration. (Redis 7.2.1) </p> </li> </ul> <p> Redis 7.0.x: </p> <ul> <li> <p> (CVE-2024-31449) An authenticated user may use a specially crafted Lua script to trigger a stack buffer overflow in the bit library, which may potentially lead to remote code execution. </p> </li> <li> <p> (CVE-2024-31228) An authenticated user can trigger a denial-of-service by using specially crafted, long string match patterns on supported commands such as <code> KEYS </code> , <code> SCAN </code> , <code> PSUBSCRIBE </code> , <code> FUNCTION LIST </code> , <code> COMMAND LIST </code> , and ACL definitions. Matching of extremely long patterns may result in unbounded recursion, leading to stack overflow and process crashes. </p> </li> <li> <p> (CVE-2023-41056) In some cases, Redis may incorrectly handle resizing of memory buffers, which can result in incorrect accounting of buffer sizes and lead to heap overflow and potential remote code execution. </p> </li> <li> <p> (CVE-2023-41053) Redis does not correctly identify keys accessed by <code> SORT_RO </code> and, as a result, may grant users executing this command access to keys that are not explicitly authorized by the ACL configuration. (Redis 7.0.13) </p> </li> <li> <p> (CVE-2023-36824) Extracting key names from a command and a list of arguments may, in some cases, trigger a heap overflow and result in reading random heap memory, heap corruption, and potentially remote code execution. Specifically: using <code> COMMAND GETKEYS* </code> and validation of key names in ACL rules. (Redis 7.0.12) </p> </li> <li> <p> (CVE-2023-28856) Authenticated users can use the <code> HINCRBYFLOAT </code> command to create an invalid hash field that will crash Redis on access. (Redis 7.0.11) </p> </li> <li> <p> (CVE-2023-28425) Specially crafted <code> MSETNX </code> command can lead to assertion and denial-of-service. (Redis 7.0.10) </p> </li> <li> <p> (CVE-2023-25155) Specially crafted <code> SRANDMEMBER </code> , <code> ZRANDMEMBER </code> , and <code> HRANDFIELD </code> commands can trigger an integer overflow, resulting in a runtime assertion and termination of the Redis server process. (Redis 7.0.9) </p> </li> <li> <p> (CVE-2023-22458) Integer overflow in the Redis <code> HRANDFIELD </code> and <code> ZRANDMEMBER </code> commands can lead to denial-of-service. (Redis 7.0.8) </p> </li> <li> <p> (CVE-2022-36021) String matching commands (like <code> SCAN </code> or <code> KEYS </code> ) with a specially crafted pattern to trigger a denial-of-service attack on Redis, causing it to hang and consume 100% CPU time. (Redis 7.0.9) </p> </li> <li> <p> (CVE-2022-35977) Integer overflow in the Redis <code> SETRANGE </code> and <code> SORT </code> / <code> SORT_RO </code> commands can drive Redis to OOM panic. (Redis 7.0.8) </p> </li> <li> <p> (CVE-2022-35951) Executing an <code> XAUTOCLAIM </code> command on a stream key in a specific state, with a specially crafted <code> COUNT </code> argument, may cause an integer overflow, a subsequent heap overflow, and potentially lead to remote code execution. The problem affects Redis versions 7.0.0 or newer. (Redis 7.0.5) </p> </li> <li> <p> (CVE-2022-31144) A specially crafted <code> XAUTOCLAIM </code> command on a stream key in a specific state may result in heap overflow and potentially remote code execution. The problem affects Redis versions 7.0.0 or newer. (Redis 7.0.4) </p> </li> <li> <p> (CVE-2022-24834) A specially crafted Lua script executing in Redis can trigger a heap overflow in the cjson and cmsgpack libraries, and result in heap corruption and potentially remote code execution. The problem exists in all versions of Redis with Lua scripting support, starting from 2.6, and affects only authenticated and authorized users. (Redis 7.0.12) </p> </li> <li> <p> (CVE-2022-24736) An attacker attempting to load a specially crafted Lua script can cause NULL pointer dereference which will result in a crash of the <code> redis-server </code> process. This issue affects all versions of Redis. (Redis 7.0.0) </p> </li> <li> <p> (CVE-2022-24735) By exploiting weaknesses in the Lua script execution environment, an attacker with access to Redis can inject Lua code that will execute with the (potentially higher) privileges of another Redis user. (Redis 7.0.0) </p> </li> </ul> <p> Redis 6.2.x: </p> <ul> <li> <p> (CVE-2024-31449) An authenticated user may use a specially crafted Lua script to trigger a stack buffer overflow in the bit library, which may potentially lead to remote code execution. </p> </li> <li> <p> (CVE-2024-31228) An authenticated user can trigger a denial-of-service by using specially crafted, long string match patterns on supported commands such as <code> KEYS </code> , <code> SCAN </code> , <code> PSUBSCRIBE </code> , <code> FUNCTION LIST </code> , <code> COMMAND LIST </code> , and ACL definitions. Matching of extremely long patterns may result in unbounded recursion, leading to stack overflow and process crashes. </p> </li> <li> <p> (CVE-2023-45145) The wrong order of listen(2) and chmod(2) calls creates a race condition that can be used by another process to bypass desired Unix socket permissions on startup. (Redis 6.2.14) </p> </li> <li> <p> (CVE-2023-28856) Authenticated users can use the <code> HINCRBYFLOAT </code> command to create an invalid hash field that will crash Redis on access. (Redis 6.2.12) </p> </li> <li> <p> (CVE-2023-25155) Specially crafted <code> SRANDMEMBER </code> , <code> ZRANDMEMBER </code> , and <code> HRANDFIELD </code> commands can trigger an integer overflow, resulting in a runtime assertion and termination of the Redis server process. (Redis 6.2.11) </p> </li> <li> <p> (CVE-2023-22458) Integer overflow in the Redis <code> HRANDFIELD </code> and <code> ZRANDMEMBER </code> commands can lead to denial-of-service. (Redis 6.2.9) </p> </li> <li> <p> (CVE-2022-36021) String matching commands (like <code> SCAN </code> or <code> KEYS </code> ) with a specially crafted pattern to trigger a denial-of-service attack on Redis, causing it to hang and consume 100% CPU time. (Redis 6.2.11) </p> </li> <li> <p> (CVE-2022-35977) Integer overflow in the Redis <code> SETRANGE </code> and <code> SORT </code> / <code> SORT_RO </code> commands can drive Redis to OOM panic. (Redis 6.2.9) </p> </li> <li> <p> (CVE-2022-24834) A specially crafted Lua script executing in Redis can trigger a heap overflow in the cjson and cmsgpack libraries, and result in heap corruption and potentially remote code execution. The problem exists in all versions of Redis with Lua scripting support, starting from 2.6, and affects only authenticated and authorized users. (Redis 6.2.13) </p> </li> <li> <p> (CVE-2022-24736) An attacker attempting to load a specially crafted Lua script can cause NULL pointer dereference which will result in a crash of the <code> redis-server </code> process. This issue affects all versions of Redis. (Redis 6.2.7) </p> </li> <li> <p> (CVE-2022-24735) By exploiting weaknesses in the Lua script execution environment, an attacker with access to Redis can inject Lua code that will execute with the (potentially higher) privileges of another Redis user. (Redis 6.2.7) </p> </li> <li> <p> (CVE-2021-41099) Integer to heap buffer overflow handling certain string commands and network payloads, when <code> proto-max-bulk-len </code> is manually configured to a non-default, very large value. (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32762) Integer to heap buffer overflow issue in <code> redis-cli </code> and <code> redis-sentinel </code> parsing large multi-bulk replies on some older and less common platforms. (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32761) An integer overflow bug in Redis version 2.2 or newer can be exploited using the <code> BITFIELD </code> command to corrupt the heap and potentially result with remote code execution. (Redis 6.2.5) </p> </li> <li> <p> (CVE-2021-32687) Integer to heap buffer overflow with intsets, when <code> set-max-intset-entries </code> is manually configured to a non-default, very large value. (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32675) Denial Of Service when processing RESP request payloads with a large number of elements on many connections. (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32672) Random heap reading issue with Lua Debugger. (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32628) Integer to heap buffer overflow handling ziplist-encoded data types, when configuring a large, non-default value for <code> hash-max-ziplist-entries </code> , <code> hash-max-ziplist-value </code> , <code> zset-max-ziplist-entries </code> or <code> zset-max-ziplist-value </code> . (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32627) Integer to heap buffer overflow issue with streams, when configuring a non-default, large value for <code> proto-max-bulk-len </code> and <code> client-query-buffer-limit </code> . (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32626) Specially crafted Lua scripts may result with Heap buffer overflow. (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32625) An integer overflow bug in Redis version 6.0 or newer can be exploited using the STRALGO LCS command to corrupt the heap and potentially result with remote code execution. This is a result of an incomplete fix by CVE-2021-29477. (Redis 6.2.4) </p> </li> <li> <p> (CVE-2021-29478) An integer overflow bug in Redis 6.2 could be exploited to corrupt the heap and potentially result with remote code execution. The vulnerability involves changing the default set-max-intset-entries configuration value, creating a large set key that consists of integer values and using the COPY command to duplicate it. The integer overflow bug exists in all versions of Redis starting with 2.6, where it could result with a corrupted RDB or DUMP payload, but not exploited through COPY (which did not exist before 6.2). (Redis 6.2.3) </p> </li> <li> <p> (CVE-2021-29477) An integer overflow bug in Redis version 6.0 or newer could be exploited using the STRALGO LCS command to corrupt the heap and potentially result in remote code execution. The integer overflow bug exists in all versions of Redis starting with 6.0. (Redis 6.2.3) </p> </li> </ul> <p> Redis 6.0.x: </p> <ul> <li> <p> (CVE-2022-24834) A specially crafted Lua script executing in Redis can trigger a heap overflow in the cjson and cmsgpack libraries, and result in heap corruption and potentially remote code execution. The problem exists in all versions of Redis with Lua scripting support, starting from 2.6, and affects only authenticated and authorized users. (Redis 6.0.20) </p> </li> <li> <p> (CVE-2023-28856) Authenticated users can use the <code> HINCRBYFLOAT </code> command to create an invalid hash field that will crash Redis on access. (Redis 6.0.19) </p> </li> <li> <p> (CVE-2023-25155) Specially crafted <code> SRANDMEMBER </code> , <code> ZRANDMEMBER </code> , and <code> HRANDFIELD </code> commands can trigger an integer overflow, resulting in a runtime assertion and termination of the Redis server process. (Redis 6.0.18) </p> </li> <li> <p> (CVE-2022-36021) String matching commands (like <code> SCAN </code> or <code> KEYS </code> ) with a specially crafted pattern to trigger a denial-of-service attack on Redis, causing it to hang and consume 100% CPU time. (Redis 6.0.18) </p> </li> <li> <p> (CVE-2022-35977) Integer overflow in the Redis <code> SETRANGE </code> and <code> SORT </code> / <code> SORT_RO </code> commands can drive Redis to OOM panic. (Redis 6.0.17) </p> </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-109/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/references/compatibility/commands/.html
<section class="prose w-full py-12 max-w-none"> <h1> Compatibility with Redis Community Edition commands </h1> <p class="text-lg -mt-5 mb-10"> Redis Community Edition commands compatible with Redis Enterprise. </p> <p> Learn which Redis Community Edition commands are compatible with Redis Enterprise Software and <a href="/docs/latest/operate/rc/"> Redis Cloud </a> . </p> <p> Select a command group for more details about compatibility with standard and Active-Active Redis Enterprise. </p> <table> <thead> <tr> <th style="text-align:left"> Command group </th> <th style="text-align:left"> Description </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/compatibility/commands/cluster/"> Cluster management </a> </td> <td style="text-align:left"> Cluster management commands compatible with Redis Enterprise. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/compatibility/commands/connection/"> Connection management </a> </td> <td style="text-align:left"> Connection management commands compatibility. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/compatibility/commands/data-types/"> Data types </a> </td> <td style="text-align:left"> Data type commands compatibility (bitmaps, geospatial indices, hashes, HyperLogLogs, lists, sets, sorted sets, streams, strings). </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/compatibility/commands/generic/"> Keys (generic) </a> </td> <td style="text-align:left"> Generic key commands compatible with Redis Enterprise. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/compatibility/commands/pub-sub/"> Pub/sub </a> </td> <td style="text-align:left"> Pub/sub commands compatibility. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/compatibility/commands/scripting/"> Scripting </a> </td> <td style="text-align:left"> Scripting and function commands compatibility. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/compatibility/commands/server/"> Server management </a> </td> <td style="text-align:left"> Server management commands compatibility. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/compatibility/commands/transactions/"> Transactions </a> </td> <td style="text-align:left"> Transaction commands compatibility. </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/compatibility/commands/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rc/subscriptions/maintenance/set-maintenance-windows/.html
<section class="prose w-full py-12 max-w-none"> <h1> Set maintenance windows </h1> <p class="text-lg -mt-5 mb-10"> Shows how to set manual maintenance windows and skip maintenance. </p> <p> By default, Redis will maintain your Redis Cloud subscriptions and databases as needed. During maintenance, you may notice some latency when connecting to your databases. For more information about the types of maintenance and how Redis maintains your subscriptions, see <a href="/docs/latest/operate/rc/subscriptions/maintenance/"> Maintenance </a> . </p> <p> For Redis Cloud Pro plans, Redis will perform maintenance automatically while limiting service disruption as much as possible. If you want to control when Redis performs maintenance for a Redis Cloud Pro subscription, you can <a href="#set-manual-maintenance-windows"> set manual maintenance windows </a> to ensure non-urgent maintenance will occur at set times. Configuring or altering the maintenance window will not have any impact on your subscription or databases. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> You can only set manual maintenance windows for Redis Cloud Pro plans. A Redis Cloud Essentials database has a set maintenance window based on the region where it is located. See <a href="/docs/latest/operate/rc/subscriptions/maintenance/#redis-cloud-essentials"> Essentials maintenance </a> for more information. </div> </div> <h2 id="set-manual-maintenance-windows"> Set manual maintenance windows </h2> <p> To set manual maintenance windows for a single Redis Cloud Pro subscription: </p> <ol> <li> <p> From the <a href="https://cloud.redis.io/"> Redis Cloud console </a> , select the <strong> Subscriptions </strong> menu and then select your subscription from the list. </p> </li> <li> <p> Select the <strong> Overview </strong> tab. </p> </li> <li> <p> In the <strong> Maintenance Windows </strong> panel, select <strong> Manual </strong> . </p> </li> <li> <p> Click <strong> Activate </strong> to confirm your selection. </p> </li> <li> <p> Enter the maintenance window time frame details. </p> <a href="/docs/latest/images/rc/subscriptions-set-maintenance-window.png" sdata-lightbox="/images/rc/subscriptions-set-maintenance-window.png"> <img alt="The set maintenance windows panel" src="/docs/latest/images/rc/subscriptions-set-maintenance-window.png"/> </a> <ul> <li> Select the days that Redis can perform maintenance in the <strong> Days </strong> drop-down. </li> <li> Select the time that Redis can start performing maintenance on those days in the <strong> From </strong> drop-down. </li> <li> Select the amount of time that Redis can perform maintenance in the <strong> Duration </strong> drop-down. </li> <li> Select <strong> + Time Frame </strong> to add another time frame for maintenance. </li> </ul> <p> Redis recommends allowing maintenance on at least two different days for 8 hours on each day. </p> </li> <li> <p> Click <strong> Save </strong> . </p> </li> </ol> <h2 id="skip-maintenance-temporarily"> Skip maintenance temporarily </h2> <p> To skip maintenance temporarily for a subscription: </p> <ol> <li> <p> From the <a href="https://cloud.redis.io/"> Redis Cloud console </a> , select the <strong> Subscriptions </strong> menu and then select your subscription from the list. </p> </li> <li> <p> Select the <strong> Overview </strong> tab. </p> </li> <li> <p> In the <strong> Maintenance Windows </strong> panel, select <strong> Skip the next 7 days </strong> . </p> </li> <li> <p> Click <strong> Continue </strong> to confirm your selection. </p> </li> </ol> <p> You will only be allowed to skip maintenance twice in one month. </p> <p> During the skipped maintenance period, Redis will not perform any minor or major upgrades. Redis may perform <a href="/docs/latest/operate/rc/subscriptions/maintenance/#urgent-maintenance"> urgent maintenance </a> on your subscription, but only if it is absolutely necessary. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rc/subscriptions/maintenance/set-maintenance-windows/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/modules-lifecycle/.html
<section class="prose w-full py-12 max-w-none"> <h1> Module lifecycle </h1> <p> Redis Enterprise Software follows the <a href="/docs/latest/operate/rs/installing-upgrading/product-lifecycle/"> Redis Enterprise lifecycle </a> . (For complete details, see the Redis Enterprise Software <a href="https://redis.com/software-subscription-agreement"> subscription agreement </a> .) </p> <p> The modules included in Redis Stack also follow a release lifecycle and schedule. Here, you'll find the "end-of-life" dates for each module and release. </p> <h2 id="module-release-numbering"> Module release numbering </h2> <p> Redis modules use a three-place numbering scheme to identify released versions. </p> <p> The format is β€œMajor1.Major2.Minor”. </p> <ul> <li> <p> Major sections of the version number represent fundamental changes to functionality and feature capabilities. The <em> Major1 </em> and <em> Major2 </em> part of the version number are incremented according to the size and scale of the changes in each release. </p> </li> <li> <p> The <em> Minor </em> section of the version number represents quality improvements and fixes to existing capabilities. The minor release number is increased when release quality improves. </p> </li> </ul> <h2 id="modules-endoflife-schedule"> Module end-of-life schedule </h2> <p> End-of-Life for a given Major version is 18 months after the formal release of that version or 12 months after the release of the next subsequent (following) version, whichever comes last. </p> <h3 id="redisearch"> RediSearch </h3> <table> <thead> <tr> <th> Release Date </th> <th> End-of-Life (EOL) </th> </tr> </thead> <tbody> </tbody> <tbody> <tr> <td align="left"> 2.8 - July 2023 </td> <td align="left"> - </td> </tr> </tbody> <tbody> <tr> <td align="left"> 2.6 - November 2022 </td> <td align="left"> July 31, 2024 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 2.4 - March 2022 </td> <td align="left"> November 30, 2023 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 2.2 - November 2021 </td> <td align="left"> May 31, 2023 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 2.0 – September 2020 </td> <td align="left"> November 30, 2022 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 1.6 – January 2020 </td> <td align="left"> March 31, 2022 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 1.4 – August 2018 </td> <td align="left"> March 31, 2021 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 1.2 – June 2018 </td> <td align="left"> December 31, 2019 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 1.1 – April 2018 </td> <td align="left"> October 31, 2019 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 1.0 – November 2017 </td> <td align="left"> May 31, 2019 </td> </tr> </tbody> </table> <h3 id="redisjson"> RedisJSON </h3> <table> <thead> <tr> <th> Release Date </th> <th> End-of-Life (EOL) </th> </tr> </thead> <tbody> </tbody> <tbody> <tr> <td align="left"> 2.6 - July 2023 </td> <td align="left"> - </td> </tr> </tbody> <tbody> <tr> <td align="left"> 2.4 - November 2022 </td> <td align="left"> July 31, 2024 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 2.2 - July 2022 </td> <td align="left"> November 30, 2023 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 2.0 – November 2021 </td> <td align="left"> July 31, 2023 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 1.0 – November 2017 </td> <td align="left"> November 30, 2022 </td> </tr> </tbody> </table> <h3 id="redisgraph"> RedisGraph </h3> <table> <thead> <tr> <th> Release Date </th> <th> End-of-Life (EOL) </th> </tr> </thead> <tbody> </tbody> <tbody> <tr> <td align="left"> 2.10 - June 2023 </td> <td align="left"> January 31, 2025 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 2.8 – February 2022 </td> <td align="left"> January 31, 2025 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 2.4 – March 2021 </td> <td align="left"> February 28, 2023 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 2.2 – November 2020 </td> <td align="left"> May 31, 2022 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 2.0 – January 2020 </td> <td align="left"> November 30, 2021 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 1.2 – April 2019 </td> <td align="left"> December 31, 2020 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 1.0 – November 2018 </td> <td align="left"> May 31, 2020 </td> </tr> </tbody> </table> <h3 id="redistimeseries"> RedisTimeSeries </h3> <table> <thead> <tr> <th> Release Date </th> <th> End-of-Life (EOL) </th> </tr> </thead> <tbody> </tbody> <tbody> <tr> <td align="left"> 1.10 - July 2023 </td> <td align="left"> - </td> </tr> </tbody> <tbody> <tr> <td align="left"> 1.8 - November 2022 </td> <td align="left"> July 31, 2024 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 1.6 - January 2022 </td> <td align="left"> November 30, 2023 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 1.4 – September 2020 </td> <td align="left"> January 31, 2023 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 1.2 – January 2020 </td> <td align="left"> September 30, 2021 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 1.0 – June 2019 </td> <td align="left"> December 31, 2020 </td> </tr> </tbody> </table> <h3 id="redisbloom"> RedisBloom </h3> <table> <thead> <tr> <th> Release Date </th> <th> End-of-Life (EOL) </th> </tr> </thead> <tbody> </tbody> <tbody> <tr> <td align="left"> 2.6 - July 2023 </td> <td align="left"> - </td> </tr> </tbody> <tbody> <tr> <td align="left"> 2.4 - November 2022 </td> <td align="left"> July 31, 2024 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 2.2 – December 2019 </td> <td align="left"> November 30, 2023 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 2.0 – June 2019 </td> <td align="left"> December 31, 2020 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 1.1 – February 2019 </td> <td align="left"> August 31, 2020 </td> </tr> </tbody> <tbody> <tr> <td align="left"> 1.0 – September 2017 </td> <td align="left"> March 31, 2019 </td> </tr> </tbody> </table> <h3 id="redisgears"> RedisGears </h3> <table> <thead> <tr> <th> Release Date </th> <th> End-of-Life (EOL) </th> </tr> </thead> <tbody> </tbody> <tbody> <tr> <td align="left"> 1.2 – February 2022 </td> <td align="left"> - </td> </tr> </tbody> <tbody> <tr> <td align="left"> 1.0 – May 2020 </td> <td align="left"> February 28, 2023 </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/modules-lifecycle/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/readers/shardsidreader/.html
<section class="prose w-full py-12 max-w-none"> <h1> ShardsIDReader </h1> <p class="text-lg -mt-5 mb-10"> Gets the shard ID for each shard in a database. </p> <p> The <code> ShardsIDReader </code> creates a single record on each shard that represents the current shard's ID. </p> <p> Use this reader when you want to run an operation on each shard in the database. </p> <h2 id="parameters"> Parameters </h2> <p> None </p> <h2 id="output-records"> Output records </h2> <p> Creates a record for each shard with the shard's cluster identifier. </p> <h2 id="example"> Example </h2> <div class="highlight"> <pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="n">ShardsIDReader</span> <span class="n">reader</span> <span class="o">=</span> <span class="k">new</span> <span class="n">ShardsIDReader</span><span class="o">();</span> </span></span></code></pre> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/readers/shardsidreader/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/clusters/configure/sync-clocks/.html
<section class="prose w-full py-12 max-w-none"> <h1> Synchronize cluster node clocks </h1> <p class="text-lg -mt-5 mb-10"> Sync node clocks to avoid problems with internal custer communication. </p> <p> To avoid problems with internal cluster communications that can impact your data integrity, make sure that the clocks on all of the cluster nodesΒ are synchronized using Chrony and/or NTP. </p> <p> When you install Redis Enterprise Software, the install script checks if Chrony or NTP is running. If they are not, the installation process asks for permission to configure a scheduled Cron job. This should make sure that the node's clock is always synchronized. If you did not confirm configuring this job during the installation process, you must use the Network Time Protocol (NTP) regularly to make sure that all server clocks are synchronized. </p> <p> To synchronize the server clock, run the command that is appropriate for your operating system. </p> <h2 id="set-up-ntp-synchronization"> Set up NTP synchronization </h2> <p> To set up NTP synchronization, see the following sections for instructions for specific operating systems. </p> <h3 id="ubuntu-1804-and-ubuntu-2004"> Ubuntu 18.04 and Ubuntu 20.04 </h3> <ol> <li> <p> Install Chrony, a replacement for NTP: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo apt install chrony </span></span></code></pre> </div> </li> <li> <p> Edit the Chrony configuration file: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo nano /etc/chrony/chrony.conf </span></span></code></pre> </div> </li> <li> <p> Add <code> server pool.ntp.org </code> to the file, replace <code> pool.ntp.org </code> with your own NTP server, then save. </p> </li> <li> <p> Restart the Chrony service: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo systemctl restart chrony </span></span></code></pre> </div> </li> <li> <p> Check the Chrony service status: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo systemctl status chrony </span></span></code></pre> </div> </li> </ol> <p> For more details, refer to the official <a href="https://ubuntu.com/server/docs/network-ntp"> Ubuntu 20.04 documentation </a> . </p> <h3 id="rhel-7"> RHEL 7 </h3> <ol> <li> <p> Install Chrony, a replacement for NTP: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"> sudo yum install chrony </span></span></code></pre> </div> </li> <li> <p> Edit the Chrony configuration file: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo nano /etc/chrony.conf </span></span></code></pre> </div> </li> <li> <p> Add <code> server pool.ntp.org </code> to the file, replace <code> pool.ntp.org </code> with your own NTP server, then save. </p> </li> <li> <p> Enable and start the Chrony service: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo systemctl <span class="nb">enable</span> chronyd <span class="o">&amp;&amp;</span> sudo systemctl start chronyd </span></span></code></pre> </div> </li> <li> <p> Check the Chrony service status: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo systemctl status chronyd </span></span></code></pre> </div> </li> </ol> <p> For more details, refer to the official <a href="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/ch-configuring_ntp_using_the_chrony_suite#sect-Using_chrony"> RHEL 7 documentation </a> . </p> <h3 id="rhel-8-and-rhel-9"> RHEL 8 and RHEL 9 </h3> <ol> <li> <p> Install Chrony, a replacement for NTP: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo dnf install chrony </span></span></code></pre> </div> </li> <li> <p> Edit the Chrony configuration file: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo nano /etc/chrony.conf </span></span></code></pre> </div> </li> <li> <p> Add <code> server pool.ntp.org </code> to the file, replace <code> pool.ntp.org </code> with your own NTP server, then save. </p> </li> <li> <p> Enable and start the Chrony service: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo systemctl <span class="nb">enable</span> chronyd <span class="o">&amp;&amp;</span> sudo systemctl start chronyd </span></span></code></pre> </div> </li> <li> <p> Check the Chrony service status: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo systemctl status chronyd </span></span></code></pre> </div> </li> </ol> <p> For more details, refer to the official <a href="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/configuring-time-synchronization_configuring-basic-system-settings"> RHEL 8 and 9 documentation </a> . </p> <h3 id="amazon-linux-2"> Amazon Linux 2 </h3> <ol> <li> <p> Install Chrony, a replacement for NTP: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo yum install chrony </span></span></code></pre> </div> </li> <li> <p> Edit the Chrony configuration file: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"> sudo nano /etc/chrony.conf </span></span></code></pre> </div> </li> <li> <p> Add <code> server pool.ntp.org </code> to the file, replace <code> pool.ntp.org </code> with your own NTP server, then save. </p> </li> <li> <p> Enable and start the Chrony service: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo systemctl <span class="nb">enable</span> chronyd <span class="o">&amp;&amp;</span> sudo systemctl start chronyd </span></span></code></pre> </div> </li> <li> <p> Check the Chrony service status: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo systemctl status chronyd </span></span></code></pre> </div> </li> </ol> <p> For more details, refer to the official <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-time.html"> Amazon Linux 2 documentation </a> . </p> <p> If you are using Active-Active databases, you must use <a href="/docs/latest/operate/rs/7.4/databases/active-active/#network-time-service-ntp-or-chrony"> Network Time Service (ntpd) </a> to synchronize OS clocks consistently across clusters to handle conflict resolution according to the OS time. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/clusters/configure/sync-clocks/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/integrate/redis-data-integration/reference/data-transformation/remove_field/.html
<section class="prose w-full py-12 max-w-none"> <h1> remove_field </h1> <p class="text-lg -mt-5 mb-10"> Remove fields </p> <p> Remove fields </p> <p> <strong> Option 1 (alternative): </strong> Remove multiple fields </p> <p> <strong> Properties </strong> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#option1fields"> <strong> fields </strong> </a> </td> <td> <code> object[] </code> </td> <td> Fields <br/> </td> <td> yes </td> </tr> </tbody> </table> <p> <strong> Additional Properties: </strong> not allowed </p> <p> <strong> Example </strong> </p> <div class="highlight"> <pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">source</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">server_name</span><span class="p">:</span><span class="w"> </span><span class="l">redislabs</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">schema</span><span class="p">:</span><span class="w"> </span><span class="l">dbo</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">table</span><span class="p">:</span><span class="w"> </span><span class="l">emp</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">transform</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="nt">uses</span><span class="p">:</span><span class="w"> </span><span class="l">remove_field</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">with</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">fields</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="nt">field</span><span class="p">:</span><span class="w"> </span><span class="l">credit_card</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="nt">field</span><span class="p">:</span><span class="w"> </span><span class="l">name.mname</span><span class="w"> </span></span></span></code></pre> </div> <p> <strong> Option 2 (alternative): </strong> Remove one field </p> <p> <strong> Properties </strong> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <strong> field </strong> </td> <td> <code> string </code> </td> <td> Field <br/> </td> <td> yes </td> </tr> </tbody> </table> <p> <strong> Additional Properties: </strong> not allowed <br/> <strong> Example </strong> </p> <div class="highlight"> <pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">source</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">server_name</span><span class="p">:</span><span class="w"> </span><span class="l">redislabs</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">schema</span><span class="p">:</span><span class="w"> </span><span class="l">dbo</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">table</span><span class="p">:</span><span class="w"> </span><span class="l">emp</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">transform</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="nt">uses</span><span class="p">:</span><span class="w"> </span><span class="l">remove_field</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">with</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">field</span><span class="p">:</span><span class="w"> </span><span class="l">credit_card</span><span class="w"> </span></span></span></code></pre> </div> <p> <a name="option1fields"> </a> </p> <h2 id="option-1-fields-array"> Option 1: fields[]: array </h2> <p> Fields </p> <p> <strong> Items </strong> </p> <p> <strong> Item Properties </strong> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <strong> field </strong> </td> <td> <code> string </code> </td> <td> Field <br/> </td> <td> yes </td> </tr> </tbody> </table> <p> <strong> Item Additional Properties: </strong> not allowed </p> <p> <strong> Example </strong> </p> <div class="highlight"> <pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl">- {}<span class="w"> </span></span></span></code></pre> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/integrate/redis-data-integration/reference/data-transformation/remove_field/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisbloom/redisbloom-1.1-release-notes/.html
<section class="prose w-full py-12 max-w-none"> <h1> RedisBloom 1.1 release notes </h1> <p class="text-lg -mt-5 mb-10"> Updated version. </p> <h2 id="requirements"> Requirements </h2> <p> RedisBloom v1.1.1 requires: </p> <ul> <li> Minimum Redis compatibility version (database): 4.0.0 </li> <li> Minimum Redis Enterprise Software version (cluster): 5.0.0 </li> </ul> <h2 id="redisbloom-111-21-february-2019"> RedisBloom 1.1.1 (21 February 2019) </h2> <p> Update version to 1.1.1 </p> <h2 id="redisbloom-110-12-february-2019"> RedisBloom 1.1.0 (12 February 2019) </h2> <p> Release of 1.1.0 </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisbloom/redisbloom-1.1-release-notes/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/decr/.html
<section class="prose w-full py-12"> <h1 class="command-name"> DECR </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">DECR key</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 1.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @write </code> <span class="mr-1 last:hidden"> , </span> <code> @string </code> <span class="mr-1 last:hidden"> , </span> <code> @fast </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Decrements the number stored at <code> key </code> by one. If the key does not exist, it is set to <code> 0 </code> before performing the operation. An error is returned if the key contains a value of the wrong type or contains a string that can not be represented as integer. This operation is limited to <strong> 64 bit signed integers </strong> . </p> <p> See <a href="/docs/latest/commands/incr/"> <code> INCR </code> </a> for extra information on increment/decrement operations. </p> <h2 id="examples"> Examples </h2> <div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex"> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z"> </path> </svg> </div> <form class="redis-cli overflow-y-auto max-h-80"> <pre tabindex="0">redis&gt; SET mykey "10" "OK" redis&gt; DECR mykey (integer) 9 redis&gt; SET mykey "234293482390480948029348230948" "OK" redis&gt; DECR mykey (error) value is not an integer or out of range </pre> <div class="prompt" style=""> <span> redis&gt; </span> <input autocomplete="off" name="prompt" spellcheck="false" type="text"/> </div> </form> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : the value of the key after decrementing it. <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/decr/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/groupcf.html
<section class="prose w-full py-12"> <h1> Commands </h1> </section>
https://redis.io/docs/latest/operate/rc/databases/view-edit-database/.html
<section class="prose w-full py-12 max-w-none"> <h1> View and edit databases </h1> <p> Use the <strong> Databases </strong> menu of the Redis Cloud console to manage your databases. </p> <p> To view the details of a database: </p> <ol> <li> <p> Sign in to the <a href="https://cloud.redis.io/"> Redis Cloud console </a> . (Create an account if you don't already have one.) </p> </li> <li> <p> Select the <strong> Databases </strong> menu to display a searchable list of all databases. </p> </li> <li> <p> Locate the database in the list. </p> </li> <li> <p> Select the database name to open the <strong> Database </strong> page. </p> <a href="/docs/latest/images/rc/database-details-configuration-tab-general-flexible.png" sdata-lightbox="/images/rc/database-details-configuration-tab-general-flexible.png"> <img alt="The Configuration tab of the Database details screen." src="/docs/latest/images/rc/database-details-configuration-tab-general-flexible.png"/> </a> </li> </ol> <p> The <strong> Database </strong> screen lets you review: </p> <ul> <li> Configuration details of a database </li> <li> Graphs showing performance metrics </li> <li> Recent activity via a "[slowlog](/docs/latest/commands/slowlog/," which lists queries that exceed a certain execution time. </li> </ul> <p> For help changing database settings, see <a href="#edit-database-details"> Edit database details </a> . </p> <h2 id="configuration-tab"> Configuration tab </h2> <p> The <strong> Configuration </strong> screen is divided into sections, each dedicated to a specific category. Note that not every section or setting is available to every <a href="/docs/latest/operate/rc/subscriptions/"> subscription plan </a> . </p> <h3 id="general-settings"> General settings </h3> <p> The <strong> General </strong> section defines basic properties about your database. </p> <p> The available settings vary according to your plan, cloud provider, and design choices. For example, if you do not select an Advanced Capability when creating a database, the <strong> Advanced Capabilities </strong> setting is not displayed when you view its configuration details. </p> <table> <thead> <tr> <th style="text-align:left"> Setting name </th> <th style="text-align:left"> Description </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <strong> Database Name </strong> </td> <td style="text-align:left"> The name given to your database </td> </tr> <tr> <td style="text-align:left"> <strong> Public endpoint </strong> </td> <td style="text-align:left"> Public URI used by any application or client to access the database. </td> </tr> <tr> <td style="text-align:left"> <strong> Private endpoint </strong> </td> <td style="text-align:left"> Private endpoint URI available to approved clients; use CIDR allow list and VPC peering to enable access ( <em> Redis Cloud Pro only </em> ) </td> </tr> <tr> <td style="text-align:left"> <strong> Tags </strong> </td> <td style="text-align:left"> A list of the <a href="/docs/latest/operate/rc/databases/tag-database/"> tags </a> associated with the database. Select <a href="/docs/latest/operate/rc/databases/tag-database/#configuration-tab"> Manage tags </a> to manage the database tags. </td> </tr> <tr> <td style="text-align:left"> <strong> Type </strong> </td> <td style="text-align:left"> Displays 'Redis', 'Redis Stack' or 'memcached' based on the value selected when the database was created </td> </tr> <tr> <td style="text-align:left"> <strong> Redis version </strong> </td> <td style="text-align:left"> Redis version used to create the database </td> </tr> <tr> <td style="text-align:left"> <strong> Auto Tiering </strong> </td> <td style="text-align:left"> Checked when the subscription supports Auto Tiering ( <em> Redis Cloud Pro only </em> ) </td> </tr> <tr> <td style="text-align:left"> <strong> Creation time </strong> </td> <td style="text-align:left"> Date and time the database was created </td> </tr> <tr> <td style="text-align:left"> <strong> Active-Active Redis </strong> </td> <td style="text-align:left"> Checked when the database is part of an <a href="/docs/latest/operate/rc/databases/configuration/active-active-redis/"> Active-Active </a> relationship ( <em> Redis Cloud Pro only </em> ) </td> </tr> <tr> <td style="text-align:left"> <strong> Last changed </strong> </td> <td style="text-align:left"> Date and time of last update </td> </tr> <tr> <td style="text-align:left"> <strong> Supported Protocol(s) </strong> </td> <td style="text-align:left"> Shows which version of RESP the database uses. See <a href="/docs/latest/develop/reference/protocol-spec/#resp-versions"> Redis serialization protocol </a> for details </td> </tr> <tr> <td style="text-align:left"> <strong> Advanced Capabilites </strong> </td> <td style="text-align:left"> This setting appears when an <a href="/docs/latest/operate/rc/databases/configuration/advanced-capabilities/"> advanced capability </a> is enabled for a database </td> </tr> </tbody> </table> <h3 id="scalability-section"> Scalability section </h3> <p> The <strong> Scalability </strong> section describes the memory size, throughput, and hashing policy for a database. </p> <a href="/docs/latest/images/rc/database-details-configuration-tab-scalability-flexible.png" sdata-lightbox="/images/rc/database-details-configuration-tab-scalability-flexible.png"> <img alt="Use the Scalability section to control the size, throughput, and hashing policy for a database." src="/docs/latest/images/rc/database-details-configuration-tab-scalability-flexible.png"/> </a> <p> The <strong> Scalability </strong> section is primarily for Redis Cloud Pro plans. Redis Cloud Essentials plans have options for memory limit and memory used. </p> <table> <thead> <tr> <th style="text-align:left"> Setting name </th> <th style="text-align:left"> Description </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <strong> Dataset size </strong> </td> <td style="text-align:left"> Maximum size (in GB) for your dataset. </td> </tr> <tr> <td style="text-align:left"> <strong> Memory used </strong> </td> <td style="text-align:left"> Memory currently used for your database. </td> </tr> <tr> <td style="text-align:left"> <strong> Throughput </strong> </td> <td style="text-align:left"> Defines throughput in terms of maximum operations per second for the database </td> </tr> <tr> <td style="text-align:left"> <strong> High availability </strong> </td> <td style="text-align:left"> Replicates your data across multiple nodes; <a href="/docs/latest/operate/rc/databases/configuration/high-availability/"> available options </a> depend on your plan type </td> </tr> <tr> <td style="text-align:left"> <strong> Hashing policy </strong> </td> <td style="text-align:left"> Defines the <a href="/docs/latest/operate/rc/databases/configuration/clustering/#manage-the-hashing-policy"> hashing policy </a> . </td> </tr> <tr> <td style="text-align:left"> <strong> OSS Cluster API </strong> </td> <td style="text-align:left"> Enables the <a href="/docs/latest/operate/rc/databases/create-database/#oss-cluster-api"> Cluster API </a> for a database. <br/> <br/> When this option is enabled, you cannot define a custom hashing policy. </td> </tr> </tbody> </table> <p> To learn more about these settings and when to use them, see <a href="/docs/latest/operate/rc/databases/configuration/clustering/"> Database clustering </a> . </p> <h3 id="durability-section"> Durability section </h3> <p> The Durability section helps protect your data when problems occur. These settings define replication, persistence, backup, and eviction policies. </p> <a href="/docs/latest/images/rc/database-details-configuration-tab-durability-flexible.png" sdata-lightbox="/images/rc/database-details-configuration-tab-durability-flexible.png"> <img alt="Use the Durability section to protect your data from unexpected problems." src="/docs/latest/images/rc/database-details-configuration-tab-durability-flexible.png"/> </a> <table> <thead> <tr> <th style="text-align:left"> Setting name </th> <th style="text-align:left"> Description </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <strong> Data persistence </strong> </td> <td style="text-align:left"> Defines whether (and how) data is saved to disk; <a href="/docs/latest/operate/rc/databases/configuration/data-persistence/"> available options </a> depend on your plan type </td> </tr> <tr> <td style="text-align:left"> <strong> Data eviction policy </strong> </td> <td style="text-align:left"> Configures which <a href="/docs/latest/operate/rc/databases/configuration/data-eviction-policies/"> policy </a> is applied when your database reaches its memory limit </td> </tr> <tr> <td style="text-align:left"> <strong> Remote backup </strong> </td> <td style="text-align:left"> When enabled, identifies a location and interval for <a href="/docs/latest/operate/rc/databases/back-up-data/"> data backups </a> . ( <em> Paid plans only </em> ) </td> </tr> <tr> <td style="text-align:left"> <strong> Active-Passive Redis </strong> </td> <td style="text-align:left"> When enabled, identifies a path to the <a href="/docs/latest/operate/rc/databases/migrate-databases/#sync-using-active-passive"> linked database </a> . ( <em> Redis Cloud Pro only </em> ) </td> </tr> </tbody> </table> <h3 id="security-section"> Security section </h3> <p> The <strong> Security </strong> section helps you control access to your database. </p> <a href="/docs/latest/images/rc/database-details-configuration-tab-security-flexible.png" sdata-lightbox="/images/rc/database-details-configuration-tab-security-flexible.png"> <img alt="Use the Security settings to control access to your database." src="/docs/latest/images/rc/database-details-configuration-tab-security-flexible.png"/> </a> <table> <thead> <tr> <th style="text-align:left"> Setting name </th> <th style="text-align:left"> Description </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <strong> Default user </strong> </td> <td style="text-align:left"> When enabled, permits access using a simple password </td> </tr> <tr> <td style="text-align:left"> <strong> Default user password </strong> </td> <td style="text-align:left"> Password for default user. A default password is assigned to the database on creation and may be updated. </td> </tr> <tr> <td style="text-align:left"> <strong> CIDR allow list </strong> </td> <td style="text-align:left"> <a href="/docs/latest/operate/rc/security/cidr-whitelist/"> Allow list </a> of IP addresses/security groups permitted to access the database. ( <em> Paid plans only </em> ) </td> </tr> <tr> <td style="text-align:left"> <strong> Transport layer security (TLS) </strong> </td> <td style="text-align:left"> Enables <a href="/docs/latest/operate/rc/security/database-security/tls-ssl/"> transport layer security </a> (TLS) encryption for database access. ( <em> Pro plans only </em> ) </td> </tr> </tbody> </table> <h3 id="alerts-section"> Alerts section </h3> <p> The <strong> Alerts </strong> section defines notification emails sent to your account and the conditions that trigger them. </p> <a href="/docs/latest/images/rc/database-details-configuration-tab-alerts-flexible.png" sdata-lightbox="/images/rc/database-details-configuration-tab-alerts-flexible.png"> <img alt="The Alerts section defines the notification emails and their triggering conditions." src="/docs/latest/images/rc/database-details-configuration-tab-alerts-flexible.png"/> </a> <p> The available alerts vary according to the plan type. </p> <table> <thead> <tr> <th style="text-align:left"> Setting name </th> <th style="text-align:left"> Description </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <strong> Dataset size has reached </strong> </td> <td style="text-align:left"> When enabled, sends an an email when the database reaches the defined memory limit ( <em> Free Essentials or Pro only </em> ) </td> </tr> <tr> <td style="text-align:left"> <strong> Total size of datasets under this plan reached </strong> </td> <td style="text-align:left"> When enabled, sends an an email when the database reaches the defined memory limit ( <em> Paid Essentials plans only </em> ) </td> </tr> <tr> <td style="text-align:left"> <strong> Throughput is higher than </strong> </td> <td style="text-align:left"> When enabled, sends an email when the operations per second exceed the defined threshold ( <em> Paid Essentials or Pro plans only </em> ) </td> </tr> <tr> <td style="text-align:left"> <strong> Throughput is lower than </strong> </td> <td style="text-align:left"> When enabled, sends an email when the operations per second falls below the defined threshold ( <em> Paid Essentials or Pro plans only </em> ) </td> </tr> <tr> <td style="text-align:left"> <strong> Latency is higher than </strong> </td> <td style="text-align:left"> When enabled, sends an an email when the latency exceeds the defined limit ( <em> Paid Essentials plans only </em> ) </td> </tr> <tr> <td style="text-align:left"> <strong> Number of connections </strong> </td> <td style="text-align:left"> When enabled, sends an email when the connections exceeds the defined limit. ( <em> Essentials plans only </em> ) </td> </tr> <tr> <td style="text-align:left"> <strong> Replica Of - database unable to sync with source </strong> </td> <td style="text-align:left"> When enabled, sends email when the replica database cannot sync with the primary (source) database ( <em> Pro plans only </em> ) </td> </tr> <tr> <td style="text-align:left"> <strong> Replica Of - sync lag is higher than </strong> </td> <td style="text-align:left"> When enabled, sends email when the sync lag exceeds the defined threshold ( <em> Pro plans only </em> ) </td> </tr> </tbody> </table> <h3 id="danger-zone"> Danger zone </h3> <p> Actions in the <strong> Danger Zone </strong> are permanent and should not be taken lightly. </p> <a href="/docs/latest/images/rc/database-details-configuration-tab-danger-flexible.png" sdata-lightbox="/images/rc/database-details-configuration-tab-danger-flexible.png"> <img alt="The Danger Zone includes activities that impact data, such as deleting a database. Use with care." src="/docs/latest/images/rc/database-details-configuration-tab-danger-flexible.png"/> </a> <p> Here, you can: </p> <ul> <li> <p> Delete the database. </p> <p> Databases must be active and empty before they can be deleted. To learn more, see <a href="/docs/latest/operate/rc/databases/delete-database/"> Delete a database </a> . </p> </li> <li> <p> Import data into the database. </p> <p> When you choose this action, you're asked to specify the source and location of the data to import </p> <a href="/docs/latest/images/rc/database-import-dialog.png" sdata-lightbox="/images/rc/database-import-dialog.png"> <img alt="The Import data dialog helps you import data into a database." src="/docs/latest/images/rc/database-import-dialog.png"/> </a> <p> To learn more, see <a href="/docs/latest/operate/rc/databases/import-data/"> Import data </a> . </p> </li> </ul> <p> For best results, we recommend backing up data before starting any <strong> Danger Zone </strong> actions. </p> <h2 id="manage-the-database-list"> Manage the database list </h2> <p> The <strong> Databases </strong> list summarizes the status of all databases associated with your account. </p> <p> You can: </p> <ul> <li> <p> Search by typing into the search box located above the database list. </p> <a href="/docs/latest/images/rc/database-list-search.png" sdata-lightbox="/images/rc/database-list-search.png"> <img alt="Use the search bar to filter the list." src="/docs/latest/images/rc/database-list-search.png"/> </a> </li> <li> <p> Filter by selecting a filter type and then selecting the checkbox next to the options you want to include from the dropdown. Select the Filter toggle, located on the right of the search bar, if the filter types are hidden. </p> <a href="/docs/latest/images/rc/database-list-filter.png" sdata-lightbox="/images/rc/database-list-filter.png"> <img alt="Use the filter toggle to display filter options." src="/docs/latest/images/rc/database-list-filter.png"/> </a> <p> You can filter the list on <strong> Status </strong> , <strong> Subscription </strong> , <strong> Capabilities </strong> , <strong> Options </strong> , and <strong> Tags </strong> . String matches are <em> not </em> case-sensitive. You can specify more than one filter expression at a time. </p> <p> A list of selected filters appears below the filter types. </p> <p> To remove a filter click the <strong> x </strong> to the right of the name of that filter. To remove all filters, select <strong> Clear all </strong> . </p> <a href="/docs/latest/images/rc/database-list-filter-selected.png" sdata-lightbox="/images/rc/database-list-filter-selected.png"> <img alt="Use the filter toggle to display filter options." src="/docs/latest/images/rc/database-list-filter-selected.png"/> </a> </li> <li> <p> Sort the list in descending or ascending order using the arrow displayed to right of the field name in the header. Supported fields include <strong> Subscription </strong> , <strong> Database name </strong> , <strong> Memory </strong> , and <strong> Tags </strong> . </p> <p> <a href="/docs/latest/images/rc/icon-database-list-sort-ascending.png" sdata-lightbox="/images/rc/icon-database-list-sort-ascending.png"> <img alt="Use the arrows in the list header to sort the list." src="/docs/latest/images/rc/icon-database-list-sort-ascending.png"/> </a> <a href="/docs/latest/images/rc/icon-database-list-sort-descending.png" sdata-lightbox="/images/rc/icon-database-list-sort-descending.png"> <img alt="The direction of the arrow corresponds to the direction of the sort." src="/docs/latest/images/rc/icon-database-list-sort-descending.png"/> </a> </p> <p> Select the arrow icon to change the sort order. One sort order can be active at any given time. </p> </li> <li> <p> Use the controls in the list footer to change the number of items displayed in the list or to navigate. </p> </li> </ul> <p> Sort orders and filter expressions are not saved between console sessions. </p> <h2 id="other-actions-and-info"> Other actions and info </h2> <p> The <strong> View Database </strong> screen also has tabs that let you view: </p> <ul> <li> <p> <strong> Metrics </strong> : a series of graphs showing database performance over time. See <a href="/docs/latest/operate/rc/databases/monitor-performance/"> Monitor performance </a> </p> </li> <li> <p> <strong> Slowlog </strong> : a log showing recent <a href="/docs/latest/commands/slowlog/"> slow queries </a> run against your database. The log displays when the action started, the duration, the complexity of the operation, and any parameters passed to the operation. </p> </li> </ul> <h2 id="edit-database-details"> Edit database details </h2> <p> Use the <strong> Edit database </strong> button to edit database details. </p> <a href="/docs/latest/images/rc/button-database-edit.png" sdata-lightbox="/images/rc/button-database-edit.png"> <img alt="The Edit database button lets you change selected database properties." src="/docs/latest/images/rc/button-database-edit.png"/> </a> <p> Because databases exist within the context of a deployment, certain fields cannot be updated, especially those that might lead to data loss. </p> <p> Here's what you can change: </p> <table> <thead> <tr> <th style="text-align:left"> Section </th> <th style="text-align:left"> Setting </th> <th style="text-align:left"> Comments </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> General </td> <td style="text-align:left"> Database name </td> <td> </td> </tr> <tr> <td style="text-align:left"> </td> <td style="text-align:left"> Supported protocol(s) </td> <td> </td> </tr> <tr> <td style="text-align:left"> </td> <td style="text-align:left"> Tags </td> <td> </td> </tr> <tr> <td style="text-align:left"> Scalability </td> <td style="text-align:left"> Memory limit </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> </td> <td style="text-align:left"> Throughput </td> <td style="text-align:left"> <em> Pro plans only </em> </td> </tr> <tr> <td style="text-align:left"> </td> <td style="text-align:left"> Hashing policy </td> <td style="text-align:left"> <em> Pro plans only </em> </td> </tr> <tr> <td style="text-align:left"> </td> <td style="text-align:left"> OSS Cluster API </td> <td style="text-align:left"> <em> Pro plans only </em> </td> </tr> <tr> <td style="text-align:left"> Durability </td> <td style="text-align:left"> High-availability </td> <td style="text-align:left"> <em> Paid plans only </em> </td> </tr> <tr> <td style="text-align:left"> </td> <td style="text-align:left"> Data persistence </td> <td style="text-align:left"> <em> Paid plans only </em> </td> </tr> <tr> <td style="text-align:left"> </td> <td style="text-align:left"> Data eviction policy </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> </td> <td style="text-align:left"> Remote backup </td> <td style="text-align:left"> <em> Paid plans only </em> </td> </tr> <tr> <td style="text-align:left"> </td> <td style="text-align:left"> Active-Passive Redis </td> <td style="text-align:left"> <em> Pro plans only </em> </td> </tr> <tr> <td style="text-align:left"> Security </td> <td style="text-align:left"> Default user </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> </td> <td style="text-align:left"> Default user password </td> <td> </td> </tr> <tr> <td style="text-align:left"> </td> <td style="text-align:left"> CIDR allow list </td> <td style="text-align:left"> <em> Paid plans only </em> </td> </tr> <tr> <td style="text-align:left"> </td> <td style="text-align:left"> Transport layer security (TLS) </td> <td style="text-align:left"> <em> Pro plans only </em> </td> </tr> <tr> <td style="text-align:left"> Alerts </td> <td style="text-align:left"> all available for plan type </td> <td> </td> </tr> </tbody> </table> <p> Choose <strong> Save database </strong> to save your changes. </p> <a href="/docs/latest/images/rc/button-database-save.png" sdata-lightbox="/images/rc/button-database-save.png"> <img alt="Use the Save database button to save database changes." src="/docs/latest/images/rc/button-database-save.png"/> </a> <p> If you need to change other details, create a new database and then migrate existing data. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rc/databases/view-edit-database/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/security/access-control/create-cluster-roles/.html
<section class="prose w-full py-12 max-w-none"> <h1> Create roles with cluster access only </h1> <p class="text-lg -mt-5 mb-10"> Create roles with cluster access only. </p> <p> Roles with cluster access allow access to the Cluster Management UI and REST API. </p> <h2 id="default-management-roles"> Default management roles </h2> <p> Redis Enterprise Software includes five predefined roles that determine a user's level of access to the Cluster Manager UI and <a href="/docs/latest/operate/rs/7.4/references/rest-api/"> REST API </a> . </p> <ol> <li> <strong> DB Viewer </strong> - Read database settings </li> <li> <strong> DB Member </strong> - Administer databases </li> <li> <strong> Cluster Viewer </strong> - Read cluster settings </li> <li> <strong> Cluster Member </strong> - Administer the cluster </li> <li> <strong> Admin </strong> - Full cluster access </li> <li> <strong> None </strong> - For data access only - cannot access the Cluster Manager UI or use the REST API </li> </ol> <p> For more details about the privileges granted by each of these roles, see <a href="#cluster-manager-ui-permissions"> Cluster Manager UI permissions </a> or <a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/"> REST API permissions </a> . </p> <h2 id="cluster-manager-ui-permissions"> Cluster Manager UI permissions </h2> <p> Here's a summary of the Cluster Manager UI actions permitted by each default management role: </p> <table> <thead> <tr> <th> Action </th> <th style="text-align:center"> DB Viewer </th> <th style="text-align:center"> DB Member </th> <th style="text-align:center"> Cluster Viewer </th> <th style="text-align:center"> Cluster Member </th> <th style="text-align:center"> Admin </th> </tr> </thead> <tbody> <tr> <td> Create support package </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> </tr> <tr> <td> Edit database configuration </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> </tr> <tr> <td> Reset slow log </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> </tr> <tr> <td> View cluster configuration </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> </tr> <tr> <td> View cluster logs </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> <br/> </td> </tr> <tr> <td> View cluster metrics </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> </tr> <tr> <td> View database configuration </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> </tr> <tr> <td> View database metrics </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> </tr> <tr> <td> View node configuration </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> </tr> <tr> <td> View node metrics </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> </tr> <tr> <td> View Redis database password </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> </tr> <tr> <td> View slow log </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> </tr> <tr> <td> View and edit cluster settings </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Not allowed"> ❌ No </span> </td> <td style="text-align:center"> <span title="Allowed"> βœ… Yes </span> </td> </tr> </tbody> </table> <h2 id="create-cluster-role"> Create roles for cluster access </h2> <p> To create a role that grants cluster access but does not grant access to any databases: </p> <ol> <li> <p> From <strong> Access Control </strong> &gt; <strong> Roles </strong> , you can: </p> <ul> <li> <p> Point to a role and select <a href="/docs/latest/images/rs/buttons/edit-button.png#no-click" sdata-lightbox="/images/rs/buttons/edit-button.png#no-click"> <img alt="The Edit button" class="inline" src="/docs/latest/images/rs/buttons/edit-button.png#no-click" width="25px"/> </a> to edit an existing role. </p> </li> <li> <p> Select <strong> + Add role </strong> to create a new role. </p> </li> </ul> <a href="/docs/latest/images/rs/access-control-role-panel.png" sdata-lightbox="/images/rs/access-control-role-panel.png"> <img alt="Add role with name" src="/docs/latest/images/rs/access-control-role-panel.png"/> </a> </li> <li> <p> Enter a descriptive name for the role. </p> </li> <li> <p> Choose a <strong> Cluster management role </strong> to determine cluster management permissions. </p> <a href="/docs/latest/images/rs/screenshots/access-control/rbac-create-role-cluster-only.png" sdata-lightbox="/images/rs/screenshots/access-control/rbac-create-role-cluster-only.png"> <img alt="Select a cluster management role to set the level of cluster management permissions for the new role." src="/docs/latest/images/rs/screenshots/access-control/rbac-create-role-cluster-only.png"/> </a> </li> <li> <p> To prevent database access when using this role, do not add any ACLs. </p> </li> <li> <p> Select <strong> Save </strong> . </p> </li> </ol> <p> You can <a href="/docs/latest/operate/rs/7.4/security/access-control/create-users/#assign-roles-to-users"> assign the new role to users </a> to grant cluster access. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/security/access-control/create-cluster-roles/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/ft.cursor-del.html
<section class="prose w-full py-12"> <h1 class="command-name"> FT.CURSOR DEL </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">FT.CURSOR DEL index cursor_id </pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available in: </dt> <dd class="m-0"> <a href="/docs/stack"> Redis Stack </a> / <a href="/docs/interact/search-and-query"> Search 1.1.0 </a> </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> </dl> <p> Delete a cursor </p> <p> <a href="#examples"> Examples </a> </p> <h2 id="required-arguments"> Required arguments </h2> <details open=""> <summary> <code> index </code> </summary> <p> is index name. </p> </details> <details open=""> <summary> <code> cursor_id </code> </summary> <p> is id of the cursor. </p> </details> <h2 id="returns"> Returns </h2> <p> FT.CURSOR DEL returns a simple string reply <code> OK </code> if executed correctly, or an error reply otherwise. </p> <h2 id="examples"> Examples </h2> <details open=""> <summary> <b> Delete a cursor </b> </summary> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; FT.CURSOR DEL idx <span class="m">342459320</span> </span></span><span class="line"><span class="cl">OK</span></span></code></pre> </div> <p> Check that the cursor is deleted. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.CURSOR DEL idx <span class="m">342459320</span> </span></span><span class="line"><span class="cl"><span class="o">(</span>error<span class="o">)</span> Cursor does not exist</span></span></code></pre> </div> </details> <h2 id="see-also"> See also </h2> <p> <a href="/docs/latest/commands/ft.cursor-read/"> <code> FT.CURSOR READ </code> </a> </p> <h2 id="related-topics"> Related topics </h2> <p> <a href="/docs/latest/develop/interact/search-and-query/"> RediSearch </a> </p> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/ft.cursor-del/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/cf.del/.html
<section class="prose w-full py-12"> <h1 class="command-name"> CF.DEL </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">CF.DEL key item</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available in: </dt> <dd class="m-0"> <a href="/docs/stack"> Redis Stack </a> / <a href="/docs/data-types/probabilistic"> Bloom 1.0.0 </a> </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(k), where k is the number of sub-filters </dd> </dl> <p> Deletes an item once from the filter. </p> <p> If the item exists only once, it will be removed from the filter. If the item was added multiple times, it will still be present. </p> <p> <note> <b> Note: </b> </note> </p> <ul> <li> Deleting an item that are not in the filter may delete a different item, resulting in false negatives. </li> </ul> <h2 id="required-arguments"> Required arguments </h2> <details open=""> <summary> <code> key </code> </summary> <p> is key name for a cuckoo filter. </p> </details> <details open=""> <summary> <code> item </code> </summary> <p> is an item to delete. </p> </details> <h2 id="complexity"> Complexity </h2> <p> O(n), where n is the number of <code> sub-filters </code> . Both alternative locations are checked on all <code> sub-filters </code> . </p> <h2 id="return-value"> Return value </h2> <p> Returns one of these replies: </p> <ul> <li> <a href="/docs/latest/develop/reference/protocol-spec/#integers"> Integer reply </a> - where "1" means that the item has been deleted, and "0" means that such item was not found in the filter </li> <li> [] on error (invalid arguments, wrong key type, etc.) </li> </ul> <h2 id="examples"> Examples </h2> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; CF.INSERT cf ITEMS item1 item2 item2 </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">redis&gt; CF.DEL cf item1 </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">redis&gt; CF.DEL cf item1 </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span> </span></span><span class="line"><span class="cl">redis&gt; CF.DEL cf item2 </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">redis&gt; CF.DEL cf item2 </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">redis&gt; CF.DEL cf item2 </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span></span></span></code></pre> </div> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/cf.del/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/setex/.html
<section class="prose w-full py-12"> <h1 class="command-name"> SETEX <span class="text-base"> (deprecated) </span> </h1> <div class="border-l-8 pl-4"> <p> As of Redis version 2.6.12, this command is regarded as deprecated. </p> <p> It can be replaced by <a href="/docs/latest/commands/set/"> <code> SET </code> </a> with the <code> EX </code> argument when migrating or writing new code. </p> </div> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">SETEX key seconds value</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 2.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @write </code> <span class="mr-1 last:hidden"> , </span> <code> @string </code> <span class="mr-1 last:hidden"> , </span> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Set <code> key </code> to hold the string <code> value </code> and set <code> key </code> to timeout after a given number of seconds. This command is equivalent to: </p> <pre tabindex="0"><code>SET key value EX seconds </code></pre> <p> An error is returned when <code> seconds </code> is invalid. </p> <h2 id="examples"> Examples </h2> <div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex"> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z"> </path> </svg> </div> <form class="redis-cli overflow-y-auto max-h-80"> <pre tabindex="0">redis&gt; SETEX mykey 10 "Hello" "OK" redis&gt; TTL mykey (integer) 10 redis&gt; GET mykey "Hello" </pre> <div class="prompt" style=""> <span> redis&gt; </span> <input autocomplete="off" name="prompt" spellcheck="false" type="text"/> </div> </form> <h2 id="see-also"> See also </h2> <p> <a href="/docs/latest/commands/ttl/"> <code> TTL </code> </a> </p> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#simple-strings"> Simple string reply </a> : <code> OK </code> . <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/setex/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/integrate/write-behind/reference/debezium/mysql/.html
<section class="prose w-full py-12 max-w-none"> <h1> Write-behind configuration for mysql </h1> <p class="text-lg -mt-5 mb-10"> Describes the <code> application.properties </code> settings that configure Debezium Server for mysql </p> <h2 id="applicationproperties"> application.properties </h2> <div class="highlight"> <pre class="chroma"><code class="language-properties" data-lang="properties"><span class="line"><span class="cl"><span class="na">debezium.sink.type</span><span class="o">=</span><span class="s">redis</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.sink.redis.message.format</span><span class="o">=</span><span class="s">extended</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.sink.redis.address</span><span class="o">=</span><span class="s">&lt;RDI_HOST&gt;:&lt;RDI_PORT&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># Comment the following line if not using a password for Write-behind.</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.sink.redis.password</span><span class="o">=</span><span class="s">&lt;RDI_PASSWORD&gt;</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.sink.redis.memory.limit.mb</span><span class="o">=</span><span class="s">80</span> </span></span><span class="line"><span class="cl"><span class="c1"># Redis SSL/TLS</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.sink.redis.ssl.enabled=true</span> </span></span><span class="line"><span class="cl"><span class="c1"># When Redis is configured with a replica shard, these properties allow to verify that the data has been written to the replica.</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.sink.redis.wait.enabled=true</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.sink.redis.wait.timeout.ms=1000</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.sink.redis.wait.retry.enabled=true</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.sink.redis.wait.retry.delay.ms=1000</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.source.database.history.redis.ssl.enabled=true</span> </span></span><span class="line"><span class="cl"><span class="c1"># Location of the Java keystore file containing an application process' own certificate and private key.</span> </span></span><span class="line"><span class="cl"><span class="c1">#javax.net.ssl.keyStore=&lt;KEY_STORE_FILE_PATH&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># Password to access the private key from the keystore file specified by javax.net.ssl.keyStore. This password is used twice: To unlock the keystore file (store password), and To decrypt the private key stored in the keystore (key password).</span> </span></span><span class="line"><span class="cl"><span class="c1">#javax.net.ssl.keyStorePassword=&lt;KEY_STORE_PASSWORD&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># Location of the Java keystore file containing the collection of CA certificates trusted by this application process (trust store).</span> </span></span><span class="line"><span class="cl"><span class="c1">#javax.net.ssl.trustStore=&lt;TRUSE_STORE_FILE_PATH&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># Password to unlock the keystore file (store password) specified by javax.net.ssl.trustStore.</span> </span></span><span class="line"><span class="cl"><span class="c1">#javax.net.ssl.trustStorePassword=&lt;TRUST_STORE_PASSWORD&gt;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.connector.class</span><span class="o">=</span><span class="s">io.debezium.connector.mysql.MySqlConnector</span> </span></span><span class="line"><span class="cl"><span class="c1"># A numeric ID of this database client, which must be unique across all currently-running database processes in the MySQL cluster.</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.database.server.id</span><span class="o">=</span><span class="s">1</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.offset.storage</span><span class="o">=</span><span class="s">io.debezium.storage.redis.offset.RedisOffsetBackingStore</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.topic.prefix</span><span class="o">=</span><span class="s">&lt;SOURCE_LOGICAL_SERVER_NAME&gt;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.database.hostname</span><span class="o">=</span><span class="s">&lt;SOURCE_DB_HOST&gt;</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.database.port</span><span class="o">=</span><span class="s">&lt;SOURCE_DB_PORT&gt;</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.database.user</span><span class="o">=</span><span class="s">&lt;SOURCE_DB_USER&gt;</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.database.password</span><span class="o">=</span><span class="s">&lt;SOURCE_DB_PASSWORD&gt;</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.include.schema.changes</span><span class="o">=</span><span class="s">false</span> </span></span><span class="line"><span class="cl"><span class="c1"># Determines whether the connector should omit publishing change events when there are no modifications in the included columns.</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.skip.messages.without.change</span><span class="o">=</span><span class="s">true</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.offset.flush.interval.ms</span><span class="o">=</span><span class="s">1000</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.tombstones.on.delete</span><span class="o">=</span><span class="s">false</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.schema.history.internal</span><span class="o">=</span><span class="s">io.debezium.storage.redis.history.RedisSchemaHistory</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># Important: Do NOT use `include` and `exclude` database lists at the same time, use either `include` or `exclude`.</span> </span></span><span class="line"><span class="cl"><span class="c1"># An optional, comma-separated list of regular expressions that match database names to be monitored.</span> </span></span><span class="line"><span class="cl"><span class="c1"># By default, all databases are monitored.</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.source.database.include.list=&lt;DB_NAME1&gt;,&lt;DB_NAME2&gt;...</span> </span></span><span class="line"><span class="cl"><span class="c1"># An optional, comma-separated list of regular expressions that match database names for which you do not want to capture changes.</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.source.database.exclude.list=&lt;DB_NAME1&gt;,&lt;DB_NAME2&gt;...</span> </span></span><span class="line"><span class="cl"><span class="c1"># Important: Do NOT use `include` and `exclude` table lists at the same time, use either `include` or `exclude`.</span> </span></span><span class="line"><span class="cl"><span class="c1"># An optional, comma-separated list of regular expressions that match fully-qualified table identifiers of tables whose changes you want to capture.</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.source.table.include.list=&lt;DB_NAME.TABLE_NAME1&gt;,&lt;DB_NAME.TABLE_NAME2&gt;...</span> </span></span><span class="line"><span class="cl"><span class="c1"># An optional, comma-separated list of regular expressions that match fully-qualified table identifiers for tables whose changes you do not want to capture.</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.source.table.exclude.list=&lt;DB_NAME.TABLE_NAME1&gt;,&lt;DB_NAME.TABLE_NAME2&gt;...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># Important: Do NOT use include and exclude column lists at the same time, use either include or exclude.</span> </span></span><span class="line"><span class="cl"><span class="c1"># An optional, comma-separated list of regular expressions that match the fully-qualified names of columns to include in change event record values.</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.source.column.include.list=&lt;DB_NAME.TABLE_NAME.COLUMN_NAME1&gt;,&lt;DB_NAME.TABLE_NAME.COLUMN_NAME2&gt;...</span> </span></span><span class="line"><span class="cl"><span class="c1"># An optional, comma-separated list of regular expressions that match the fully-qualified names of columns to exclude from change event record values.</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.source.column.exclude.list=&lt;DB_NAME.TABLE_NAME.COLUMN_NAME1&gt;,&lt;DB_NAME.TABLE_NAME.COLUMN_NAME2&gt;...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># Records only DDL statements that are relevant to tables whose changes are being captured by Debezium.</span> </span></span><span class="line"><span class="cl"><span class="c1"># In case of changing the captured tables, run `redis-di reset`.</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.schema.history.internal.store.only.captured.tables.ddl</span><span class="o">=</span><span class="s">true</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># Whether to include the detailed schema information generated by Debezium in each record written to RDI.</span> </span></span><span class="line"><span class="cl"><span class="c1"># Note: Including the schema reduces the initial sync throughput and is not recommended for large data sets.</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.key.converter.schemas.enable</span><span class="o">=</span><span class="s">false</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.value.converter.schemas.enable</span><span class="o">=</span><span class="s">false</span> </span></span><span class="line"><span class="cl"><span class="c1"># When detailed schema information is excluded, handle decimal numeric types as strings.</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.decimal.handling.mode</span><span class="o">=</span><span class="s">string</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="na">debezium.transforms</span><span class="o">=</span><span class="s">AddPrefix</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.transforms.AddPrefix.type</span><span class="o">=</span><span class="s">org.apache.kafka.connect.transforms.RegexRouter</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.transforms.AddPrefix.regex</span><span class="o">=</span><span class="s">.*</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.transforms.AddPrefix.replacement</span><span class="o">=</span><span class="s">data:$0</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># Logging</span> </span></span><span class="line"><span class="cl"><span class="c1"># Uncomment the following lines if running Debezium Server as a Java standalone process (non-containerized).</span> </span></span><span class="line"><span class="cl"><span class="c1">#quarkus.log.file.enable=true</span> </span></span><span class="line"><span class="cl"><span class="c1">#quarkus.log.file.path=&lt;LOG_FILE_PATH&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1">#quarkus.log.file.rotation.max-file-size=100M</span> </span></span><span class="line"><span class="cl"><span class="c1">#quarkus.log.file.rotation.rotate-on-boot=true</span> </span></span><span class="line"><span class="cl"><span class="c1">#quarkus.log.file.rotation.file-suffix=.yyyy-MM-dd.gz</span> </span></span><span class="line"><span class="cl"><span class="c1">#quarkus.log.file.rotation.max-backup-index=3</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># The default minimum log level for every log category, change only quarkus.log.level when needed.</span> </span></span><span class="line"><span class="cl"><span class="na">quarkus.log.min-level</span><span class="o">=</span><span class="s">TRACE</span> </span></span><span class="line"><span class="cl"><span class="c1"># The default log level for every log category.</span> </span></span><span class="line"><span class="cl"><span class="na">quarkus.log.level</span><span class="o">=</span><span class="s">INFO</span> </span></span><span class="line"><span class="cl"><span class="c1"># Determine whether to enable the JSON console formatting extension, which disables "normal" console formatting.</span> </span></span><span class="line"><span class="cl"><span class="na">quarkus.log.console.json</span><span class="o">=</span><span class="s">false</span> </span></span><span class="line"><span class="cl"><span class="c1"># The port on which Debezium exposes Microprofile Health endpoint and other exposed status information.</span> </span></span><span class="line"><span class="cl"><span class="na">quarkus.http.port</span><span class="o">=</span><span class="s">8088</span> </span></span></code></pre> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/integrate/write-behind/reference/debezium/mysql/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/cluster/recover/.html
<section class="prose w-full py-12 max-w-none"> <h1> rladmin cluster recover </h1> <p class="text-lg -mt-5 mb-10"> Recovers a cluster from a backup file. </p> <p> Recovers a cluster from a backup file. The default location of the configuration backup file is <code> /var/opt/redislabs/persist/ccs/ccs-redis.rdb </code> . </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster recover </span></span><span class="line"><span class="cl"> filename &lt;recovery filename&gt; </span></span><span class="line"><span class="cl"> <span class="o">[</span> ephemeral_path &lt;path&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> persistent_path &lt;path&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> ccs_persistent_path &lt;path&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> rack_id &lt;ID&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> override_rack_id <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> node_uid &lt;number&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> flash_enabled <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> flash_path &lt;path&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> addr &lt;IP address&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> external_addr &lt;IP address&gt; <span class="o">]</span> </span></span></code></pre> </div> <h3 id="parameters"> Parameters </h3> <table> <thead> <tr> <th> Parameter </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> addr </td> <td> IP address </td> <td> Sets a node's internal IP address. If not provided, the node sets the address automatically. (optional) </td> </tr> <tr> <td> ccs_persistent_path </td> <td> filepath </td> <td> Path to the location of CCS snapshots (default is the same as persistent_path) (optional) </td> </tr> <tr> <td> external_addr </td> <td> IP address </td> <td> Sets a node's external IP address. If not provided, the node sets the address automatically. (optional) </td> </tr> <tr> <td> ephemeral_path </td> <td> filepath (default:Β /var/opt/redislabs) </td> <td> Path to an ephemeral storage location (optional) </td> </tr> <tr> <td> filename </td> <td> filepath </td> <td> Backup file to use for recovery </td> </tr> <tr> <td> flash_enabled </td> <td> </td> <td> Enables flash storage (optional) </td> </tr> <tr> <td> flash_path </td> <td> filepath (default:Β /var/opt/redislabs/flash) </td> <td> Path to the flash storage location in case the node does not support CAPI (required if flash_enabled) </td> </tr> <tr> <td> node_uid </td> <td> integer (default:Β 1) </td> <td> Specifies which node will recover first and become master (optional) </td> </tr> <tr> <td> override_rack_id </td> <td> </td> <td> Changes to a new rack, specified by <code> rack_id </code> (optional) </td> </tr> <tr> <td> persistent_path </td> <td> filepath </td> <td> Path to the persistent storage location (optional) </td> </tr> <tr> <td> rack_id </td> <td> string </td> <td> Switches to the specified rack (optional) </td> </tr> </tbody> </table> <h3 id="returns"> Returns </h3> <p> Returns <code> ok </code> if the cluster recovered successfully. Otherwise, it returns an error message. </p> <h3 id="example"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin cluster recover filename /tmp/persist/ccs/ccs-redis.rdb node_uid <span class="m">1</span> rack_id <span class="m">5</span> </span></span><span class="line"><span class="cl">Initiating cluster recovery... ok </span></span></code></pre> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/cluster/recover/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/develop/get-started/data-store/.html
<section class="prose w-full py-12"> <h1> Redis as an in-memory data structure store quick start guide </h1> <p class="text-lg -mt-5 mb-10"> Understand how to use basic Redis data types </p> <p> This quick start guide shows you how to: </p> <ol> <li> Get started with Redis </li> <li> Store data under a key in Redis </li> <li> Retrieve data with a key from Redis </li> <li> Scan the keyspace for keys that match a specific pattern </li> </ol> <p> The examples in this article refer to a simple bicycle inventory. </p> <h2 id="setup"> Setup </h2> <p> The easiest way to get started with Redis is to use Redis Cloud: </p> <ol> <li> <p> Create a <a href="https://redis.com/try-free?utm_source=redisio&amp;utm_medium=referral&amp;utm_campaign=2023-09-try_free&amp;utm_content=cu-redis_cloud_users"> free account </a> . </p> <img src="../img/free-cloud-db.png" width="500px"/> </li> <li> <p> Follow the instructions to create a free database. </p> </li> </ol> <p> You can alternatively follow the <a href="/docs/latest/operate/oss_and_stack/install/install-stack/"> installation guides </a> to install Redis on your local machine. </p> <h2 id="connect"> Connect </h2> <p> The first step is to connect to Redis. You can find further details about the connection options in this documentation site's <a href="/docs/latest/develop/tools/"> Tools section </a> . The following example shows how to connect to a Redis server that runs on localhost ( <code> -h 127.0.0.1 </code> ) and listens on the default port ( <code> -p 6379 </code> ): </p> <p> </p> <div class="codetabs cli group flex justify-start items-center flex-wrap box-border rounded-lg mt-0 mb-0 mx-auto bg-slate-900" id="search_quickstart-stepconnect"> <input checked="" class="radiotab w-0 h-0" data-lang="redis-cli" id="redis-cli_search_quickstart-stepconnect" name="search_quickstart-stepconnect" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="redis-cli_search_quickstart-stepconnect" title="Open example"> &gt;_ Redis CLI </label> <div aria-labelledby="tab-search_quickstart-stepconnect" class="panel order-last hidden w-full mt-0 relative" id="panel_redis-cli_search_quickstart-stepconnect" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-plaintext" data-lang="plaintext"><span class="line hl"><span class="cl">&gt; redis-cli -h 127.0.0.1 -p 6379</span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_redis-cli_search_quickstart-stepconnect')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <div class="flex-1 text-xs text-white overflow-ellipsis"> Are you tired of using redis-cli? Try Redis Insight - the developer GUI for Redis. </div> <div class="text-right"> <a class="rounded rounded-mx px-2 py-1 flex items-center text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.com/redis-enterprise/redis-insight/" tabindex="1" title="Get Redis Insight"> <svg class="w-4 h-4 mr-1" fill="none" height="14" viewbox="0 0 14 14" width="14" xmlns="http://www.w3.org/2000/svg"> <path d="M2.26236 5.66895L1.21732 6.07172L7.00018 8.65693V7.79842L2.26236 5.66895Z" fill="#fca5a5"> </path> <path d="M2.26236 8.02271L1.21732 8.42548L7.00018 11.0119V10.1516L2.26236 8.02271Z" fill="#fca5a5"> </path> <path d="M1.21732 3.7175L7.00018 6.30392V2.87805L8.66273 2.13423L7.00018 1.49512L1.21732 3.7175Z" fill="#fca5a5"> </path> <path d="M7.00018 2.8781V6.30366L1.21732 3.71724V5.20004L7.00018 7.79705V8.65526L1.21732 6.07217V7.55496L7.00018 10.1553V11.0135L1.21732 8.42376V9.90656H1.18878L7.00018 12.5051L8.66273 11.7613V2.13428L7.00018 2.8781Z" fill="#f87171"> </path> <path d="M9.07336 11.5777L10.7359 10.8338V4.01538L9.07336 4.7592V11.5777Z" fill="#f87171"> </path> <path d="M9.07336 4.75867L10.7359 4.01485L9.07336 3.37573V4.75867Z" fill="#fca5a5"> </path> <path d="M11.1481 10.6497L12.8112 9.90591V5.896L11.1487 6.63982L11.1481 10.6497Z" fill="#f87171"> </path> <path d="M11.1481 6.63954L12.8112 5.89572L11.1481 5.25781V6.63954Z" fill="#fca5a5"> </path> </svg> <span> Get Redis Insight </span> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="python" id="Python_search_quickstart-stepconnect" name="search_quickstart-stepconnect" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Python_search_quickstart-stepconnect" title="Open example"> Python </label> <div aria-labelledby="tab-search_quickstart-stepconnect" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_search_quickstart-stepconnect" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2">Code samples for document database quickstart pages: </span></span></span><span class="line"><span class="cl"><span class="s2"> https://redis.io/docs/latest/develop/get-started/document-database/ </span></span></span><span class="line"><span class="cl"><span class="s2">"""</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.commands.search.aggregation</span> <span class="k">as</span> <span class="nn">aggregations</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.commands.search.reducers</span> <span class="k">as</span> <span class="nn">reducers</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.json.path</span> <span class="kn">import</span> <span class="n">Path</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.field</span> <span class="kn">import</span> <span class="n">NumericField</span><span class="p">,</span> <span class="n">TagField</span><span class="p">,</span> <span class="n">TextField</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.indexDefinition</span> <span class="kn">import</span> <span class="n">IndexDefinition</span><span class="p">,</span> <span class="n">IndexType</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.query</span> <span class="kn">import</span> <span class="n">Query</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">r</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">Redis</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s2">"localhost"</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">6379</span><span class="p">,</span> <span class="n">db</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">bicycle</span> <span class="o">=</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="s2">"Velorim"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="s2">"Jigger"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"price"</span><span class="p">:</span> <span class="mi">270</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Small and powerful, the Jigger is the best ride "</span> </span></span><span class="line"><span class="cl"> <span class="s2">"for the smallest of tikes! This is the tiniest "</span> </span></span><span class="line"><span class="cl"> <span class="s2">"kids’ pedal bike on the market available without"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" a coaster brake, the Jigger is the vehicle of "</span> </span></span><span class="line"><span class="cl"> <span class="s2">"choice for the rare tenacious little rider "</span> </span></span><span class="line"><span class="cl"> <span class="s2">"raring to go."</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="s2">"condition"</span><span class="p">:</span> <span class="s2">"new"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">bicycles</span> <span class="o">=</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="n">bicycle</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="s2">"Bicyk"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="s2">"Hillcraft"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"price"</span><span class="p">:</span> <span class="mi">1200</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Kids want to ride with as little weight as possible."</span> </span></span><span class="line"><span class="cl"> <span class="s2">" Especially on an incline! They may be at the age "</span> </span></span><span class="line"><span class="cl"> <span class="s1">'when a 27.5" wheel bike is just too clumsy coming '</span> </span></span><span class="line"><span class="cl"> <span class="s1">'off a 24" bike. The Hillcraft 26 is just the solution'</span> </span></span><span class="line"><span class="cl"> <span class="s2">" they need!"</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="s2">"condition"</span><span class="p">:</span> <span class="s2">"used"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="s2">"Nord"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="s2">"Chook air 5"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"price"</span><span class="p">:</span> <span class="mi">815</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"The Chook Air 5 gives kids aged six years and older "</span> </span></span><span class="line"><span class="cl"> <span class="s2">"a durable and uberlight mountain bike for their first"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" experience on tracks and easy cruising through forests"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" and fields. The lower top tube makes it easy to mount"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" and dismount in any situation, giving your kids greater"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" safety on the trails."</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="s2">"condition"</span><span class="p">:</span> <span class="s2">"used"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="s2">"Eva"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="s2">"Eva 291"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"price"</span><span class="p">:</span> <span class="mi">3400</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"The sister company to Nord, Eva launched in 2005 as the"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" first and only women-dedicated bicycle brand. Designed"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" by women for women, allEva bikes are optimized for the"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" feminine physique using analytics from a body metrics"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" database. If you like 29ers, try the Eva 291. It’s a "</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand new bike for 2022.. This full-suspension, "</span> </span></span><span class="line"><span class="cl"> <span class="s2">"cross-country ride has been designed for velocity. The"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" 291 has 100mm of front and rear travel, a superlight "</span> </span></span><span class="line"><span class="cl"> <span class="s2">"aluminum frame and fast-rolling 29-inch wheels. Yippee!"</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="s2">"condition"</span><span class="p">:</span> <span class="s2">"used"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="s2">"Noka Bikes"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="s2">"Kahuna"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"price"</span><span class="p">:</span> <span class="mi">3200</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Whether you want to try your hand at XC racing or are "</span> </span></span><span class="line"><span class="cl"> <span class="s2">"looking for a lively trail bike that's just as inspiring"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" on the climbs as it is over rougher ground, the Wilder"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" is one heck of a bike built specifically for short women."</span> </span></span><span class="line"><span class="cl"> <span class="s2">" Both the frames and components have been tweaked to "</span> </span></span><span class="line"><span class="cl"> <span class="s2">"include a women’s saddle, different bars and unique "</span> </span></span><span class="line"><span class="cl"> <span class="s2">"colourway."</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="s2">"condition"</span><span class="p">:</span> <span class="s2">"used"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="s2">"Breakout"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="s2">"XBN 2.1 Alloy"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"price"</span><span class="p">:</span> <span class="mi">810</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"The XBN 2.1 Alloy is our entry-level road bike – but that’s"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" not to say that it’s a basic machine. With an internal "</span> </span></span><span class="line"><span class="cl"> <span class="s2">"weld aluminium frame, a full carbon fork, and the slick-shifting"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" Claris gears from Shimano’s, this is a bike which doesn’t"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" break the bank and delivers craved performance."</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="s2">"condition"</span><span class="p">:</span> <span class="s2">"new"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="s2">"ScramBikes"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="s2">"WattBike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"price"</span><span class="p">:</span> <span class="mi">2300</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"The WattBike is the best e-bike for people who still feel young"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" at heart. It has a Bafang 1000W mid-drive system and a 48V"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" 17.5AH Samsung Lithium-Ion battery, allowing you to ride for"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" more than 60 miles on one charge. It’s great for tackling hilly"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" terrain or if you just fancy a more leisurely ride. With three"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" working modes, you can choose between E-bike, assisted bicycle,"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" and normal bike modes."</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="s2">"condition"</span><span class="p">:</span> <span class="s2">"new"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="s2">"Peaknetic"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="s2">"Secto"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"price"</span><span class="p">:</span> <span class="mi">430</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"If you struggle with stiff fingers or a kinked neck or back after"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" a few minutes on the road, this lightweight, aluminum bike"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" alleviates those issues and allows you to enjoy the ride. From"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" the ergonomic grips to the lumbar-supporting seat position, the"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" Roll Low-Entry offers incredible comfort. The rear-inclined seat"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" tube facilitates stability by allowing you to put a foot on the"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" ground to balance at a stop, and the low step-over frame makes it"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" accessible for all ability and mobility levels. The saddle is"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" very soft, with a wide back to support your hip joints and a"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" cutout in the center to redistribute that pressure. Rim brakes"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" deliver satisfactory braking control, and the wide tires provide"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" a smooth, stable ride on paved roads and gravel. Rack and fender"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" mounts facilitate setting up the Roll Low-Entry as your preferred"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" commuter, and the BMX-like handlebar offers space for mounting a"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" flashlight, bell, or phone holder."</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="s2">"condition"</span><span class="p">:</span> <span class="s2">"new"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="s2">"nHill"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="s2">"Summit"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"price"</span><span class="p">:</span> <span class="mi">1200</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"This budget mountain bike from nHill performs well both on bike"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" paths and on the trail. The fork with 100mm of travel absorbs"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" rough terrain. Fat Kenda Booster tires give you grip in corners"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" and on wet trails. The Shimano Tourney drivetrain offered enough"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" gears for finding a comfortable pace to ride uphill, and the"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" Tektro hydraulic disc brakes break smoothly. Whether you want an"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" affordable bike that you can take to work, but also take trail in"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" mountains on the weekends or you’re just after a stable,"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" comfortable ride for the bike path, the Summit gives a good value"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" for money."</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="s2">"condition"</span><span class="p">:</span> <span class="s2">"new"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="s2">"ThrillCycle"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="s2">"BikeShind"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"price"</span><span class="p">:</span> <span class="mi">815</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"An artsy, retro-inspired bicycle that’s as functional as it is"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" pretty: The ThrillCycle steel frame offers a smooth ride. A"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" 9-speed drivetrain has enough gears for coasting in the city, but"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" we wouldn’t suggest taking it to the mountains. Fenders protect"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" you from mud, and a rear basket lets you transport groceries,"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" flowers and books. The ThrillCycle comes with a limited lifetime"</span> </span></span><span class="line"><span class="cl"> <span class="s2">" warranty, so this little guy will last you long past graduation."</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="s2">"condition"</span><span class="p">:</span> <span class="s2">"refurbished"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"><span class="p">]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.brand"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"brand"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.model"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"model"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.description"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"description"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">(</span><span class="s2">"$.price"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"price"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">(</span><span class="s2">"$.condition"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"condition"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">index</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bicycle"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">schema</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">definition</span><span class="o">=</span><span class="n">IndexDefinition</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="p">[</span><span class="s2">"bicycle:"</span><span class="p">],</span> <span class="n">index_type</span><span class="o">=</span><span class="n">IndexType</span><span class="o">.</span><span class="n">JSON</span><span class="p">),</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">bid</span><span class="p">,</span> <span class="n">bicycle</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bicycles</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">r</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="sa">f</span><span class="s2">"bicycle:</span><span class="si">{</span><span class="n">bid</span><span class="si">}</span><span class="s2">"</span><span class="p">,</span> <span class="n">Path</span><span class="o">.</span><span class="n">root_path</span><span class="p">(),</span> <span class="n">bicycle</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">Query</span><span class="p">(</span><span class="s2">"*"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="s2">"Documents found:"</span><span class="p">,</span> <span class="n">res</span><span class="o">.</span><span class="n">total</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; Documents found: 10</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">Query</span><span class="p">(</span><span class="s2">"@model:Jigger"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; Result{1 total, docs: [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bicycle:0',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'json': '{</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand":"Velorim",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model":"Jigger",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price":270,</span> </span></span><span class="line"><span class="cl"><span class="c1"># ...</span> </span></span><span class="line"><span class="cl"><span class="c1"># "condition":"new"</span> </span></span><span class="line"><span class="cl"><span class="c1"># }'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }]}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">Query</span><span class="p">(</span><span class="s2">"@model:Jigger"</span><span class="p">)</span><span class="o">.</span><span class="n">return_field</span><span class="p">(</span><span class="s2">"$.price"</span><span class="p">,</span> <span class="n">as_field</span><span class="o">=</span><span class="s2">"price"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [Document {'id': 'bicycle:0', 'payload': None, 'price': '270'}]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">Query</span><span class="p">(</span><span class="s2">"basic @price:[500 1000]"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; Result{1 total, docs: [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bicycle:5',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'json': '{</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand":"Breakout",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model":"XBN 2.1 Alloy",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price":810,</span> </span></span><span class="line"><span class="cl"><span class="c1"># ...</span> </span></span><span class="line"><span class="cl"><span class="c1"># "condition":"new"</span> </span></span><span class="line"><span class="cl"><span class="c1"># }'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }]}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">Query</span><span class="p">(</span><span class="s1">'@brand:"Noka Bikes"'</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; Result{1 total, docs: [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bicycle:4',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'json': '{</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand":"Noka Bikes",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model":"Kahuna",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price":3200,</span> </span></span><span class="line"><span class="cl"><span class="c1"># ...</span> </span></span><span class="line"><span class="cl"><span class="c1"># "condition":"used"</span> </span></span><span class="line"><span class="cl"><span class="c1"># }'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }]}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"@description:</span><span class="si">%a</span><span class="s2">nalitics%"</span><span class="p">)</span><span class="o">.</span><span class="n">dialect</span><span class="p">(</span> <span class="c1"># Note the typo in the word "analytics"</span> </span></span><span class="line"><span class="cl"> <span class="mi">2</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; Result{1 total, docs: [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bicycle:3',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'json': '{</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand":"Eva",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model":"Eva 291",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price":3400,</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description":"...using analytics from a body metrics database...",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "condition":"used"</span> </span></span><span class="line"><span class="cl"><span class="c1"># }'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }]}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"@description:</span><span class="si">%%</span><span class="s2">analitycs</span><span class="si">%%</span><span class="s2">"</span><span class="p">)</span><span class="o">.</span><span class="n">dialect</span><span class="p">(</span> <span class="c1"># Note 2 typos in the word "analytics"</span> </span></span><span class="line"><span class="cl"> <span class="mi">2</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; Result{1 total, docs: [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bicycle:3',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'json': '{</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand":"Eva",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model":"Eva 291",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price":3400,</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description":"...using analytics from a body metrics database...",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "condition":"used"</span> </span></span><span class="line"><span class="cl"><span class="c1"># }'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }]}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">Query</span><span class="p">(</span><span class="s2">"@model:hill*"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; Result{1 total, docs: [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bicycle:1',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'json': '{</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand":"Bicyk",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model":"Hillcraft",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price":1200,</span> </span></span><span class="line"><span class="cl"><span class="c1"># ...</span> </span></span><span class="line"><span class="cl"><span class="c1"># "condition":"used"</span> </span></span><span class="line"><span class="cl"><span class="c1"># }'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }]}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">Query</span><span class="p">(</span><span class="s2">"@model:*bike"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; Result{1 total, docs: [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bicycle:6',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'json': '{</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand":"ScramBikes",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model":"WattBike",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price":2300,</span> </span></span><span class="line"><span class="cl"><span class="c1"># ...</span> </span></span><span class="line"><span class="cl"><span class="c1"># "condition":"new"</span> </span></span><span class="line"><span class="cl"><span class="c1"># }'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }]}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">Query</span><span class="p">(</span><span class="s2">"w'H?*craft'"</span><span class="p">)</span><span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="o">.</span><span class="n">docs</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">json</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand":"Bicyk",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model":"Hillcraft",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price":1200,</span> </span></span><span class="line"><span class="cl"><span class="c1"># ...</span> </span></span><span class="line"><span class="cl"><span class="c1"># "condition":"used"</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">Query</span><span class="p">(</span><span class="s2">"mountain"</span><span class="p">)</span><span class="o">.</span><span class="n">with_scores</span><span class="p">())</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">sr</span> <span class="ow">in</span> <span class="n">res</span><span class="o">.</span><span class="n">docs</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">sr</span><span class="o">.</span><span class="n">id</span><span class="si">}</span><span class="s2">: score=</span><span class="si">{</span><span class="n">sr</span><span class="o">.</span><span class="n">score</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">Query</span><span class="p">(</span><span class="s2">"mountain"</span><span class="p">)</span><span class="o">.</span><span class="n">with_scores</span><span class="p">()</span><span class="o">.</span><span class="n">scorer</span><span class="p">(</span><span class="s2">"BM25"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">sr</span> <span class="ow">in</span> <span class="n">res</span><span class="o">.</span><span class="n">docs</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">sr</span><span class="o">.</span><span class="n">id</span><span class="si">}</span><span class="s2">: score=</span><span class="si">{</span><span class="n">sr</span><span class="o">.</span><span class="n">score</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">req</span> <span class="o">=</span> <span class="n">aggregations</span><span class="o">.</span><span class="n">AggregateRequest</span><span class="p">(</span><span class="s2">"*"</span><span class="p">)</span><span class="o">.</span><span class="n">group_by</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"@condition"</span><span class="p">,</span> <span class="n">reducers</span><span class="o">.</span><span class="n">count</span><span class="p">()</span><span class="o">.</span><span class="n">alias</span><span class="p">(</span><span class="s2">"count"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">aggregate</span><span class="p">(</span><span class="n">req</span><span class="p">)</span><span class="o">.</span><span class="n">rows</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [['condition', 'refurbished', 'count', '1'],</span> </span></span><span class="line"><span class="cl"><span class="c1"># ['condition', 'used', 'count', '4'],</span> </span></span><span class="line"><span class="cl"><span class="c1"># ['condition', 'new', 'count', '5']]</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Python_search_quickstart-stepconnect')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Python_search_quickstart-stepconnect" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/python/redis-py/" tabindex="1" title="Quick-Start"> Python Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/redis-py/tree/master/doctests/search_quickstart.py" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="javascript" id="Nodejs_search_quickstart-stepconnect" name="search_quickstart-stepconnect" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Nodejs_search_quickstart-stepconnect" title="Open example"> Node.js </label> <div aria-labelledby="tab-search_quickstart-stepconnect" class="panel order-last hidden w-full mt-0 relative" id="panel_Nodejs_search_quickstart-stepconnect" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-javascript" data-lang="javascript"><span class="line"><span class="cl"><span class="kr">import</span> <span class="p">{</span> <span class="nx">AggregateGroupByReducers</span><span class="p">,</span> <span class="nx">AggregateSteps</span><span class="p">,</span> <span class="nx">createClient</span><span class="p">,</span> <span class="nx">SchemaFieldTypes</span> <span class="p">}</span> <span class="nx">from</span> <span class="s1">'redis'</span><span class="p">;</span> </span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">client</span> <span class="o">=</span> <span class="nx">createClient</span><span class="p">();</span> </span></span><span class="line hl"><span class="cl"><span class="nx">client</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">'error'</span><span class="p">,</span> <span class="nx">err</span> <span class="p">=&gt;</span> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">'Redis Client Error'</span><span class="p">,</span> <span class="nx">err</span><span class="p">));</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">connect</span><span class="p">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">bicycle1</span> <span class="o">=</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">brand</span><span class="o">:</span> <span class="s1">'Velorim'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">model</span><span class="o">:</span> <span class="s1">'Jigger'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">price</span><span class="o">:</span> <span class="mi">270</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">description</span><span class="o">:</span> </span></span><span class="line"><span class="cl"> <span class="s1">'Small and powerful, the Jigger is the best '</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s1">'ride for the smallest of tikes! This is the tiniest kids\u2019 '</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s1">'pedal bike on the market available without a coaster brake, the '</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s1">'Jigger is the vehicle of choice for the rare tenacious little'</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s1">'rider raring to go.'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">condition</span><span class="o">:</span> <span class="s1">'new'</span> </span></span><span class="line"><span class="cl"><span class="p">};</span> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">bicycles</span> <span class="o">=</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="nx">bicycle1</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">brand</span><span class="o">:</span> <span class="s1">'Bicyk'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">model</span><span class="o">:</span> <span class="s1">'Hillcraft'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">price</span><span class="o">:</span> <span class="mi">1200</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">description</span><span class="o">:</span> <span class="s1">'Kids want to ride with as little weight as possible. Especially on an incline! They may be at the age when a 27.5\" wheel bike is just too clumsy coming off a 24\" bike. The Hillcraft 26 is just the solution they need!'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">condition</span><span class="o">:</span> <span class="s1">'used'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">brand</span><span class="o">:</span> <span class="s1">'Nord'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">model</span><span class="o">:</span> <span class="s1">'Chook air 5'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">price</span><span class="o">:</span> <span class="mi">815</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">description</span><span class="o">:</span> <span class="s1">'The Chook Air 5 gives kids aged six years and older a durable and uberlight mountain bike for their first experience on tracks and easy cruising through forests and fields. The lower top tube makes it easy to mount and dismount in any situation, giving your kids greater safety on the trails.'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">condition</span><span class="o">:</span> <span class="s1">'used'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">brand</span><span class="o">:</span> <span class="s1">'Eva'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">model</span><span class="o">:</span> <span class="s1">'Eva 291'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">price</span><span class="o">:</span> <span class="mi">3400</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">description</span><span class="o">:</span> <span class="s1">'The sister company to Nord, Eva launched in 2005 as the first and only women-dedicated bicycle brand. Designed by women for women, allEva bikes are optimized for the feminine physique using analytics from a body metrics database. If you like 29ers, try the Eva 291. It\u2019s a brand new bike for 2022.. This full-suspension, cross-country ride has been designed for velocity. The 291 has 100mm of front and rear travel, a superlight aluminum frame and fast-rolling 29-inch wheels. Yippee!'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">condition</span><span class="o">:</span> <span class="s1">'used'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">brand</span><span class="o">:</span> <span class="s1">'Noka Bikes'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">model</span><span class="o">:</span> <span class="s1">'Kahuna'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">price</span><span class="o">:</span> <span class="mi">3200</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">description</span><span class="o">:</span> <span class="s1">'Whether you want to try your hand at XC racing or are looking for a lively trail bike that\'s just as inspiring on the climbs as it is over rougher ground, the Wilder is one heck of a bike built specifically for short women. Both the frames and components have been tweaked to include a women\u2019s saddle, different bars and unique colourway.'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">condition</span><span class="o">:</span> <span class="s1">'used'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">brand</span><span class="o">:</span> <span class="s1">'Breakout'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">model</span><span class="o">:</span> <span class="s1">'XBN 2.1 Alloy'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">price</span><span class="o">:</span> <span class="mi">810</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">description</span><span class="o">:</span> <span class="s1">'The XBN 2.1 Alloy is our entry-level road bike \u2013 but that\u2019s not to say that it\u2019s a basic machine. With an internal weld aluminium frame, a full carbon fork, and the slick-shifting Claris gears from Shimano\u2019s, this is a bike which doesn\u2019t break the bank and delivers craved performance.'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">condition</span><span class="o">:</span> <span class="s1">'new'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">brand</span><span class="o">:</span> <span class="s1">'ScramBikes'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">model</span><span class="o">:</span> <span class="s1">'WattBike'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">price</span><span class="o">:</span> <span class="mi">2300</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">description</span><span class="o">:</span> <span class="s1">'The WattBike is the best e-bike for people who still feel young at heart. It has a Bafang 1000W mid-drive system and a 48V 17.5AH Samsung Lithium-Ion battery, allowing you to ride for more than 60 miles on one charge. It\u2019s great for tackling hilly terrain or if you just fancy a more leisurely ride. With three working modes, you can choose between E-bike, assisted bicycle, and normal bike modes.'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">condition</span><span class="o">:</span> <span class="s1">'new'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">brand</span><span class="o">:</span> <span class="s1">'Peaknetic'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">model</span><span class="o">:</span> <span class="s1">'Secto'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">price</span><span class="o">:</span> <span class="mi">430</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">description</span><span class="o">:</span> <span class="s1">'If you struggle with stiff fingers or a kinked neck or back after a few minutes on the road, this lightweight, aluminum bike alleviates those issues and allows you to enjoy the ride. From the ergonomic grips to the lumbar-supporting seat position, the Roll Low-Entry offers incredible comfort. The rear-inclined seat tube facilitates stability by allowing you to put a foot on the ground to balance at a stop, and the low step-over frame makes it accessible for all ability and mobility levels. The saddle is very soft, with a wide back to support your hip joints and a cutout in the center to redistribute that pressure. Rim brakes deliver satisfactory braking control, and the wide tires provide a smooth, stable ride on paved roads and gravel. Rack and fender mounts facilitate setting up the Roll Low-Entry as your preferred commuter, and the BMX-like handlebar offers space for mounting a flashlight, bell, or phone holder.'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">condition</span><span class="o">:</span> <span class="s1">'new'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">brand</span><span class="o">:</span> <span class="s1">'nHill'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">model</span><span class="o">:</span> <span class="s1">'Summit'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">price</span><span class="o">:</span> <span class="mi">1200</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">description</span><span class="o">:</span> <span class="s1">'This budget mountain bike from nHill performs well both on bike paths and on the trail. The fork with 100mm of travel absorbs rough terrain. Fat Kenda Booster tires give you grip in corners and on wet trails. The Shimano Tourney drivetrain offered enough gears for finding a comfortable pace to ride uphill, and the Tektro hydraulic disc brakes break smoothly. Whether you want an affordable bike that you can take to work, but also take trail in mountains on the weekends or you\u2019re just after a stable, comfortable ride for the bike path, the Summit gives a good value for money.'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">condition</span><span class="o">:</span> <span class="s1">'new'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">model</span><span class="o">:</span> <span class="s1">'ThrillCycle'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">brand</span><span class="o">:</span> <span class="s1">'BikeShind'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">price</span><span class="o">:</span> <span class="mi">815</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">description</span><span class="o">:</span> <span class="s1">'An artsy, retro-inspired bicycle that\u2019s as functional as it is pretty: The ThrillCycle steel frame offers a smooth ride. A 9-speed drivetrain has enough gears for coasting in the city, but we wouldn\u2019t suggest taking it to the mountains. Fenders protect you from mud, and a rear basket lets you transport groceries, flowers and books. The ThrillCycle comes with a limited lifetime warranty, so this little guy will last you long past graduation.'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">condition</span><span class="o">:</span> <span class="s1">'refurbished'</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">];</span> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">schema</span> <span class="o">=</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.brand'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">TEXT</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">SORTABLE</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'brand'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.model'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">TEXT</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'model'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.description'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">TEXT</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'description'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.price'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">NUMERIC</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'price'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.condition'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">TAG</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'condition'</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">};</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">try</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">create</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="nx">schema</span><span class="p">,</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">ON</span><span class="o">:</span> <span class="s1">'JSON'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">PREFIX</span><span class="o">:</span> <span class="s1">'bicycle:'</span> </span></span><span class="line"><span class="cl"> <span class="p">});</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="p">(</span><span class="nx">e</span><span class="p">.</span><span class="nx">message</span> <span class="o">===</span> <span class="s1">'Index already exists'</span><span class="p">)</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">'Index exists already, skipped creation.'</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="c1">// Something went wrong, perhaps RediSearch isn't installed... </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="nx">process</span><span class="p">.</span><span class="nx">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nb">Promise</span><span class="p">.</span><span class="nx">all</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="nx">bicycles</span><span class="p">.</span><span class="nx">map</span><span class="p">((</span><span class="nx">bicycle</span><span class="p">,</span> <span class="nx">i</span><span class="p">)</span> <span class="p">=&gt;</span> <span class="nx">client</span><span class="p">.</span><span class="nx">json</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="sb">`bicycle:</span><span class="si">${</span><span class="nx">i</span><span class="si">}</span><span class="sb">`</span><span class="p">,</span> <span class="s1">'$'</span><span class="p">,</span> <span class="nx">bicycle</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="p">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kd">let</span> <span class="nx">result</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="s1">'*'</span><span class="p">,</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">LIMIT</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">from</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">size</span><span class="o">:</span> <span class="mi">10</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">});</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">JSON</span><span class="p">.</span><span class="nx">stringify</span><span class="p">(</span><span class="nx">result</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="mi">2</span><span class="p">));</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="cm">/* </span></span></span><span class="line"><span class="cl"><span class="cm">{ </span></span></span><span class="line"><span class="cl"><span class="cm"> "total": 10, </span></span></span><span class="line"><span class="cl"><span class="cm"> "documents": ... </span></span></span><span class="line"><span class="cl"><span class="cm">} </span></span></span><span class="line"><span class="cl"><span class="cm">*/</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="nx">result</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s1">'idx:bicycle'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s1">'@model:Jigger'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">LIMIT</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">from</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">size</span><span class="o">:</span> <span class="mi">10</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">});</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">JSON</span><span class="p">.</span><span class="nx">stringify</span><span class="p">(</span><span class="nx">result</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="mi">2</span><span class="p">));</span> </span></span><span class="line"><span class="cl"><span class="cm">/* </span></span></span><span class="line"><span class="cl"><span class="cm">{ </span></span></span><span class="line"><span class="cl"><span class="cm"> "total": 1, </span></span></span><span class="line"><span class="cl"><span class="cm"> "documents": [{ </span></span></span><span class="line"><span class="cl"><span class="cm"> "id": "bicycle:0", </span></span></span><span class="line"><span class="cl"><span class="cm"> "value": { </span></span></span><span class="line"><span class="cl"><span class="cm"> "brand": "Velorim", </span></span></span><span class="line"><span class="cl"><span class="cm"> "model": "Jigger", </span></span></span><span class="line"><span class="cl"><span class="cm"> "price": 270, </span></span></span><span class="line"><span class="cl"><span class="cm"> "description": "Small and powerful, the Jigger is the best ride for the smallest of tikes! This is the tiniest kids’ pedal bike on the market available without a coaster brake, the Jigger is the vehicle of choice for the rare tenacious little rider raring to go.", </span></span></span><span class="line"><span class="cl"><span class="cm"> "condition": "new" </span></span></span><span class="line"><span class="cl"><span class="cm"> } </span></span></span><span class="line"><span class="cl"><span class="cm"> }] </span></span></span><span class="line"><span class="cl"><span class="cm">} </span></span></span><span class="line"><span class="cl"><span class="cm"> */</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="nx">result</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s1">'idx:bicycle'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s1">'@brand:"Noka Bikes"'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">LIMIT</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">from</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">size</span><span class="o">:</span> <span class="mi">10</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">JSON</span><span class="p">.</span><span class="nx">stringify</span><span class="p">(</span><span class="nx">result</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="mi">2</span><span class="p">));</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="cm">/* </span></span></span><span class="line"><span class="cl"><span class="cm">{ </span></span></span><span class="line"><span class="cl"><span class="cm"> "total": 1, </span></span></span><span class="line"><span class="cl"><span class="cm"> "documents": [{ </span></span></span><span class="line"><span class="cl"><span class="cm"> "id": "bicycle:4", </span></span></span><span class="line"><span class="cl"><span class="cm"> "value": { </span></span></span><span class="line"><span class="cl"><span class="cm"> "brand": "Noka Bikes", </span></span></span><span class="line"><span class="cl"><span class="cm"> "model": "Kahuna", </span></span></span><span class="line"><span class="cl"><span class="cm"> "price": 3200, </span></span></span><span class="line"><span class="cl"><span class="cm"> "description": "Whether you want to try your hand at XC racing or are looking for a lively trail bike that's just as inspiring on the climbs as it is over rougher ground, the Wilder is one heck of a bike built specifically for short women. Both the frames and components have been tweaked to include a women’s saddle, different bars and unique colourway.", </span></span></span><span class="line"><span class="cl"><span class="cm"> "condition": "used" </span></span></span><span class="line"><span class="cl"><span class="cm"> } </span></span></span><span class="line"><span class="cl"><span class="cm"> }] </span></span></span><span class="line"><span class="cl"><span class="cm">} </span></span></span><span class="line"><span class="cl"><span class="cm">*/</span> </span></span><span class="line"><span class="cl"> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Nodejs_search_quickstart-stepconnect')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Nodejs_search_quickstart-stepconnect" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/nodejs/" tabindex="1" title="Quick-Start"> Node.js Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/node-redis/tree/emb-examples/doctests/search-quickstart.js" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="java" id="Java_search_quickstart-stepconnect" name="search_quickstart-stepconnect" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Java_search_quickstart-stepconnect" title="Open example"> Java </label> <div aria-labelledby="tab-search_quickstart-stepconnect" class="panel order-last hidden w-full mt-0 relative" id="panel_Java_search_quickstart-stepconnect" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="kn">package</span> <span class="nn">io.redis.examples</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">java.math.BigDecimal</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">java.util.*</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.*</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.exceptions.*</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.search.*</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.search.aggr.*</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.search.schemafields.*</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kd">class</span> <span class="nc">Bicycle</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="kd">public</span> <span class="n">String</span> <span class="n">brand</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> <span class="kd">public</span> <span class="n">String</span> <span class="n">model</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> <span class="kd">public</span> <span class="n">BigDecimal</span> <span class="n">price</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> <span class="kd">public</span> <span class="n">String</span> <span class="n">description</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> <span class="kd">public</span> <span class="n">String</span> <span class="n">condition</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kd">public</span> <span class="nf">Bicycle</span><span class="o">(</span><span class="n">String</span> <span class="n">brand</span><span class="o">,</span> <span class="n">String</span> <span class="n">model</span><span class="o">,</span> <span class="n">BigDecimal</span> <span class="n">price</span><span class="o">,</span> <span class="n">String</span> <span class="n">condition</span><span class="o">,</span> <span class="n">String</span> <span class="n">description</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="k">this</span><span class="o">.</span><span class="na">brand</span> <span class="o">=</span> <span class="n">brand</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> <span class="k">this</span><span class="o">.</span><span class="na">model</span> <span class="o">=</span> <span class="n">model</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> <span class="k">this</span><span class="o">.</span><span class="na">price</span> <span class="o">=</span> <span class="n">price</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> <span class="k">this</span><span class="o">.</span><span class="na">condition</span> <span class="o">=</span> <span class="n">condition</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> <span class="k">this</span><span class="o">.</span><span class="na">description</span> <span class="o">=</span> <span class="n">description</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> <span class="o">}</span> </span></span><span class="line"><span class="cl"><span class="o">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kd">public</span> <span class="kd">class</span> <span class="nc">SearchQuickstartExample</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kd">public</span> <span class="kt">void</span> <span class="nf">run</span><span class="o">()</span> <span class="o">{</span> </span></span><span class="line hl"><span class="cl"> <span class="c1">// UnifiedJedis jedis = new UnifiedJedis("redis://localhost:6379"); </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> <span class="n">JedisPooled</span> <span class="n">jedis</span> <span class="o">=</span> <span class="k">new</span> <span class="n">JedisPooled</span><span class="o">(</span><span class="s">"localhost"</span><span class="o">,</span> <span class="mi">6379</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">SchemaField</span><span class="o">[]</span> <span class="n">schema</span> <span class="o">=</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.brand"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"brand"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.model"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"model"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.description"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"description"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.price"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"price"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.condition"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"condition"</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">};</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">ftCreate</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTCreateParams</span><span class="o">.</span><span class="na">createParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">on</span><span class="o">(</span><span class="n">IndexDataType</span><span class="o">.</span><span class="na">JSON</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">addPrefix</span><span class="o">(</span><span class="s">"bicycle:"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">schema</span> </span></span><span class="line"><span class="cl"> <span class="o">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">Bicycle</span><span class="o">[]</span> <span class="n">bicycles</span> <span class="o">=</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Bicycle</span><span class="o">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"Velorim"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"Jigger"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">BigDecimal</span><span class="o">(</span><span class="mi">270</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="s">"new"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"Small and powerful, the Jigger is the best ride "</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"for the smallest of tikes! This is the tiniest "</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"kids’ pedal bike on the market available without"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" a coaster brake, the Jigger is the vehicle of "</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"choice for the rare tenacious little rider "</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"raring to go."</span> </span></span><span class="line"><span class="cl"> <span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Bicycle</span><span class="o">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"Bicyk"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"Hillcraft"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">BigDecimal</span><span class="o">(</span><span class="mi">1200</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="s">"used"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"Kids want to ride with as little weight as possible."</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Especially on an incline! They may be at the age "</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"when a 27.5 inch wheel bike is just too clumsy coming "</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"off a 24 inch bike. The Hillcraft 26 is just the solution"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" they need!"</span> </span></span><span class="line"><span class="cl"> <span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Bicycle</span><span class="o">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"Nord"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"Chook air 5"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">BigDecimal</span><span class="o">(</span><span class="mi">815</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="s">"used"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"The Chook Air 5 gives kids aged six years and older "</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"a durable and uberlight mountain bike for their first"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" experience on tracks and easy cruising through forests"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and fields. The lower top tube makes it easy to mount"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and dismount in any situation, giving your kids greater"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" safety on the trails."</span> </span></span><span class="line"><span class="cl"> <span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Bicycle</span><span class="o">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"Eva"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"Eva 291"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">BigDecimal</span><span class="o">(</span><span class="mi">3400</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="s">"used"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"The sister company to Nord, Eva launched in 2005 as the"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" first and only women-dedicated bicycle brand. Designed"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" by women for women, allEva bikes are optimized for the"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" feminine physique using analytics from a body metrics"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" database. If you like 29ers, try the Eva 291. It's a "</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"brand new bike for 2022.. This full-suspension, "</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"cross-country ride has been designed for velocity. The"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" 291 has 100mm of front and rear travel, a superlight "</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"aluminum frame and fast-rolling 29-inch wheels. Yippee!"</span> </span></span><span class="line"><span class="cl"> <span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Bicycle</span><span class="o">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"Noka Bikes"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"Kahuna"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">BigDecimal</span><span class="o">(</span><span class="mi">3200</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="s">"used"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"Whether you want to try your hand at XC racing or are "</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"looking for a lively trail bike that's just as inspiring"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" on the climbs as it is over rougher ground, the Wilder"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" is one heck of a bike built specifically for short women."</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Both the frames and components have been tweaked to "</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"include a women’s saddle, different bars and unique "</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"colourway."</span> </span></span><span class="line"><span class="cl"> <span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Bicycle</span><span class="o">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"Breakout"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"XBN 2.1 Alloy"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">BigDecimal</span><span class="o">(</span><span class="mi">810</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="s">"new"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"The XBN 2.1 Alloy is our entry-level road bike – but that’s"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" not to say that it’s a basic machine. With an internal "</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"weld aluminium frame, a full carbon fork, and the slick-shifting"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Claris gears from Shimano’s, this is a bike which doesn’t"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" break the bank and delivers craved performance."</span> </span></span><span class="line"><span class="cl"> <span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Bicycle</span><span class="o">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"ScramBikes"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"WattBike"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">BigDecimal</span><span class="o">(</span><span class="mi">2300</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="s">"new"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"The WattBike is the best e-bike for people who still feel young"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" at heart. It has a Bafang 1000W mid-drive system and a 48V"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" 17.5AH Samsung Lithium-Ion battery, allowing you to ride for"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" more than 60 miles on one charge. It’s great for tackling hilly"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" terrain or if you just fancy a more leisurely ride. With three"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" working modes, you can choose between E-bike, assisted bicycle,"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and normal bike modes."</span> </span></span><span class="line"><span class="cl"> <span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Bicycle</span><span class="o">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"Peaknetic"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"Secto"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">BigDecimal</span><span class="o">(</span><span class="mi">430</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="s">"new"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"If you struggle with stiff fingers or a kinked neck or back after"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" a few minutes on the road, this lightweight, aluminum bike"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" alleviates those issues and allows you to enjoy the ride. From"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" the ergonomic grips to the lumbar-supporting seat position, the"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Roll Low-Entry offers incredible comfort. The rear-inclined seat"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" tube facilitates stability by allowing you to put a foot on the"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" ground to balance at a stop, and the low step-over frame makes it"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" accessible for all ability and mobility levels. The saddle is"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" very soft, with a wide back to support your hip joints and a"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" cutout in the center to redistribute that pressure. Rim brakes"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" deliver satisfactory braking control, and the wide tires provide"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" a smooth, stable ride on paved roads and gravel. Rack and fender"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" mounts facilitate setting up the Roll Low-Entry as your preferred"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" commuter, and the BMX-like handlebar offers space for mounting a"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" flashlight, bell, or phone holder."</span> </span></span><span class="line"><span class="cl"> <span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Bicycle</span><span class="o">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"nHill"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"Summit"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">BigDecimal</span><span class="o">(</span><span class="mi">1200</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="s">"new"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"This budget mountain bike from nHill performs well both on bike"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" paths and on the trail. The fork with 100mm of travel absorbs"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" rough terrain. Fat Kenda Booster tires give you grip in corners"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and on wet trails. The Shimano Tourney drivetrain offered enough"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" gears for finding a comfortable pace to ride uphill, and the"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Tektro hydraulic disc brakes break smoothly. Whether you want an"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" affordable bike that you can take to work, but also take trail in"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" mountains on the weekends or you’re just after a stable,"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" comfortable ride for the bike path, the Summit gives a good value"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" for money."</span> </span></span><span class="line"><span class="cl"> <span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Bicycle</span><span class="o">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"ThrillCycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"BikeShind"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">BigDecimal</span><span class="o">(</span><span class="mi">815</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="s">"refurbished"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"An artsy, retro-inspired bicycle that’s as functional as it is"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" pretty: The ThrillCycle steel frame offers a smooth ride. A"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" 9-speed drivetrain has enough gears for coasting in the city, but"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" we wouldn’t suggest taking it to the mountains. Fenders protect"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" you from mud, and a rear basket lets you transport groceries,"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" flowers and books. The ThrillCycle comes with a limited lifetime"</span> <span class="o">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" warranty, so this little guy will last you long past graduation."</span> </span></span><span class="line"><span class="cl"> <span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="o">};</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">bicycles</span><span class="o">.</span><span class="na">length</span><span class="o">;</span> <span class="n">i</span><span class="o">++)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">jsonSetWithEscape</span><span class="o">(</span><span class="n">String</span><span class="o">.</span><span class="na">format</span><span class="o">(</span><span class="s">"bicycle:%d"</span><span class="o">,</span> <span class="n">i</span><span class="o">),</span> <span class="n">bicycles</span><span class="o">[</span><span class="n">i</span><span class="o">]);</span> </span></span><span class="line"><span class="cl"> <span class="o">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">Query</span> <span class="n">query1</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Query</span><span class="o">(</span><span class="s">"*"</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">result1</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> <span class="n">query1</span><span class="o">).</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Documents found:"</span> <span class="o">+</span> <span class="n">result1</span><span class="o">.</span><span class="na">size</span><span class="o">());</span> </span></span><span class="line"><span class="cl"> <span class="c1">// Prints: Documents found: 10 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span> <span class="n">query2</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Query</span><span class="o">(</span><span class="s">"@model:Jigger"</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">result2</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> <span class="n">query2</span><span class="o">).</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">result2</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> <span class="c1">// Prints: [id:bicycle:0, score: 1.0, payload:null, </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// properties:[$={"brand":"Velorim","model":"Jigger","price":270,"description":"Small and powerful, the Jigger is the best ride for the smallest of tikes! This is the tiniest kids’ pedal bike on the market available without a coaster brake, the Jigger is the vehicle of choice for the rare tenacious little rider raring to go.","condition":"new"}]] </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span> <span class="n">query3</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Query</span><span class="o">(</span><span class="s">"@model:Jigger"</span><span class="o">).</span><span class="na">returnFields</span><span class="o">(</span><span class="s">"price"</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">result3</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> <span class="n">query3</span><span class="o">).</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">result3</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> <span class="c1">// Prints: [id:bicycle:0, score: 1.0, payload:null, properties:[price=270]] </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span> <span class="n">query4</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Query</span><span class="o">(</span><span class="s">"basic @price:[500 1000]"</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">result4</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> <span class="n">query4</span><span class="o">).</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">result4</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> <span class="c1">// Prints: [id:bicycle:5, score: 1.0, payload:null, </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// properties:[$={"brand":"Breakout","model":"XBN 2.1 Alloy","price":810,"description":"The XBN 2.1 Alloy is our entry-level road bike – but that’s not to say that it’s a basic machine. With an internal weld aluminium frame, a full carbon fork, and the slick-shifting Claris gears from Shimano’s, this is a bike which doesn’t break the bank and delivers craved performance.","condition":"new"}]] </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span> <span class="n">query5</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Query</span><span class="o">(</span><span class="s">"@brand:\"Noka Bikes\""</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">result5</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> <span class="n">query5</span><span class="o">).</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">result5</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> <span class="c1">// Prints: [id:bicycle:4, score: 1.0, payload:null, </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// properties:[$={"brand":"Noka Bikes","model":"Kahuna","price":3200,"description":"Whether you want to try your hand at XC racing or are looking for a lively trail bike that's just as inspiring on the climbs as it is over rougher ground, the Wilder is one heck of a bike built specifically for short women. Both the frames and components have been tweaked to include a women’s saddle, different bars and unique colourway.","condition":"used"}]] </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">AggregationBuilder</span> <span class="n">ab</span> <span class="o">=</span> <span class="k">new</span> <span class="n">AggregationBuilder</span><span class="o">(</span><span class="s">"*"</span><span class="o">).</span><span class="na">groupBy</span><span class="o">(</span><span class="s">"@condition"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Reducers</span><span class="o">.</span><span class="na">count</span><span class="o">().</span><span class="na">as</span><span class="o">(</span><span class="s">"count"</span><span class="o">));</span> </span></span><span class="line"><span class="cl"> <span class="n">AggregationResult</span> <span class="n">ar</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftAggregate</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> <span class="n">ab</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">ar</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">();</span> <span class="n">i</span><span class="o">++)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">ar</span><span class="o">.</span><span class="na">getRow</span><span class="o">(</span><span class="n">i</span><span class="o">).</span><span class="na">getString</span><span class="o">(</span><span class="s">"condition"</span><span class="o">)</span> <span class="o">+</span> <span class="s">" - "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="n">ar</span><span class="o">.</span><span class="na">getRow</span><span class="o">(</span><span class="n">i</span><span class="o">).</span><span class="na">getString</span><span class="o">(</span><span class="s">"count"</span><span class="o">));</span> </span></span><span class="line"><span class="cl"> <span class="o">}</span> </span></span><span class="line"><span class="cl"> <span class="c1">// Prints: </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// refurbished - 1 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// used - 5 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// new - 4 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="n">assertEquals</span><span class="o">(</span><span class="s">"Validate aggregation results"</span><span class="o">,</span> <span class="mi">3</span><span class="o">,</span> <span class="n">ar</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">close</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> <span class="o">}</span> </span></span><span class="line"><span class="cl"><span class="o">}</span></span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Java_search_quickstart-stepconnect')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Java_search_quickstart-stepconnect" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/java/jedis/" tabindex="1" title="Quick-Start"> Java Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/jedis/tree/master/src/test/java/io/redis/examples/SearchQuickstartExample.java" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="dotnet" id="Csharp_search_quickstart-stepconnect" name="search_quickstart-stepconnect" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Csharp_search_quickstart-stepconnect" title="Open example"> C# </label> <div aria-labelledby="tab-search_quickstart-stepconnect" class="panel order-last hidden w-full mt-0 relative" id="panel_Csharp_search_quickstart-stepconnect" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-C#" data-lang="C#"><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.RedisStackCommands</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.Search</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.Search.Aggregation</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.Search.Literals.Enums</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.Tests</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">StackExchange.Redis</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">public</span> <span class="k">class</span> <span class="nc">SearchQuickstartExample</span> </span></span><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="k">public</span> <span class="k">void</span> <span class="n">run</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="kt">var</span> <span class="n">redis</span> <span class="p">=</span> <span class="n">ConnectionMultiplexer</span><span class="p">.</span><span class="n">Connect</span><span class="p">(</span><span class="s">"localhost:6379"</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"> <span class="kt">var</span> <span class="n">db</span> <span class="p">=</span> <span class="n">redis</span><span class="p">.</span><span class="n">GetDatabase</span><span class="p">();</span> </span></span><span class="line hl"><span class="cl"> <span class="kt">var</span> <span class="n">ft</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">FT</span><span class="p">();</span> </span></span><span class="line hl"><span class="cl"> <span class="kt">var</span> <span class="n">json</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">JSON</span><span class="p">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">bike1</span> <span class="p">=</span> <span class="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">Brand</span> <span class="p">=</span> <span class="s">"Velorim"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Model</span> <span class="p">=</span> <span class="s">"Jigger"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Price</span> <span class="p">=</span> <span class="m">270</span><span class="n">M</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Description</span> <span class="p">=</span> <span class="s">"Small and powerful, the Jigger is the best ride "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"for the smallest of tikes! This is the tiniest "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"kids’ pedal bike on the market available without"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" a coaster brake, the Jigger is the vehicle of "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"choice for the rare tenacious little rider "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"raring to go."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Condition</span> <span class="p">=</span> <span class="s">"used"</span> </span></span><span class="line"><span class="cl"> <span class="p">};</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">bicycles</span> <span class="p">=</span> <span class="k">new</span> <span class="kt">object</span><span class="p">[]</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">bike1</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">Brand</span> <span class="p">=</span> <span class="s">"Bicyk"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Model</span> <span class="p">=</span> <span class="s">"Hillcraft"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Price</span> <span class="p">=</span> <span class="m">1200</span><span class="n">M</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Description</span> <span class="p">=</span> <span class="s">"Kids want to ride with as little weight as possible."</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Especially on an incline! They may be at the age "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"when a 27.5 inch wheel bike is just too clumsy coming "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"off a 24 inch bike. The Hillcraft 26 is just the solution"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" they need!"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Condition</span> <span class="p">=</span> <span class="s">"used"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">Brand</span> <span class="p">=</span> <span class="s">"Nord"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Model</span> <span class="p">=</span> <span class="s">"Chook air 5"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Price</span> <span class="p">=</span> <span class="m">815</span><span class="n">M</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Description</span> <span class="p">=</span> <span class="s">"The Chook Air 5 gives kids aged six years and older "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"a durable and uberlight mountain bike for their first"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" experience on tracks and easy cruising through forests"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and fields. The lower top tube makes it easy to mount"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and dismount in any situation, giving your kids greater"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" safety on the trails."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Condition</span> <span class="p">=</span> <span class="s">"used"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">Brand</span> <span class="p">=</span> <span class="s">"Eva"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Model</span> <span class="p">=</span> <span class="s">"Eva 291"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Price</span> <span class="p">=</span> <span class="m">3400</span><span class="n">M</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Description</span> <span class="p">=</span> <span class="s">"The sister company to Nord, Eva launched in 2005 as the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" first and only women-dedicated bicycle brand. Designed"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" by women for women, allEva bikes are optimized for the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" feminine physique using analytics from a body metrics"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" database. If you like 29ers, try the Eva 291. It’s a "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"brand new bike for 2022.. This full-suspension, "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"cross-country ride has been designed for velocity. The"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" 291 has 100mm of front and rear travel, a superlight "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"aluminum frame and fast-rolling 29-inch wheels. Yippee!"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Condition</span> <span class="p">=</span> <span class="s">"used"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">Brand</span> <span class="p">=</span> <span class="s">"Noka Bikes"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Model</span> <span class="p">=</span> <span class="s">"Kahuna"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Price</span> <span class="p">=</span> <span class="m">3200</span><span class="n">M</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Description</span> <span class="p">=</span> <span class="s">"Whether you want to try your hand at XC racing or are "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"looking for a lively trail bike that's just as inspiring"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" on the climbs as it is over rougher ground, the Wilder"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" is one heck of a bike built specifically for short women."</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Both the frames and components have been tweaked to "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"include a women’s saddle, different bars and unique "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"colourway."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Condition</span> <span class="p">=</span> <span class="s">"used"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">Brand</span> <span class="p">=</span> <span class="s">"Breakout"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Model</span> <span class="p">=</span> <span class="s">"XBN 2.1 Alloy"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Price</span> <span class="p">=</span> <span class="m">810</span><span class="n">M</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Description</span> <span class="p">=</span> <span class="s">"The XBN 2.1 Alloy is our entry-level road bike – but that’s"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" not to say that it’s a basic machine. With an internal "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"weld aluminium frame, a full carbon fork, and the slick-shifting"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Claris gears from Shimano’s, this is a bike which doesn’t"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" break the bank and delivers craved performance."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Condition</span> <span class="p">=</span> <span class="s">"new"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">Brand</span> <span class="p">=</span> <span class="s">"ScramBikes"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Model</span> <span class="p">=</span> <span class="s">"WattBike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Price</span> <span class="p">=</span> <span class="m">2300</span><span class="n">M</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Description</span> <span class="p">=</span> <span class="s">"The WattBike is the best e-bike for people who still feel young"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" at heart. It has a Bafang 1000W mid-drive system and a 48V"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" 17.5AH Samsung Lithium-Ion battery, allowing you to ride for"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" more than 60 miles on one charge. It’s great for tackling hilly"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" terrain or if you just fancy a more leisurely ride. With three"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" working modes, you can choose between E-bike, assisted bicycle,"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and normal bike modes."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Condition</span> <span class="p">=</span> <span class="s">"new"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">Brand</span> <span class="p">=</span> <span class="s">"Peaknetic"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Model</span> <span class="p">=</span> <span class="s">"Secto"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Price</span> <span class="p">=</span> <span class="m">430</span><span class="n">M</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Description</span> <span class="p">=</span> <span class="s">"If you struggle with stiff fingers or a kinked neck or back after"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" a few minutes on the road, this lightweight, aluminum bike"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" alleviates those issues and allows you to enjoy the ride. From"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" the ergonomic grips to the lumbar-supporting seat position, the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Roll Low-Entry offers incredible comfort. The rear-inclined seat"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" tube facilitates stability by allowing you to put a foot on the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" ground to balance at a stop, and the low step-over frame makes it"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" accessible for all ability and mobility levels. The saddle is"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" very soft, with a wide back to support your hip joints and a"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" cutout in the center to redistribute that pressure. Rim brakes"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" deliver satisfactory braking control, and the wide tires provide"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" a smooth, stable ride on paved roads and gravel. Rack and fender"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" mounts facilitate setting up the Roll Low-Entry as your preferred"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" commuter, and the BMX-like handlebar offers space for mounting a"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" flashlight, bell, or phone holder."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Condition</span> <span class="p">=</span> <span class="s">"new"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">Brand</span> <span class="p">=</span> <span class="s">"nHill"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Model</span> <span class="p">=</span> <span class="s">"Summit"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Price</span> <span class="p">=</span> <span class="m">1200</span><span class="n">M</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Description</span> <span class="p">=</span> <span class="s">"This budget mountain bike from nHill performs well both on bike"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" paths and on the trail. The fork with 100mm of travel absorbs"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" rough terrain. Fat Kenda Booster tires give you grip in corners"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and on wet trails. The Shimano Tourney drivetrain offered enough"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" gears for finding a comfortable pace to ride uphill, and the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Tektro hydraulic disc brakes break smoothly. Whether you want an"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" affordable bike that you can take to work, but also take trail in"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" mountains on the weekends or you’re just after a stable,"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" comfortable ride for the bike path, the Summit gives a good value"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" for money."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Condition</span> <span class="p">=</span> <span class="s">"new"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">Model</span> <span class="p">=</span> <span class="s">"ThrillCycle"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Brand</span> <span class="p">=</span> <span class="s">"BikeShind"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Price</span> <span class="p">=</span> <span class="m">815</span><span class="n">M</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Description</span> <span class="p">=</span> <span class="s">"An artsy, retro-inspired bicycle that’s as functional as it is"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" pretty: The ThrillCycle steel frame offers a smooth ride. A"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" 9-speed drivetrain has enough gears for coasting in the city, but"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" we wouldn’t suggest taking it to the mountains. Fenders protect"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" you from mud, and a rear basket lets you transport groceries,"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" flowers and books. The ThrillCycle comes with a limited lifetime"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" warranty, so this little guy will last you long past graduation."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">Condition</span> <span class="p">=</span> <span class="s">"refurbished"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">};</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">schema</span> <span class="p">=</span> <span class="k">new</span> <span class="n">Schema</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">AddTextField</span><span class="p">(</span><span class="k">new</span> <span class="n">FieldName</span><span class="p">(</span><span class="s">"$.Brand"</span><span class="p">,</span> <span class="s">"Brand"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">AddTextField</span><span class="p">(</span><span class="k">new</span> <span class="n">FieldName</span><span class="p">(</span><span class="s">"$.Model"</span><span class="p">,</span> <span class="s">"Model"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">AddTextField</span><span class="p">(</span><span class="k">new</span> <span class="n">FieldName</span><span class="p">(</span><span class="s">"$.Description"</span><span class="p">,</span> <span class="s">"Description"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">AddNumericField</span><span class="p">(</span><span class="k">new</span> <span class="n">FieldName</span><span class="p">(</span><span class="s">"$.Price"</span><span class="p">,</span> <span class="s">"Price"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">AddTagField</span><span class="p">(</span><span class="k">new</span> <span class="n">FieldName</span><span class="p">(</span><span class="s">"$.Condition"</span><span class="p">,</span> <span class="s">"Condition"</span><span class="p">));</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">ft</span><span class="p">.</span><span class="n">Create</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"idx:bicycle"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">FTCreateParams</span><span class="p">().</span><span class="n">On</span><span class="p">(</span><span class="n">IndexDataType</span><span class="p">.</span><span class="n">JSON</span><span class="p">).</span><span class="n">Prefix</span><span class="p">(</span><span class="s">"bicycle:"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">schema</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="p">(</span><span class="kt">int</span> <span class="n">i</span> <span class="p">=</span> <span class="m">0</span><span class="p">;</span> <span class="n">i</span> <span class="p">&lt;</span> <span class="n">bicycles</span><span class="p">.</span><span class="n">Length</span><span class="p">;</span> <span class="n">i</span><span class="p">++)</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">json</span><span class="p">.</span><span class="n">Set</span><span class="p">(</span><span class="s">$"bicycle:{i}"</span><span class="p">,</span> <span class="s">"$"</span><span class="p">,</span> <span class="n">bicycles</span><span class="p">[</span><span class="n">i</span><span class="p">]);</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">query1</span> <span class="p">=</span> <span class="k">new</span> <span class="n">Query</span><span class="p">(</span><span class="s">"*"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">res1</span> <span class="p">=</span> <span class="n">ft</span><span class="p">.</span><span class="n">Search</span><span class="p">(</span><span class="s">"idx:bicycle"</span><span class="p">,</span> <span class="n">query1</span><span class="p">).</span><span class="n">Documents</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="kt">string</span><span class="p">.</span><span class="n">Join</span><span class="p">(</span><span class="s">"\n"</span><span class="p">,</span> <span class="n">res1</span><span class="p">.</span><span class="n">Count</span><span class="p">()));</span> </span></span><span class="line"><span class="cl"> <span class="c1">// Prints: Documents found: 10</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">query2</span> <span class="p">=</span> <span class="k">new</span> <span class="n">Query</span><span class="p">(</span><span class="s">"@Model:Jigger"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">res2</span> <span class="p">=</span> <span class="n">ft</span><span class="p">.</span><span class="n">Search</span><span class="p">(</span><span class="s">"idx:bicycle"</span><span class="p">,</span> <span class="n">query2</span><span class="p">).</span><span class="n">Documents</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="kt">string</span><span class="p">.</span><span class="n">Join</span><span class="p">(</span><span class="s">"\n"</span><span class="p">,</span> <span class="n">res2</span><span class="p">.</span><span class="n">Select</span><span class="p">(</span><span class="n">x</span> <span class="p">=&gt;</span> <span class="n">x</span><span class="p">[</span><span class="s">"json"</span><span class="p">])));</span> </span></span><span class="line"><span class="cl"> <span class="c1">// Prints: {"Brand":"Moore PLC","Model":"Award Race","Price":3790.76,</span> </span></span><span class="line"><span class="cl"> <span class="c1">// "Description":"This olive folding bike features a carbon frame</span> </span></span><span class="line"><span class="cl"> <span class="c1">// and 27.5 inch wheels. This folding bike is perfect for compact</span> </span></span><span class="line"><span class="cl"> <span class="c1">// storage and transportation.","Condition":"new"}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">query3</span> <span class="p">=</span> <span class="k">new</span> <span class="n">Query</span><span class="p">(</span><span class="s">"basic @Price:[500 1000]"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">res3</span> <span class="p">=</span> <span class="n">ft</span><span class="p">.</span><span class="n">Search</span><span class="p">(</span><span class="s">"idx:bicycle"</span><span class="p">,</span> <span class="n">query3</span><span class="p">).</span><span class="n">Documents</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="kt">string</span><span class="p">.</span><span class="n">Join</span><span class="p">(</span><span class="s">"\n"</span><span class="p">,</span> <span class="n">res3</span><span class="p">.</span><span class="n">Select</span><span class="p">(</span><span class="n">x</span> <span class="p">=&gt;</span> <span class="n">x</span><span class="p">[</span><span class="s">"json"</span><span class="p">])));</span> </span></span><span class="line"><span class="cl"> <span class="c1">// Prints: {"Brand":"Moore PLC","Model":"Award Race","Price":3790.76,</span> </span></span><span class="line"><span class="cl"> <span class="c1">// "Description":"This olive folding bike features a carbon frame</span> </span></span><span class="line"><span class="cl"> <span class="c1">// and 27.5 inch wheels. This folding bike is perfect for compact</span> </span></span><span class="line"><span class="cl"> <span class="c1">// storage and transportation.","Condition":"new"}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">query4</span> <span class="p">=</span> <span class="k">new</span> <span class="n">Query</span><span class="p">(</span><span class="s">"@Brand:\"Noka Bikes\""</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">res4</span> <span class="p">=</span> <span class="n">ft</span><span class="p">.</span><span class="n">Search</span><span class="p">(</span><span class="s">"idx:bicycle"</span><span class="p">,</span> <span class="n">query4</span><span class="p">).</span><span class="n">Documents</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="kt">string</span><span class="p">.</span><span class="n">Join</span><span class="p">(</span><span class="s">"\n"</span><span class="p">,</span> <span class="n">res4</span><span class="p">.</span><span class="n">Select</span><span class="p">(</span><span class="n">x</span> <span class="p">=&gt;</span> <span class="n">x</span><span class="p">[</span><span class="s">"json"</span><span class="p">])));</span> </span></span><span class="line"><span class="cl"> <span class="c1">// Prints: {"Brand":"Moore PLC","Model":"Award Race","Price":3790.76,</span> </span></span><span class="line"><span class="cl"> <span class="c1">// "Description":"This olive folding bike features a carbon frame</span> </span></span><span class="line"><span class="cl"> <span class="c1">// and 27.5 inch wheels. This folding bike is perfect for compact</span> </span></span><span class="line"><span class="cl"> <span class="c1">// storage and transportation.","Condition":"new"}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">query5</span> <span class="p">=</span> <span class="k">new</span> <span class="n">Query</span><span class="p">(</span><span class="s">"@Model:Jigger"</span><span class="p">).</span><span class="n">ReturnFields</span><span class="p">(</span><span class="s">"Price"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">res5</span> <span class="p">=</span> <span class="n">ft</span><span class="p">.</span><span class="n">Search</span><span class="p">(</span><span class="s">"idx:bicycle"</span><span class="p">,</span> <span class="n">query5</span><span class="p">).</span><span class="n">Documents</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">res5</span><span class="p">.</span><span class="n">First</span><span class="p">()[</span><span class="s">"Price"</span><span class="p">]);</span> </span></span><span class="line"><span class="cl"> <span class="c1">// Prints: 270</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">request</span> <span class="p">=</span> <span class="k">new</span> <span class="n">AggregationRequest</span><span class="p">(</span><span class="s">"*"</span><span class="p">).</span><span class="n">GroupBy</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"@Condition"</span><span class="p">,</span> <span class="n">Reducers</span><span class="p">.</span><span class="n">Count</span><span class="p">().</span><span class="n">As</span><span class="p">(</span><span class="s">"Count"</span><span class="p">));</span> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">result</span> <span class="p">=</span> <span class="n">ft</span><span class="p">.</span><span class="n">Aggregate</span><span class="p">(</span><span class="s">"idx:bicycle"</span><span class="p">,</span> <span class="n">request</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="p">(</span><span class="kt">var</span> <span class="n">i</span> <span class="p">=</span> <span class="m">0</span><span class="p">;</span> <span class="n">i</span> <span class="p">&lt;</span> <span class="n">result</span><span class="p">.</span><span class="n">TotalResults</span><span class="p">;</span> <span class="n">i</span><span class="p">++)</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">row</span> <span class="p">=</span> <span class="n">result</span><span class="p">.</span><span class="n">GetRow</span><span class="p">(</span><span class="n">i</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">$"{row["</span><span class="n">Condition</span><span class="s">"]} - {row["</span><span class="n">Count</span><span class="s">"]}"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Prints:</span> </span></span><span class="line"><span class="cl"> <span class="c1">// refurbished - 1</span> </span></span><span class="line"><span class="cl"> <span class="c1">// used - 5</span> </span></span><span class="line"><span class="cl"> <span class="c1">// new - 4</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Csharp_search_quickstart-stepconnect')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Csharp_search_quickstart-stepconnect" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/dotnet/" tabindex="1" title="Quick-Start"> C# Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/NRedisStack/tree/master/tests/Doc/SearchQuickstartExample.cs" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> </div> <br/> <p> </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Tip: </div> You can copy and paste the connection details from the Redis Cloud database configuration page. Here is an example connection string of a Cloud database that is hosted in the AWS region <code> us-east-1 </code> and listens on port 16379: <code> redis-16379.c283.us-east-1-4.ec2.cloud.redislabs.com:16379 </code> . The connection string has the format <code> host:port </code> . You must also copy and paste the username and password of your Cloud database and then either pass the credentials to your client or use the <a href="/docs/latest/commands/auth/"> AUTH command </a> after the connection is established. </div> </div> <h2 id="store-and-retrieve-data"> Store and retrieve data </h2> <p> Redis stands for Remote Dictionary Server. You can use the same data types as in your local programming environment but on the server side within Redis. </p> <p> Similar to byte arrays, Redis strings store sequences of bytes, including text, serialized objects, counter values, and binary arrays. The following example shows you how to set and get a string value: </p> <div class="codetabs cli group flex justify-start items-center flex-wrap box-border rounded-lg mt-0 mb-0 mx-auto bg-slate-900" id="set_and_get-step"> <input checked="" class="radiotab w-0 h-0" data-lang="redis-cli" id="redis-cli_set_and_get-step" name="set_and_get-step" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="redis-cli_set_and_get-step" title="Open example"> &gt;_ Redis CLI </label> <div aria-labelledby="tab-set_and_get-step" class="panel order-last hidden w-full mt-0 relative" id="panel_redis-cli_set_and_get-step" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-plaintext" data-lang="plaintext"><span class="line hl"><span class="cl">SET bike:1 "Process 134" </span></span><span class="line hl"><span class="cl">GET bike:1</span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_redis-cli_set_and_get-step')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <div class="flex-1 text-xs text-white overflow-ellipsis"> Are you tired of using redis-cli? Try Redis Insight - the developer GUI for Redis. </div> <div class="text-right"> <a class="rounded rounded-mx px-2 py-1 flex items-center text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.com/redis-enterprise/redis-insight/" tabindex="1" title="Get Redis Insight"> <svg class="w-4 h-4 mr-1" fill="none" height="14" viewbox="0 0 14 14" width="14" xmlns="http://www.w3.org/2000/svg"> <path d="M2.26236 5.66895L1.21732 6.07172L7.00018 8.65693V7.79842L2.26236 5.66895Z" fill="#fca5a5"> </path> <path d="M2.26236 8.02271L1.21732 8.42548L7.00018 11.0119V10.1516L2.26236 8.02271Z" fill="#fca5a5"> </path> <path d="M1.21732 3.7175L7.00018 6.30392V2.87805L8.66273 2.13423L7.00018 1.49512L1.21732 3.7175Z" fill="#fca5a5"> </path> <path d="M7.00018 2.8781V6.30366L1.21732 3.71724V5.20004L7.00018 7.79705V8.65526L1.21732 6.07217V7.55496L7.00018 10.1553V11.0135L1.21732 8.42376V9.90656H1.18878L7.00018 12.5051L8.66273 11.7613V2.13428L7.00018 2.8781Z" fill="#f87171"> </path> <path d="M9.07336 11.5777L10.7359 10.8338V4.01538L9.07336 4.7592V11.5777Z" fill="#f87171"> </path> <path d="M9.07336 4.75867L10.7359 4.01485L9.07336 3.37573V4.75867Z" fill="#fca5a5"> </path> <path d="M11.1481 10.6497L12.8112 9.90591V5.896L11.1487 6.63982L11.1481 10.6497Z" fill="#f87171"> </path> <path d="M11.1481 6.63954L12.8112 5.89572L11.1481 5.25781V6.63954Z" fill="#fca5a5"> </path> </svg> <span> Get Redis Insight </span> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="python" id="Python_set_and_get-step" name="set_and_get-step" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Python_set_and_get-step" title="Open example"> Python </label> <div aria-labelledby="tab-set_and_get-step" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_set_and_get-step" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2">Code samples for data structure store quickstart pages: </span></span></span><span class="line"><span class="cl"><span class="s2"> https://redis.io/docs/latest/develop/get-started/data-store/ </span></span></span><span class="line"><span class="cl"><span class="s2">"""</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">r</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">Redis</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s2">"localhost"</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">6379</span><span class="p">,</span> <span class="n">db</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"bike:1"</span><span class="p">,</span> <span class="s2">"Process 134"</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt; True</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bike:1"</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt; "Process 134"</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Python_set_and_get-step')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Python_set_and_get-step" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/python/redis-py/" tabindex="1" title="Quick-Start"> Python Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/redis-py/tree/master/doctests/string_set_get.py" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="javascript" id="Nodejs_set_and_get-step" name="set_and_get-step" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Nodejs_set_and_get-step" title="Open example"> Node.js </label> <div aria-labelledby="tab-set_and_get-step" class="panel order-last hidden w-full mt-0 relative" id="panel_Nodejs_set_and_get-step" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-javascript" data-lang="javascript"><span class="line hl"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="p">{</span> <span class="nx">createClient</span> <span class="p">}</span> <span class="nx">from</span> <span class="s1">'redis'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">client</span> <span class="o">=</span> <span class="nx">createClient</span><span class="p">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="nx">client</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">'error'</span><span class="p">,</span> <span class="nx">err</span> <span class="p">=&gt;</span> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">'Redis Client Error'</span><span class="p">,</span> <span class="nx">err</span><span class="p">));</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">connect</span><span class="p">().</span><span class="k">catch</span><span class="p">(</span><span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">'bike:1'</span><span class="p">,</span> <span class="s1">'Process 134'</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">value</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">'bike:1'</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">value</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"><span class="c1">// returns 'Process 134' </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">quit</span><span class="p">();</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Nodejs_set_and_get-step')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Nodejs_set_and_get-step" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/nodejs/" tabindex="1" title="Quick-Start"> Node.js Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/node-redis/tree/emb-examples/doctests/string-set-get-example.js" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="java" id="Java_set_and_get-step" name="set_and_get-step" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Java_set_and_get-step" title="Open example"> Java </label> <div aria-labelledby="tab-set_and_get-step" class="panel order-last hidden w-full mt-0 relative" id="panel_Java_set_and_get-step" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="kn">package</span> <span class="nn">io.redis.examples</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.UnifiedJedis</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kd">public</span> <span class="kd">class</span> <span class="nc">SetGetExample</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kd">public</span> <span class="kt">void</span> <span class="nf">run</span><span class="o">()</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">UnifiedJedis</span> <span class="n">jedis</span> <span class="o">=</span> <span class="k">new</span> <span class="n">UnifiedJedis</span><span class="o">(</span><span class="s">"redis://localhost:6379"</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="n">String</span> <span class="n">status</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">set</span><span class="o">(</span><span class="s">"bike:1"</span><span class="o">,</span> <span class="s">"Process 134"</span><span class="o">);</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">if</span> <span class="o">(</span><span class="s">"OK"</span><span class="o">.</span><span class="na">equals</span><span class="o">(</span><span class="n">status</span><span class="o">))</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Successfully added a bike."</span><span class="o">);</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="n">String</span> <span class="n">value</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"bike:1"</span><span class="o">);</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">if</span> <span class="o">(</span><span class="n">value</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"The name of the bike is: "</span> <span class="o">+</span> <span class="n">value</span> <span class="o">+</span> <span class="s">"."</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="o">}</span> </span></span><span class="line"><span class="cl"><span class="o">}</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Java_set_and_get-step')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Java_set_and_get-step" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/java/jedis/" tabindex="1" title="Quick-Start"> Java Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/jedis/tree/master/src/test/java/io/redis/examples/SetGetExample.java" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="go" id="Go_set_and_get-step" name="set_and_get-step" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Go_set_and_get-step" title="Open example"> Go </label> <div aria-labelledby="tab-set_and_get-step" class="panel order-last hidden w-full mt-0 relative" id="panel_Go_set_and_get-step" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="kn">package</span> <span class="nx">example_commands_test</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"context"</span> </span></span><span class="line"><span class="cl"> <span class="s">"fmt"</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">"github.com/redis/go-redis/v9"</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kd">func</span> <span class="nf">ExampleClient_Set_and_get</span><span class="p">()</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">ctx</span> <span class="o">:=</span> <span class="nx">context</span><span class="p">.</span><span class="nf">Background</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">rdb</span> <span class="o">:=</span> <span class="nx">redis</span><span class="p">.</span><span class="nf">NewClient</span><span class="p">(</span><span class="o">&amp;</span><span class="nx">redis</span><span class="p">.</span><span class="nx">Options</span><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">Addr</span><span class="p">:</span> <span class="s">"localhost:6379"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">Password</span><span class="p">:</span> <span class="s">""</span><span class="p">,</span> <span class="c1">// no password docs </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="nx">DB</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1">// use default DB </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="p">})</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">Set</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bike:1"</span><span class="p">,</span> <span class="s">"Process 134"</span><span class="p">,</span> <span class="mi">0</span><span class="p">).</span><span class="nf">Err</span><span class="p">()</span> </span></span><span class="line hl"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="p">}</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="s">"OK"</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="nx">value</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">Get</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bike:1"</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line hl"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="p">}</span> </span></span><span class="line hl"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Printf</span><span class="p">(</span><span class="s">"The name of the bike is %s"</span><span class="p">,</span> <span class="nx">value</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Go_set_and_get-step')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Go_set_and_get-step" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/go/" tabindex="1" title="Quick-Start"> Go Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/go-redis/tree/master/doctests/set_get_test.go" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="dotnet" id="Csharp_set_and_get-step" name="set_and_get-step" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Csharp_set_and_get-step" title="Open example"> C# </label> <div aria-labelledby="tab-set_and_get-step" class="panel order-last hidden w-full mt-0 relative" id="panel_Csharp_set_and_get-step" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-C#" data-lang="C#"><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.Tests</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">StackExchange.Redis</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">public</span> <span class="k">class</span> <span class="nc">SetGetExample</span> </span></span><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">public</span> <span class="k">void</span> <span class="n">run</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">redis</span> <span class="p">=</span> <span class="n">ConnectionMultiplexer</span><span class="p">.</span><span class="n">Connect</span><span class="p">(</span><span class="s">"localhost:6379"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">db</span> <span class="p">=</span> <span class="n">redis</span><span class="p">.</span><span class="n">GetDatabase</span><span class="p">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="kt">bool</span> <span class="n">status</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">StringSet</span><span class="p">(</span><span class="s">"bike:1"</span><span class="p">,</span> <span class="s">"Process 134"</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">if</span> <span class="p">(</span><span class="n">status</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">"Successfully added a bike."</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="kt">var</span> <span class="k">value</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">StringGet</span><span class="p">(</span><span class="s">"bike:1"</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">if</span> <span class="p">(</span><span class="k">value</span><span class="p">.</span><span class="n">HasValue</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">"The name of the bike is: "</span> <span class="p">+</span> <span class="k">value</span> <span class="p">+</span> <span class="s">"."</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Csharp_set_and_get-step')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Csharp_set_and_get-step" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/dotnet/" tabindex="1" title="Quick-Start"> C# Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/NRedisStack/tree/master/tests/Doc/SetGetExample.cs" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> </div> <p> Hashes are the equivalent of dictionaries (dicts or hash maps). Among other things, you can use hashes to represent plain objects and to store groupings of counters. The following example explains how to set and access field values of an object: </p> <div class="codetabs cli group flex justify-start items-center flex-wrap box-border rounded-lg mt-0 mb-0 mx-auto bg-slate-900" id="hash_tutorial-stepset_get_all"> <input checked="" class="radiotab w-0 h-0" data-lang="redis-cli" id="redis-cli_hash_tutorial-stepset_get_all" name="hash_tutorial-stepset_get_all" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="redis-cli_hash_tutorial-stepset_get_all" title="Open example"> &gt;_ Redis CLI </label> <div aria-labelledby="tab-hash_tutorial-stepset_get_all" class="panel order-last hidden w-full mt-0 relative" id="panel_redis-cli_hash_tutorial-stepset_get_all" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-plaintext" data-lang="plaintext"><span class="line hl"><span class="cl">&gt; HSET bike:1 model Deimos brand Ergonom type 'Enduro bikes' price 4972 </span></span><span class="line hl"><span class="cl">(integer) 4 </span></span><span class="line hl"><span class="cl">&gt; HGET bike:1 model </span></span><span class="line hl"><span class="cl">"Deimos" </span></span><span class="line hl"><span class="cl">&gt; HGET bike:1 price </span></span><span class="line hl"><span class="cl">"4972" </span></span><span class="line hl"><span class="cl">&gt; HGETALL bike:1 </span></span><span class="line hl"><span class="cl">1) "model" </span></span><span class="line hl"><span class="cl">2) "Deimos" </span></span><span class="line hl"><span class="cl">3) "brand" </span></span><span class="line hl"><span class="cl">4) "Ergonom" </span></span><span class="line hl"><span class="cl">5) "type" </span></span><span class="line hl"><span class="cl">6) "Enduro bikes" </span></span><span class="line hl"><span class="cl">7) "price" </span></span><span class="line hl"><span class="cl">8) "4972"</span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_redis-cli_hash_tutorial-stepset_get_all')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <div class="flex-1 text-xs text-white overflow-ellipsis"> Are you tired of using redis-cli? Try Redis Insight - the developer GUI for Redis. </div> <div class="text-right"> <a class="rounded rounded-mx px-2 py-1 flex items-center text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.com/redis-enterprise/redis-insight/" tabindex="1" title="Get Redis Insight"> <svg class="w-4 h-4 mr-1" fill="none" height="14" viewbox="0 0 14 14" width="14" xmlns="http://www.w3.org/2000/svg"> <path d="M2.26236 5.66895L1.21732 6.07172L7.00018 8.65693V7.79842L2.26236 5.66895Z" fill="#fca5a5"> </path> <path d="M2.26236 8.02271L1.21732 8.42548L7.00018 11.0119V10.1516L2.26236 8.02271Z" fill="#fca5a5"> </path> <path d="M1.21732 3.7175L7.00018 6.30392V2.87805L8.66273 2.13423L7.00018 1.49512L1.21732 3.7175Z" fill="#fca5a5"> </path> <path d="M7.00018 2.8781V6.30366L1.21732 3.71724V5.20004L7.00018 7.79705V8.65526L1.21732 6.07217V7.55496L7.00018 10.1553V11.0135L1.21732 8.42376V9.90656H1.18878L7.00018 12.5051L8.66273 11.7613V2.13428L7.00018 2.8781Z" fill="#f87171"> </path> <path d="M9.07336 11.5777L10.7359 10.8338V4.01538L9.07336 4.7592V11.5777Z" fill="#f87171"> </path> <path d="M9.07336 4.75867L10.7359 4.01485L9.07336 3.37573V4.75867Z" fill="#fca5a5"> </path> <path d="M11.1481 10.6497L12.8112 9.90591V5.896L11.1487 6.63982L11.1481 10.6497Z" fill="#f87171"> </path> <path d="M11.1481 6.63954L12.8112 5.89572L11.1481 5.25781V6.63954Z" fill="#fca5a5"> </path> </svg> <span> Get Redis Insight </span> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="python" id="Python_hash_tutorial-stepset_get_all" name="hash_tutorial-stepset_get_all" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Python_hash_tutorial-stepset_get_all" title="Open example"> Python </label> <div aria-labelledby="tab-hash_tutorial-stepset_get_all" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_hash_tutorial-stepset_get_all" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2">Code samples for Hash doc pages: </span></span></span><span class="line"><span class="cl"><span class="s2"> https://redis.io/docs/latest/develop/data-types/hashes/ </span></span></span><span class="line"><span class="cl"><span class="s2">"""</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">r</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">Redis</span><span class="p">(</span><span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="n">res1</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">hset</span><span class="p">(</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"bike:1"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="n">mapping</span><span class="o">=</span><span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="s2">"Deimos"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="s2">"Ergonom"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"type"</span><span class="p">:</span> <span class="s2">"Enduro bikes"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"price"</span><span class="p">:</span> <span class="mi">4972</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="p">},</span> </span></span><span class="line hl"><span class="cl"><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res1</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt; 4</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">res2</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">hget</span><span class="p">(</span><span class="s2">"bike:1"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res2</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt; 'Deimos'</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">res3</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">hget</span><span class="p">(</span><span class="s2">"bike:1"</span><span class="p">,</span> <span class="s2">"price"</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res3</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt; '4972'</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">res4</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">hgetall</span><span class="p">(</span><span class="s2">"bike:1"</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res4</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt; {'model': 'Deimos', 'brand': 'Ergonom', 'type': 'Enduro bikes', 'price': '4972'}</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res5</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">hmget</span><span class="p">(</span><span class="s2">"bike:1"</span><span class="p">,</span> <span class="p">[</span><span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span><span class="p">])</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res5</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['Deimos', '4972']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res6</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">hincrby</span><span class="p">(</span><span class="s2">"bike:1"</span><span class="p">,</span> <span class="s2">"price"</span><span class="p">,</span> <span class="mi">100</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res6</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 5072</span> </span></span><span class="line"><span class="cl"><span class="n">res7</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">hincrby</span><span class="p">(</span><span class="s2">"bike:1"</span><span class="p">,</span> <span class="s2">"price"</span><span class="p">,</span> <span class="o">-</span><span class="mi">100</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res7</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 4972</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res11</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">hincrby</span><span class="p">(</span><span class="s2">"bike:1:stats"</span><span class="p">,</span> <span class="s2">"rides"</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res11</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 1</span> </span></span><span class="line"><span class="cl"><span class="n">res12</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">hincrby</span><span class="p">(</span><span class="s2">"bike:1:stats"</span><span class="p">,</span> <span class="s2">"rides"</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res12</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 2</span> </span></span><span class="line"><span class="cl"><span class="n">res13</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">hincrby</span><span class="p">(</span><span class="s2">"bike:1:stats"</span><span class="p">,</span> <span class="s2">"rides"</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res13</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 3</span> </span></span><span class="line"><span class="cl"><span class="n">res14</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">hincrby</span><span class="p">(</span><span class="s2">"bike:1:stats"</span><span class="p">,</span> <span class="s2">"crashes"</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res14</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 1</span> </span></span><span class="line"><span class="cl"><span class="n">res15</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">hincrby</span><span class="p">(</span><span class="s2">"bike:1:stats"</span><span class="p">,</span> <span class="s2">"owners"</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res15</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 1</span> </span></span><span class="line"><span class="cl"><span class="n">res16</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">hget</span><span class="p">(</span><span class="s2">"bike:1:stats"</span><span class="p">,</span> <span class="s2">"rides"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res16</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 3</span> </span></span><span class="line"><span class="cl"><span class="n">res17</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">hmget</span><span class="p">(</span><span class="s2">"bike:1:stats"</span><span class="p">,</span> <span class="p">[</span><span class="s2">"crashes"</span><span class="p">,</span> <span class="s2">"owners"</span><span class="p">])</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res17</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['1', '1']</span> </span></span><span class="line"><span class="cl"> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Python_hash_tutorial-stepset_get_all')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Python_hash_tutorial-stepset_get_all" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/python/redis-py/" tabindex="1" title="Quick-Start"> Python Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/redis-py/tree/master/doctests/dt_hash.py" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="javascript" id="Nodejs_hash_tutorial-stepset_get_all" name="hash_tutorial-stepset_get_all" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Nodejs_hash_tutorial-stepset_get_all" title="Open example"> Node.js </label> <div aria-labelledby="tab-hash_tutorial-stepset_get_all" class="panel order-last hidden w-full mt-0 relative" id="panel_Nodejs_hash_tutorial-stepset_get_all" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-javascript" data-lang="javascript"><span class="line"><span class="cl"><span class="kr">import</span> <span class="nx">assert</span> <span class="nx">from</span> <span class="s1">'assert'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="p">{</span> <span class="nx">createClient</span> <span class="p">}</span> <span class="nx">from</span> <span class="s1">'redis'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">client</span> <span class="o">=</span> <span class="nx">createClient</span><span class="p">();</span> </span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">connect</span><span class="p">();</span> </span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">res1</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">hSet</span><span class="p">(</span> </span></span><span class="line hl"><span class="cl"> <span class="s1">'bike:1'</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="s1">'model'</span><span class="o">:</span> <span class="s1">'Deimos'</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s1">'brand'</span><span class="o">:</span> <span class="s1">'Ergonom'</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s1">'type'</span><span class="o">:</span> <span class="s1">'Enduro bikes'</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s1">'price'</span><span class="o">:</span> <span class="mi">4972</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="p">}</span> </span></span><span class="line hl"><span class="cl"><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res1</span><span class="p">)</span> <span class="c1">// 4 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">res2</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">hGet</span><span class="p">(</span><span class="s1">'bike:1'</span><span class="p">,</span> <span class="s1">'model'</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res2</span><span class="p">)</span> <span class="c1">// 'Deimos' </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">res3</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">hGet</span><span class="p">(</span><span class="s1">'bike:1'</span><span class="p">,</span> <span class="s1">'price'</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res3</span><span class="p">)</span> <span class="c1">// '4972' </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">res4</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">hGetAll</span><span class="p">(</span><span class="s1">'bike:1'</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res4</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="cm">/* </span></span></span><span class="line hl"><span class="cl"><span class="cm">{ </span></span></span><span class="line hl"><span class="cl"><span class="cm"> brand: 'Ergonom', </span></span></span><span class="line hl"><span class="cl"><span class="cm"> model: 'Deimos', </span></span></span><span class="line hl"><span class="cl"><span class="cm"> price: '4972', </span></span></span><span class="line hl"><span class="cl"><span class="cm"> type: 'Enduro bikes' </span></span></span><span class="line hl"><span class="cl"><span class="cm">} </span></span></span><span class="line hl"><span class="cl"><span class="cm">*/</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">res5</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">hmGet</span><span class="p">(</span><span class="s1">'bike:1'</span><span class="p">,</span> <span class="p">[</span><span class="s1">'model'</span><span class="p">,</span> <span class="s1">'price'</span><span class="p">])</span> </span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res5</span><span class="p">)</span> <span class="c1">// ['Deimos', '4972'] </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">res6</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">hIncrBy</span><span class="p">(</span><span class="s1">'bike:1'</span><span class="p">,</span> <span class="s1">'price'</span><span class="p">,</span> <span class="mi">100</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res6</span><span class="p">)</span> <span class="c1">// 5072 </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">const</span> <span class="nx">res7</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">hIncrBy</span><span class="p">(</span><span class="s1">'bike:1'</span><span class="p">,</span> <span class="s1">'price'</span><span class="p">,</span> <span class="o">-</span><span class="mi">100</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res7</span><span class="p">)</span> <span class="c1">// 4972 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">res11</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">hIncrBy</span><span class="p">(</span><span class="s1">'bike:1:stats'</span><span class="p">,</span> <span class="s1">'rides'</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res11</span><span class="p">)</span> <span class="c1">// 1 </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">const</span> <span class="nx">res12</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">hIncrBy</span><span class="p">(</span><span class="s1">'bike:1:stats'</span><span class="p">,</span> <span class="s1">'rides'</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res12</span><span class="p">)</span> <span class="c1">// 2 </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">const</span> <span class="nx">res13</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">hIncrBy</span><span class="p">(</span><span class="s1">'bike:1:stats'</span><span class="p">,</span> <span class="s1">'rides'</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res13</span><span class="p">)</span> <span class="c1">// 3 </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">const</span> <span class="nx">res14</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">hIncrBy</span><span class="p">(</span><span class="s1">'bike:1:stats'</span><span class="p">,</span> <span class="s1">'crashes'</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res14</span><span class="p">)</span> <span class="c1">// 1 </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">const</span> <span class="nx">res15</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">hIncrBy</span><span class="p">(</span><span class="s1">'bike:1:stats'</span><span class="p">,</span> <span class="s1">'owners'</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res15</span><span class="p">)</span> <span class="c1">// 1 </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">const</span> <span class="nx">res16</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">hGet</span><span class="p">(</span><span class="s1">'bike:1:stats'</span><span class="p">,</span> <span class="s1">'rides'</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res16</span><span class="p">)</span> <span class="c1">// 3 </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">const</span> <span class="nx">res17</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">hmGet</span><span class="p">(</span><span class="s1">'bike:1:stats'</span><span class="p">,</span> <span class="p">[</span><span class="s1">'crashes'</span><span class="p">,</span> <span class="s1">'owners'</span><span class="p">])</span> </span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res17</span><span class="p">)</span> <span class="c1">// ['1', '1'] </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Nodejs_hash_tutorial-stepset_get_all')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Nodejs_hash_tutorial-stepset_get_all" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/nodejs/" tabindex="1" title="Quick-Start"> Node.js Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/node-redis/tree/emb-examples/doctests/dt-hash.js" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="java" id="Java_hash_tutorial-stepset_get_all" name="hash_tutorial-stepset_get_all" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Java_hash_tutorial-stepset_get_all" title="Open example"> Java </label> <div aria-labelledby="tab-hash_tutorial-stepset_get_all" class="panel order-last hidden w-full mt-0 relative" id="panel_Java_hash_tutorial-stepset_get_all" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="kn">package</span> <span class="nn">io.redis.examples</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.UnifiedJedis</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">java.util.HashMap</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">java.util.List</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">java.util.Map</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kd">public</span> <span class="kd">class</span> <span class="nc">HashExample</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="kd">public</span> <span class="kt">void</span> <span class="nf">run</span><span class="o">()</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="k">try</span> <span class="o">(</span><span class="n">UnifiedJedis</span> <span class="n">jedis</span> <span class="o">=</span> <span class="k">new</span> <span class="n">UnifiedJedis</span><span class="o">(</span><span class="s">"redis://localhost:6379"</span><span class="o">))</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">&gt;</span> <span class="n">bike1</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span class="o">&lt;&gt;();</span> </span></span><span class="line hl"><span class="cl"> <span class="n">bike1</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="s">"model"</span><span class="o">,</span> <span class="s">"Deimos"</span><span class="o">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">bike1</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="s">"brand"</span><span class="o">,</span> <span class="s">"Ergonom"</span><span class="o">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">bike1</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="s">"type"</span><span class="o">,</span> <span class="s">"Enduro bikes"</span><span class="o">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">bike1</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="s">"price"</span><span class="o">,</span> <span class="s">"4972"</span><span class="o">);</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="n">Long</span> <span class="n">res1</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">hset</span><span class="o">(</span><span class="s">"bike:1"</span><span class="o">,</span> <span class="n">bike1</span><span class="o">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res1</span><span class="o">);</span> <span class="c1">// 4 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"> <span class="n">String</span> <span class="n">res2</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">hget</span><span class="o">(</span><span class="s">"bike:1"</span><span class="o">,</span> <span class="s">"model"</span><span class="o">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res2</span><span class="o">);</span> <span class="c1">// Deimos </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"> <span class="n">String</span> <span class="n">res3</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">hget</span><span class="o">(</span><span class="s">"bike:1"</span><span class="o">,</span> <span class="s">"price"</span><span class="o">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res3</span><span class="o">);</span> <span class="c1">// 4972 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"> <span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">&gt;</span> <span class="n">res4</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">hgetAll</span><span class="o">(</span><span class="s">"bike:1"</span><span class="o">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res4</span><span class="o">);</span> <span class="c1">// {type=Enduro bikes, brand=Ergonom, price=4972, model=Deimos} </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">res5</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">hmget</span><span class="o">(</span><span class="s">"bike:1"</span><span class="o">,</span> <span class="s">"model"</span><span class="o">,</span> <span class="s">"price"</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res5</span><span class="o">);</span> <span class="c1">// [Deimos, 4972] </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">Long</span> <span class="n">res6</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">hincrBy</span><span class="o">(</span><span class="s">"bike:1"</span><span class="o">,</span> <span class="s">"price"</span><span class="o">,</span> <span class="mi">100</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res6</span><span class="o">);</span> <span class="c1">// 5072 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="n">Long</span> <span class="n">res7</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">hincrBy</span><span class="o">(</span><span class="s">"bike:1"</span><span class="o">,</span> <span class="s">"price"</span><span class="o">,</span> <span class="o">-</span><span class="mi">100</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res7</span><span class="o">);</span> <span class="c1">// 4972 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">Long</span> <span class="n">res8</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">hincrBy</span><span class="o">(</span><span class="s">"bike:1:stats"</span><span class="o">,</span> <span class="s">"rides"</span><span class="o">,</span> <span class="mi">1</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res8</span><span class="o">);</span> <span class="c1">// 1 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="n">Long</span> <span class="n">res9</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">hincrBy</span><span class="o">(</span><span class="s">"bike:1:stats"</span><span class="o">,</span> <span class="s">"rides"</span><span class="o">,</span> <span class="mi">1</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res9</span><span class="o">);</span> <span class="c1">// 2 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="n">Long</span> <span class="n">res10</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">hincrBy</span><span class="o">(</span><span class="s">"bike:1:stats"</span><span class="o">,</span> <span class="s">"rides"</span><span class="o">,</span> <span class="mi">1</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res10</span><span class="o">);</span> <span class="c1">// 3 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="n">Long</span> <span class="n">res11</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">hincrBy</span><span class="o">(</span><span class="s">"bike:1:stats"</span><span class="o">,</span> <span class="s">"crashes"</span><span class="o">,</span> <span class="mi">1</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res11</span><span class="o">);</span> <span class="c1">// 1 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="n">Long</span> <span class="n">res12</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">hincrBy</span><span class="o">(</span><span class="s">"bike:1:stats"</span><span class="o">,</span> <span class="s">"owners"</span><span class="o">,</span> <span class="mi">1</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res12</span><span class="o">);</span> <span class="c1">// 1 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="n">String</span> <span class="n">res13</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">hget</span><span class="o">(</span><span class="s">"bike:1:stats"</span><span class="o">,</span> <span class="s">"rides"</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res13</span><span class="o">);</span> <span class="c1">// 3 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="n">List</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">res14</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">hmget</span><span class="o">(</span><span class="s">"bike:1:stats"</span><span class="o">,</span> <span class="s">"crashes"</span><span class="o">,</span> <span class="s">"owners"</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res14</span><span class="o">);</span> <span class="c1">// [1, 1] </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="o">}</span> </span></span><span class="line"><span class="cl"> <span class="o">}</span> </span></span><span class="line"><span class="cl"><span class="o">}</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Java_hash_tutorial-stepset_get_all')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Java_hash_tutorial-stepset_get_all" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/java/jedis/" tabindex="1" title="Quick-Start"> Java Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/jedis/tree/master/src/test/java/io/redis/examples/HashExample.java" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="go" id="Go_hash_tutorial-stepset_get_all" name="hash_tutorial-stepset_get_all" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Go_hash_tutorial-stepset_get_all" title="Open example"> Go </label> <div aria-labelledby="tab-hash_tutorial-stepset_get_all" class="panel order-last hidden w-full mt-0 relative" id="panel_Go_hash_tutorial-stepset_get_all" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="kn">package</span> <span class="nx">example_commands_test</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"context"</span> </span></span><span class="line"><span class="cl"> <span class="s">"fmt"</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">"github.com/redis/go-redis/v9"</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kd">func</span> <span class="nf">ExampleClient_set_get_all</span><span class="p">()</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">ctx</span> <span class="o">:=</span> <span class="nx">context</span><span class="p">.</span><span class="nf">Background</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">rdb</span> <span class="o">:=</span> <span class="nx">redis</span><span class="p">.</span><span class="nf">NewClient</span><span class="p">(</span><span class="o">&amp;</span><span class="nx">redis</span><span class="p">.</span><span class="nx">Options</span><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">Addr</span><span class="p">:</span> <span class="s">"localhost:6379"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">Password</span><span class="p">:</span> <span class="s">""</span><span class="p">,</span> <span class="c1">// no password docs </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="nx">DB</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1">// use default DB </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="p">})</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="nx">hashFields</span> <span class="o">:=</span> <span class="p">[]</span><span class="kt">string</span><span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="s">"model"</span><span class="p">,</span> <span class="s">"Deimos"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s">"brand"</span><span class="p">,</span> <span class="s">"Ergonom"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s">"type"</span><span class="p">,</span> <span class="s">"Enduro bikes"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s">"price"</span><span class="p">,</span> <span class="s">"4972"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="p">}</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="nx">res1</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">HSet</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bike:1"</span><span class="p">,</span> <span class="nx">hashFields</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="p">}</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">res1</span><span class="p">)</span> <span class="c1">// &gt;&gt;&gt; 4 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"> <span class="nx">res2</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">HGet</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bike:1"</span><span class="p">,</span> <span class="s">"model"</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="p">}</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">res2</span><span class="p">)</span> <span class="c1">// &gt;&gt;&gt; Deimos </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"> <span class="nx">res3</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">HGet</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bike:1"</span><span class="p">,</span> <span class="s">"price"</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="p">}</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">res3</span><span class="p">)</span> <span class="c1">// &gt;&gt;&gt; 4972 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"> <span class="nx">cmdReturn</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">HGetAll</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bike:1"</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="nx">res4</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">cmdReturn</span><span class="p">.</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="p">}</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">res4</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="c1">// &gt;&gt;&gt; map[brand:Ergonom model:Deimos price:4972 type:Enduro bikes] </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"> <span class="kd">type</span> <span class="nx">BikeInfo</span> <span class="kd">struct</span> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="nx">Model</span> <span class="kt">string</span> <span class="s">`redis:"model"`</span> </span></span><span class="line hl"><span class="cl"> <span class="nx">Brand</span> <span class="kt">string</span> <span class="s">`redis:"brand"`</span> </span></span><span class="line hl"><span class="cl"> <span class="nx">Type</span> <span class="kt">string</span> <span class="s">`redis:"type"`</span> </span></span><span class="line hl"><span class="cl"> <span class="nx">Price</span> <span class="kt">int</span> <span class="s">`redis:"price"`</span> </span></span><span class="line hl"><span class="cl"> <span class="p">}</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="kd">var</span> <span class="nx">res4a</span> <span class="nx">BikeInfo</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">cmdReturn</span><span class="p">.</span><span class="nf">Scan</span><span class="p">(</span><span class="o">&amp;</span><span class="nx">res4a</span><span class="p">);</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="p">}</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Printf</span><span class="p">(</span><span class="s">"Model: %v, Brand: %v, Type: %v, Price: $%v\n"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="nx">res4a</span><span class="p">.</span><span class="nx">Model</span><span class="p">,</span> <span class="nx">res4a</span><span class="p">.</span><span class="nx">Brand</span><span class="p">,</span> <span class="nx">res4a</span><span class="p">.</span><span class="nx">Type</span><span class="p">,</span> <span class="nx">res4a</span><span class="p">.</span><span class="nx">Price</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="c1">// &gt;&gt;&gt; Model: Deimos, Brand: Ergonom, Type: Enduro bikes, Price: $4972 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kd">func</span> <span class="nf">ExampleClient_hmget</span><span class="p">()</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">ctx</span> <span class="o">:=</span> <span class="nx">context</span><span class="p">.</span><span class="nf">Background</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">rdb</span> <span class="o">:=</span> <span class="nx">redis</span><span class="p">.</span><span class="nf">NewClient</span><span class="p">(</span><span class="o">&amp;</span><span class="nx">redis</span><span class="p">.</span><span class="nx">Options</span><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">Addr</span><span class="p">:</span> <span class="s">"localhost:6379"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">Password</span><span class="p">:</span> <span class="s">""</span><span class="p">,</span> <span class="c1">// no password docs </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="nx">DB</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1">// use default DB </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="p">})</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">hashFields</span> <span class="o">:=</span> <span class="p">[]</span><span class="kt">string</span><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s">"model"</span><span class="p">,</span> <span class="s">"Deimos"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"brand"</span><span class="p">,</span> <span class="s">"Ergonom"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"type"</span><span class="p">,</span> <span class="s">"Enduro bikes"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"price"</span><span class="p">,</span> <span class="s">"4972"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">_</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">HSet</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bike:1"</span><span class="p">,</span> <span class="nx">hashFields</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">cmdReturn</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">HMGet</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bike:1"</span><span class="p">,</span> <span class="s">"model"</span><span class="p">,</span> <span class="s">"price"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="nx">res5</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">cmdReturn</span><span class="p">.</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">res5</span><span class="p">)</span> <span class="c1">// &gt;&gt;&gt; [Deimos 4972] </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="kd">type</span> <span class="nx">BikeInfo</span> <span class="kd">struct</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">Model</span> <span class="kt">string</span> <span class="s">`redis:"model"`</span> </span></span><span class="line"><span class="cl"> <span class="nx">Brand</span> <span class="kt">string</span> <span class="s">`redis:"-"`</span> </span></span><span class="line"><span class="cl"> <span class="nx">Type</span> <span class="kt">string</span> <span class="s">`redis:"-"`</span> </span></span><span class="line"><span class="cl"> <span class="nx">Price</span> <span class="kt">int</span> <span class="s">`redis:"price"`</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kd">var</span> <span class="nx">res5a</span> <span class="nx">BikeInfo</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">cmdReturn</span><span class="p">.</span><span class="nf">Scan</span><span class="p">(</span><span class="o">&amp;</span><span class="nx">res5a</span><span class="p">);</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Printf</span><span class="p">(</span><span class="s">"Model: %v, Price: $%v\n"</span><span class="p">,</span> <span class="nx">res5a</span><span class="p">.</span><span class="nx">Model</span><span class="p">,</span> <span class="nx">res5a</span><span class="p">.</span><span class="nx">Price</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="c1">// &gt;&gt;&gt; Model: Deimos, Price: $4972 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kd">func</span> <span class="nf">ExampleClient_hincrby</span><span class="p">()</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">ctx</span> <span class="o">:=</span> <span class="nx">context</span><span class="p">.</span><span class="nf">Background</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">rdb</span> <span class="o">:=</span> <span class="nx">redis</span><span class="p">.</span><span class="nf">NewClient</span><span class="p">(</span><span class="o">&amp;</span><span class="nx">redis</span><span class="p">.</span><span class="nx">Options</span><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">Addr</span><span class="p">:</span> <span class="s">"localhost:6379"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">Password</span><span class="p">:</span> <span class="s">""</span><span class="p">,</span> <span class="c1">// no password docs </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="nx">DB</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1">// use default DB </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="p">})</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">hashFields</span> <span class="o">:=</span> <span class="p">[]</span><span class="kt">string</span><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s">"model"</span><span class="p">,</span> <span class="s">"Deimos"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"brand"</span><span class="p">,</span> <span class="s">"Ergonom"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"type"</span><span class="p">,</span> <span class="s">"Enduro bikes"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"price"</span><span class="p">,</span> <span class="s">"4972"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">_</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">HSet</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bike:1"</span><span class="p">,</span> <span class="nx">hashFields</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">res6</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">HIncrBy</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bike:1"</span><span class="p">,</span> <span class="s">"price"</span><span class="p">,</span> <span class="mi">100</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">res6</span><span class="p">)</span> <span class="c1">// &gt;&gt;&gt; 5072 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="nx">res7</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">HIncrBy</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bike:1"</span><span class="p">,</span> <span class="s">"price"</span><span class="p">,</span> <span class="o">-</span><span class="mi">100</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">res7</span><span class="p">)</span> <span class="c1">// &gt;&gt;&gt; 4972 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kd">func</span> <span class="nf">ExampleClient_incrby_get_mget</span><span class="p">()</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">ctx</span> <span class="o">:=</span> <span class="nx">context</span><span class="p">.</span><span class="nf">Background</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">rdb</span> <span class="o">:=</span> <span class="nx">redis</span><span class="p">.</span><span class="nf">NewClient</span><span class="p">(</span><span class="o">&amp;</span><span class="nx">redis</span><span class="p">.</span><span class="nx">Options</span><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">Addr</span><span class="p">:</span> <span class="s">"localhost:6379"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">Password</span><span class="p">:</span> <span class="s">""</span><span class="p">,</span> <span class="c1">// no password docs </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="nx">DB</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1">// use default DB </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="p">})</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">res8</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">HIncrBy</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bike:1:stats"</span><span class="p">,</span> <span class="s">"rides"</span><span class="p">,</span> <span class="mi">1</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">res8</span><span class="p">)</span> <span class="c1">// &gt;&gt;&gt; 1 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="nx">res9</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">HIncrBy</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bike:1:stats"</span><span class="p">,</span> <span class="s">"rides"</span><span class="p">,</span> <span class="mi">1</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">res9</span><span class="p">)</span> <span class="c1">// &gt;&gt;&gt; 2 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="nx">res10</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">HIncrBy</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bike:1:stats"</span><span class="p">,</span> <span class="s">"rides"</span><span class="p">,</span> <span class="mi">1</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">res10</span><span class="p">)</span> <span class="c1">// &gt;&gt;&gt; 3 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="nx">res11</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">HIncrBy</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bike:1:stats"</span><span class="p">,</span> <span class="s">"crashes"</span><span class="p">,</span> <span class="mi">1</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">res11</span><span class="p">)</span> <span class="c1">// &gt;&gt;&gt; 1 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="nx">res12</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">HIncrBy</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bike:1:stats"</span><span class="p">,</span> <span class="s">"owners"</span><span class="p">,</span> <span class="mi">1</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">res12</span><span class="p">)</span> <span class="c1">// &gt;&gt;&gt; 1 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="nx">res13</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">HGet</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bike:1:stats"</span><span class="p">,</span> <span class="s">"rides"</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">res13</span><span class="p">)</span> <span class="c1">// &gt;&gt;&gt; 3 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="nx">res14</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">HMGet</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bike:1:stats"</span><span class="p">,</span> <span class="s">"crashes"</span><span class="p">,</span> <span class="s">"owners"</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">res14</span><span class="p">)</span> <span class="c1">// &gt;&gt;&gt; [1 1] </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Go_hash_tutorial-stepset_get_all')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Go_hash_tutorial-stepset_get_all" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/go/" tabindex="1" title="Quick-Start"> Go Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/go-redis/tree/master/doctests/hash_tutorial_test.go" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="dotnet" id="Csharp_hash_tutorial-stepset_get_all" name="hash_tutorial-stepset_get_all" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Csharp_hash_tutorial-stepset_get_all" title="Open example"> C# </label> <div aria-labelledby="tab-hash_tutorial-stepset_get_all" class="panel order-last hidden w-full mt-0 relative" id="panel_Csharp_hash_tutorial-stepset_get_all" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-C#" data-lang="C#"><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.Tests</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">StackExchange.Redis</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">public</span> <span class="k">class</span> <span class="nc">HashExample</span> </span></span><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="k">public</span> <span class="k">void</span> <span class="n">run</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">muxer</span> <span class="p">=</span> <span class="n">ConnectionMultiplexer</span><span class="p">.</span><span class="n">Connect</span><span class="p">(</span><span class="s">"localhost:6379"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">db</span> <span class="p">=</span> <span class="n">muxer</span><span class="p">.</span><span class="n">GetDatabase</span><span class="p">();</span> </span></span><span class="line"><span class="cl"> <span class="n">db</span><span class="p">.</span><span class="n">KeyDelete</span><span class="p">(</span><span class="s">"bike:1"</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">db</span><span class="p">.</span><span class="n">HashSet</span><span class="p">(</span><span class="s">"bike:1"</span><span class="p">,</span> <span class="k">new</span> <span class="n">HashEntry</span><span class="p">[]</span> </span></span><span class="line hl"><span class="cl"> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="k">new</span> <span class="n">HashEntry</span><span class="p">(</span><span class="s">"model"</span><span class="p">,</span> <span class="s">"Deimos"</span><span class="p">),</span> </span></span><span class="line hl"><span class="cl"> <span class="k">new</span> <span class="n">HashEntry</span><span class="p">(</span><span class="s">"brand"</span><span class="p">,</span> <span class="s">"Ergonom"</span><span class="p">),</span> </span></span><span class="line hl"><span class="cl"> <span class="k">new</span> <span class="n">HashEntry</span><span class="p">(</span><span class="s">"type"</span><span class="p">,</span> <span class="s">"Enduro bikes"</span><span class="p">),</span> </span></span><span class="line hl"><span class="cl"> <span class="k">new</span> <span class="n">HashEntry</span><span class="p">(</span><span class="s">"price"</span><span class="p">,</span> <span class="m">4972</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="p">});</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">"Hash Created"</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"> <span class="c1">// Hash Created</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="kt">var</span> <span class="n">model</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">HashGet</span><span class="p">(</span><span class="s">"bike:1"</span><span class="p">,</span> <span class="s">"model"</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">$"Model: {model}"</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"> <span class="c1">// Model: Deimos</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="kt">var</span> <span class="n">price</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">HashGet</span><span class="p">(</span><span class="s">"bike:1"</span><span class="p">,</span> <span class="s">"price"</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">$"Price: {price}"</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"> <span class="c1">// Price: 4972</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="kt">var</span> <span class="n">bike</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">HashGetAll</span><span class="p">(</span><span class="s">"bike:1"</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">"bike:1"</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="kt">string</span><span class="p">.</span><span class="n">Join</span><span class="p">(</span><span class="s">"\n"</span><span class="p">,</span> <span class="n">bike</span><span class="p">.</span><span class="n">Select</span><span class="p">(</span><span class="n">b</span> <span class="p">=&gt;</span> <span class="s">$"{b.Name}: {b.Value}"</span><span class="p">)));</span> </span></span><span class="line hl"><span class="cl"> <span class="c1">// Bike:1:</span> </span></span><span class="line hl"><span class="cl"> <span class="c1">// model: Deimos</span> </span></span><span class="line hl"><span class="cl"> <span class="c1">// brand: Ergonom</span> </span></span><span class="line hl"><span class="cl"> <span class="c1">// type: Enduro bikes</span> </span></span><span class="line hl"><span class="cl"> <span class="c1">// price: 4972</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">values</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">HashGet</span><span class="p">(</span><span class="s">"bike:1"</span><span class="p">,</span> <span class="k">new</span> <span class="n">RedisValue</span><span class="p">[]</span> <span class="p">{</span> <span class="s">"model"</span><span class="p">,</span> <span class="s">"price"</span> <span class="p">});</span> </span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="kt">string</span><span class="p">.</span><span class="n">Join</span><span class="p">(</span><span class="s">" "</span><span class="p">,</span> <span class="n">values</span><span class="p">));</span> </span></span><span class="line"><span class="cl"> <span class="c1">// Deimos 4972</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">newPrice</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">HashIncrement</span><span class="p">(</span><span class="s">"bike:1"</span><span class="p">,</span> <span class="s">"price"</span><span class="p">,</span> <span class="m">100</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">$"New price: {newPrice}"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="c1">// New price: 5072</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">newPrice</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">HashIncrement</span><span class="p">(</span><span class="s">"bike:1"</span><span class="p">,</span> <span class="s">"price"</span><span class="p">,</span> <span class="p">-</span><span class="m">100</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">$"New price: {newPrice}"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="c1">// New price: 4972</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">rides</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">HashIncrement</span><span class="p">(</span><span class="s">"bike:1"</span><span class="p">,</span> <span class="s">"rides"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">$"Rides: {rides}"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="c1">// Rides: 1</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">rides</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">HashIncrement</span><span class="p">(</span><span class="s">"bike:1"</span><span class="p">,</span> <span class="s">"rides"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">$"Rides: {rides}"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="c1">// Rides: 2</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">rides</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">HashIncrement</span><span class="p">(</span><span class="s">"bike:1"</span><span class="p">,</span> <span class="s">"rides"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">$"Rides: {rides}"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="c1">// Rides: 3</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">crashes</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">HashIncrement</span><span class="p">(</span><span class="s">"bike:1"</span><span class="p">,</span> <span class="s">"crashes"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">$"Crashes: {crashes}"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="c1">// Crashes: 1</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">owners</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">HashIncrement</span><span class="p">(</span><span class="s">"bike:1"</span><span class="p">,</span> <span class="s">"owners"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">$"Owners: {owners}"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="c1">// Owners: 1</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">stats</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">HashGet</span><span class="p">(</span><span class="s">"bike:1"</span><span class="p">,</span> <span class="k">new</span> <span class="n">RedisValue</span><span class="p">[]</span> <span class="p">{</span> <span class="s">"crashes"</span><span class="p">,</span> <span class="s">"owners"</span> <span class="p">});</span> </span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">$"Bike stats: crashes={stats[0]}, owners={stats[1]}"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="c1">// Bike stats: crashes=1, owners=1</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Csharp_hash_tutorial-stepset_get_all')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Csharp_hash_tutorial-stepset_get_all" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/dotnet/" tabindex="1" title="Quick-Start"> C# Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/NRedisStack/tree/master/tests/Doc/HashExample.cs" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> </div> <p> You can get a complete overview of available data types in this documentation site's <a href="/docs/latest/develop/data-types/"> data types section </a> . Each data type has commands allowing you to manipulate or retrieve data. The <a href="/docs/latest/commands/"> commands reference </a> provides a sophisticated explanation. </p> <h2 id="scan-the-keyspace"> Scan the keyspace </h2> <p> Each item within Redis has a unique key. All items live within the Redis <a href="/docs/latest/develop/use/keyspace/"> keyspace </a> . You can scan the Redis keyspace via the <a href="/docs/latest/commands/scan/"> SCAN command </a> . Here is an example that scans for the first 100 keys that have the prefix <code> bike: </code> : </p> <pre tabindex="0"><code>SCAN 0 MATCH "bike:*" COUNT 100 </code></pre> <p> <a href="/docs/latest/commands/scan/"> SCAN </a> returns a cursor position, allowing you to scan iteratively for the next batch of keys until you reach the cursor value 0. </p> <h2 id="next-steps"> Next steps </h2> <p> You can address more use cases with Redis by learning about Redis Stack. Here are two additional quick start guides: </p> <ul> <li> <a href="/docs/latest/develop/get-started/document-database/"> Redis as a document database </a> </li> <li> <a href="/docs/latest/develop/get-started/vector-database/"> Redis as a vector database </a> </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/get-started/data-store/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/redisearch-2.2-release-notes/.html
<section class="prose w-full py-12 max-w-none"> <h1> RediSearch 2.2 release notes </h1> <p class="text-lg -mt-5 mb-10"> Search and index JSON documents. Profiling queries. Field aliasing. </p> <h2 id="requirements"> Requirements </h2> <p> RediSearch v2.2.10 requires: </p> <ul> <li> Minimum Redis compatibility version (database): 6.0.0 </li> <li> Minimum Redis Enterprise Software version (cluster): 6.0.0 </li> </ul> <h2 id="v2210-march-2022"> v2.2.10 (March 2022) </h2> <p> This is a maintenance release for RediSearch 2.2. </p> <p> Update urgency: <code> MODERATE </code> : Program an upgrade of the server, but it's not urgent. </p> <p> Details: </p> <ul> <li> <p> Improvements: </p> <ul> <li> Mac M1 support </li> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2645"> #2645 </a> Ignore <code> NULL </code> values in JSON documents on indexing (prior behaviour would ignore the entire document) </li> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2623"> #2623 </a> Improved Multi Sortby error message for <code> FT.SEARCH </code> </li> </ul> </li> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2641"> #2641 </a> Memory leak in Coordinator </li> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2651"> #2651 </a> Client freeze on docs expire during query </li> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2670"> #2670 </a> Memory leak in RediSearch found in Active-Active (MOD-2518) </li> </ul> </li> </ul> <h2 id="v229-march-2022"> v2.2.9 (March 2022) </h2> <p> This is a maintenance release for RediSearch 2.2. </p> <p> Update urgency: <code> MODERATE </code> : Program an upgrade of the server, but it's not urgent. </p> <p> Details: </p> <ul> <li> <p> Improvements: </p> <ul> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2605"> #2605 </a> Added support for <code> tls-key-file-pass </code> capability (MOD-2086) </li> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2583"> #2583 </a> Release index-specific information off the main thread (performance enhancement) </li> </ul> </li> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2436"> #2436 </a> When indexing JSON documents, filters cause no documents to be indexed (MOD-2214) </li> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2507"> #2507 </a> <code> QUANTILE </code> aggregation function outputting wrong values (MOD-2432) </li> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2521"> #2521 </a> <code> contains() </code> with an empty string argument leaves Redis hanging at CPU 100% indefinitely (MOD-2428) </li> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2560"> #2560 </a> Free prefix and cursor efficiently for cases with many indices (MOD-2080) </li> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2541"> #2541 </a> Numeric types for <code> FT.INFO </code> on coordinator </li> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2553"> #2553 </a> Fix union high iterator </li> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2404"> #2404 </a> Update coordination strategy of <code> FlatSearchCommandHandler </code> </li> </ul> </li> </ul> <h2 id="v227-february-2022"> v2.2.7 (February 2022) </h2> <p> This is a maintenance release for RediSearch 2.2. </p> <p> Update urgency: <code> MODERATE </code> : Program an upgrade of the server, but it's not urgent. </p> <p> Details: </p> <ul> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2466"> #2466 </a> <code> FT.PROFILE </code> for <code> FT.AGGREGATE </code> on clustered databases </li> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2473"> #2473 </a> <code> FT.PROFILE </code> with no result processor present </li> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2490"> #2490 </a> Case sensitivity issue in searches of TAG field on JSON </li> </ul> </li> <li> <p> Improvements: </p> <ul> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2469"> #2469 </a> Add API for TAG children query nodes </li> </ul> </li> </ul> <h2 id="v226-january-2022"> v2.2.6 (January 2022) </h2> <p> This is a maintenance release for RediSearch 2.2. </p> <p> Update urgency: <code> MODERATE </code> : Program an upgrade of the server, but it's not urgent. </p> <p> Details: </p> <ul> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2362"> #2362 </a> Crash on empty field name </li> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2407"> #2407 </a> Inconsistency with <code> FT.CREATE </code> and <code> ON </code> : return error for spec without fields parameters </li> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2392"> #2392 </a> Remove limit on Geo field precision </li> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2440"> #2440 </a> Fix in NOT(-) iterator </li> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2414"> #2414 </a> Prevent server freeze when <code> FT.SEARCH </code> timeout while sorting </li> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2386"> #2386 </a> Memory leak in numeric field index </li> </ul> </li> <li> <p> Improvements: </p> <ul> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2424"> #2424 </a> , <a href="https://github.com/RediSearch/RediSearch/pull/2425"> #2425 </a> Performance improvements for numeric indices </li> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2408"> #2408 </a> API: Added <code> RediSearch_IndexInfo </code> </li> <li> <a href="https://github.com/RediSearch/RediSearch/pull/2448"> #2448 </a> API: Added <code> setLang </code> and <code> setScore </code> </li> </ul> </li> </ul> <h2 id="v225-november-2021"> v2.2.5 (November 2021) </h2> <p> This is the General Availability release of RediSearch 2.2. </p> <h3 id="headlines"> Headlines </h3> <h4 id="searching-and-indexing-json-documents"> Searching and indexing JSON documents </h4> <p> This release introduces the ability to <a href="/docs/latest/develop/interact/search-and-query/indexing/"> index, query, and full-text search JSON documents </a> using JSONPath queries. </p> <p> On the schema creation <code> FT.CREATE </code> , it is now possible to map a JSONPath query with a field. When a JSON document is indexed, the value extracted by the JSONPath query is indexed in the given field. </p> <p> <em> This features require the module <a href="https://www.redisjson.io"> RedisJSON 2.0 </a> to be installed. </em> </p> <h4 id="profiling-queries"> Profiling queries </h4> <p> With the new <code> FT.PROFILE </code> command, it is now possible to profile in detail the execution time of several internal steps involved in the execution of <code> FT.SEARCH </code> and <code> FT.AGGREGATE </code> . That way, it is possible to understand which part of the query is taking most of the resources. </p> <h4 id="field-aliasing"> Field aliasing </h4> <p> With the support of JSON document indexing, it is now possible to map a JSONPath query to an alias. Therefore, it is possible to index the same value in different indexing attributes with different indexing strategies. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> As of RediSearch v2.2, index <code> fields </code> are now known as <code> attributes </code> in order to avoid confusion with hash fields. This change impacts the <code> FT.INFO </code> command's response, which might break clients. It is advised to upgrade your application to the latest supported Redis clients prior to upgrading to RediSearch 2.2. </div> </div> <h3 id="details"> Details </h3> <ul> <li> <p> Enhancements: </p> <ul> <li> # <a href="https://github.com/redisearch/redisearch/issues/2337"> 2337 </a> Add support for Redis COPY command </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/2243"> 2243 </a> Add <code> LOAD * </code> for <code> FT.AGGREGATE </code> </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/2207"> 2207 </a> Add multi value recursive decent tag </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/2188"> 2188 </a> Add <code> UNF </code> flag for <code> SORTABLE </code> fields </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/2184"> 2184 </a> LLAPI getter functions for score, language, and stopwords list </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/2133"> 2133 </a> JSON array can be stored in a TAG field </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/2153"> 2153 </a> Improve FT.INFO complexity to O(1) </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/2138"> 2138 </a> Add <code> CASESENSITIVE </code> to <code> TAG </code> fields </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/2137"> 2137 </a> <code> FT.INFO </code> has identifier and attribute for fields </li> </ul> </li> <li> <p> Bug fixes: </p> <ul> <li> # <a href="https://github.com/redisearch/redisearch/issues/2341"> 2341 </a> Fix score field for JSON </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/2325"> 2325 </a> Fix escaping for tags </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/2269"> 2269 </a> Remove empty tag values </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/2223"> 2223 </a> Replace NULL with empty iterator for child of negative iterator </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/2215"> 2215 </a> Update field limit on tags </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/2143"> 2143 </a> Partial JSON documents are not indexed </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/2109"> 2109 </a> Field loaded with 'AS' can't be used by functions </li> </ul> </li> </ul> <p> Notes: This is the first GA version of 2.2. The version inside Redis will be 2.2.5 in semantic versioning. <em> Since the version of a module in Redis is numeric, we could not add a GA flag. </em> </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/redisearch-2.2-release-notes/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/develop/data-types/probabilistic/count-min-sketch/.html
<section class="prose w-full py-12"> <h1> Count-min sketch </h1> <p class="text-lg -mt-5 mb-10"> Count-min sketch is a probabilistic data structure that estimates the frequency of an element in a data stream. </p> <p> Count-Min Sketch is a probabilistic data structure in Redis Stack that can be used to estimate the frequency of events/elements in a stream of data. </p> <p> It uses a sub-linear space at the expense of over-counting some events due to collisions. It consumes a stream of events/elements and keeps estimated counters of their frequency. </p> <p> It is very important to know that the results coming from a Count-Min sketch lower than a certain threshold (determined by the error_rate) should be ignored and often even approximated to zero. So Count-Min sketch is indeed a data-structure for counting frequencies of elements in a stream, but it's only useful for higher counts. Very low counts should be ignored as noise. </p> <h2 id="use-cases"> Use cases </h2> <p> <strong> Products (retail, online shops) </strong> </p> <p> This application answers this question: What was the sales volume (on a certain day) for a product? </p> <p> Use one Count-Min sketch created per day (period). Every product sale goes into the CMS. The CMS give reasonably accurate results for the products that contribute the most toward the sales. Products with low percentage of the total sales are ignored. </p> <h2 id="examples"> Examples </h2> <p> Assume you select an error rate of 0.1% (0.001) with a certainty of 99.8% (0.998). This means you have an error probability of 0.02% (0.002). Your sketch strives to keep the error within 0.1% of the total count of all elements you've added. There's a 0.02% chance the error might exceed thisβ€”like when an element below the threshold overlaps with one above it. When you add a few items to the CMS and evaluate their frequency, remember that in such a small sample, collisions are rare, as seen with other probabilistic data structures. </p> <div class="codetabs cli group flex justify-start items-center flex-wrap box-border rounded-lg mt-0 mb-0 mx-auto bg-slate-900" id="cms_tutorial-stepcms"> <input checked="" class="radiotab w-0 h-0" data-lang="redis-cli" id="redis-cli_cms_tutorial-stepcms" name="cms_tutorial-stepcms" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="redis-cli_cms_tutorial-stepcms" title="Open example"> &gt;_ Redis CLI </label> <div aria-labelledby="tab-cms_tutorial-stepcms" class="panel order-last hidden w-full mt-0 relative" id="panel_redis-cli_cms_tutorial-stepcms" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-plaintext" data-lang="plaintext"><span class="line hl"><span class="cl">&gt; CMS.INITBYPROB bikes:profit 0.001 0.002 </span></span><span class="line hl"><span class="cl">OK </span></span><span class="line hl"><span class="cl">&gt; CMS.INCRBY bikes:profit "Smokey Mountain Striker" 100 </span></span><span class="line hl"><span class="cl">(integer) 100 </span></span><span class="line hl"><span class="cl">&gt; CMS.INCRBY bikes:profit "Rocky Mountain Racer" 200 "Cloudy City Cruiser" 150 </span></span><span class="line hl"><span class="cl">1) (integer) 200 </span></span><span class="line hl"><span class="cl">2) (integer) 150 </span></span><span class="line hl"><span class="cl">&gt; CMS.QUERY bikes:profit "Smokey Mountain Striker" "Rocky Mountain Racer" "Cloudy City Cruiser" "Terrible Bike Name" </span></span><span class="line hl"><span class="cl">1) (integer) 100 </span></span><span class="line hl"><span class="cl">2) (integer) 200 </span></span><span class="line hl"><span class="cl">3) (integer) 150 </span></span><span class="line hl"><span class="cl">4) (integer) 0 </span></span><span class="line hl"><span class="cl">&gt; CMS.INFO bikes:profit </span></span><span class="line hl"><span class="cl">1) width </span></span><span class="line hl"><span class="cl">2) (integer) 2000 </span></span><span class="line hl"><span class="cl">3) depth </span></span><span class="line hl"><span class="cl">4) (integer) 9 </span></span><span class="line hl"><span class="cl">5) count </span></span><span class="line hl"><span class="cl">6) (integer) 450</span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_redis-cli_cms_tutorial-stepcms')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <div class="flex-1 text-xs text-white overflow-ellipsis"> Are you tired of using redis-cli? Try Redis Insight - the developer GUI for Redis. </div> <div class="text-right"> <a class="rounded rounded-mx px-2 py-1 flex items-center text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.com/redis-enterprise/redis-insight/" tabindex="1" title="Get Redis Insight"> <svg class="w-4 h-4 mr-1" fill="none" height="14" viewbox="0 0 14 14" width="14" xmlns="http://www.w3.org/2000/svg"> <path d="M2.26236 5.66895L1.21732 6.07172L7.00018 8.65693V7.79842L2.26236 5.66895Z" fill="#fca5a5"> </path> <path d="M2.26236 8.02271L1.21732 8.42548L7.00018 11.0119V10.1516L2.26236 8.02271Z" fill="#fca5a5"> </path> <path d="M1.21732 3.7175L7.00018 6.30392V2.87805L8.66273 2.13423L7.00018 1.49512L1.21732 3.7175Z" fill="#fca5a5"> </path> <path d="M7.00018 2.8781V6.30366L1.21732 3.71724V5.20004L7.00018 7.79705V8.65526L1.21732 6.07217V7.55496L7.00018 10.1553V11.0135L1.21732 8.42376V9.90656H1.18878L7.00018 12.5051L8.66273 11.7613V2.13428L7.00018 2.8781Z" fill="#f87171"> </path> <path d="M9.07336 11.5777L10.7359 10.8338V4.01538L9.07336 4.7592V11.5777Z" fill="#f87171"> </path> <path d="M9.07336 4.75867L10.7359 4.01485L9.07336 3.37573V4.75867Z" fill="#fca5a5"> </path> <path d="M11.1481 10.6497L12.8112 9.90591V5.896L11.1487 6.63982L11.1481 10.6497Z" fill="#f87171"> </path> <path d="M11.1481 6.63954L12.8112 5.89572L11.1481 5.25781V6.63954Z" fill="#fca5a5"> </path> </svg> <span> Get Redis Insight </span> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="python" id="Python_cms_tutorial-stepcms" name="cms_tutorial-stepcms" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Python_cms_tutorial-stepcms" title="Open example"> Python </label> <div aria-labelledby="tab-cms_tutorial-stepcms" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_cms_tutorial-stepcms" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2">Code samples for Count-min sketch doc pages: </span></span></span><span class="line"><span class="cl"><span class="s2"> https://redis.io/docs/latest/develop/data-types/probabilistic/count-min-sketch/ </span></span></span><span class="line"><span class="cl"><span class="s2">"""</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">r</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">Redis</span><span class="p">(</span><span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">res1</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">cms</span><span class="p">()</span><span class="o">.</span><span class="n">initbyprob</span><span class="p">(</span><span class="s2">"bikes:profit"</span><span class="p">,</span> <span class="mf">0.001</span><span class="p">,</span> <span class="mf">0.002</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res1</span><span class="p">)</span> <span class="c1"># &gt;&gt;&gt; True</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">res2</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">cms</span><span class="p">()</span><span class="o">.</span><span class="n">incrby</span><span class="p">(</span><span class="s2">"bikes:profit"</span><span class="p">,</span> <span class="p">[</span><span class="s2">"Smoky Mountain Striker"</span><span class="p">],</span> <span class="p">[</span><span class="mi">100</span><span class="p">])</span> </span></span><span class="line hl"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res2</span><span class="p">)</span> <span class="c1"># &gt;&gt;&gt; [100]</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">res3</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">cms</span><span class="p">()</span><span class="o">.</span><span class="n">incrby</span><span class="p">(</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"bikes:profit"</span><span class="p">,</span> <span class="p">[</span><span class="s2">"Rocky Mountain Racer"</span><span class="p">,</span> <span class="s2">"Cloudy City Cruiser"</span><span class="p">],</span> <span class="p">[</span><span class="mi">200</span><span class="p">,</span> <span class="mi">150</span><span class="p">]</span> </span></span><span class="line hl"><span class="cl"><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res3</span><span class="p">)</span> <span class="c1"># &gt;&gt;&gt; [200, 150]</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">res4</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">cms</span><span class="p">()</span><span class="o">.</span><span class="n">query</span><span class="p">(</span><span class="s2">"bikes:profit"</span><span class="p">,</span> <span class="s2">"Smoky Mountain Striker"</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res4</span><span class="p">)</span> <span class="c1"># &gt;&gt;&gt; [100]</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">res5</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">cms</span><span class="p">()</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"bikes:profit"</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res5</span><span class="o">.</span><span class="n">width</span><span class="p">,</span> <span class="n">res5</span><span class="o">.</span><span class="n">depth</span><span class="p">,</span> <span class="n">res5</span><span class="o">.</span><span class="n">count</span><span class="p">)</span> <span class="c1"># &gt;&gt;&gt; 2000 9 450</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Python_cms_tutorial-stepcms')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Python_cms_tutorial-stepcms" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/python/redis-py/" tabindex="1" title="Quick-Start"> Python Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/redis-py/tree/master/doctests/dt_cms.py" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="javascript" id="Nodejs_cms_tutorial-stepcms" name="cms_tutorial-stepcms" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Nodejs_cms_tutorial-stepcms" title="Open example"> Node.js </label> <div aria-labelledby="tab-cms_tutorial-stepcms" class="panel order-last hidden w-full mt-0 relative" id="panel_Nodejs_cms_tutorial-stepcms" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-javascript" data-lang="javascript"><span class="line"><span class="cl"><span class="kr">import</span> <span class="nx">assert</span> <span class="nx">from</span> <span class="s1">'assert'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="p">{</span> <span class="nx">createClient</span> <span class="p">}</span> <span class="nx">from</span> <span class="s1">'redis'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">client</span> <span class="o">=</span> <span class="nx">createClient</span><span class="p">();</span> </span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">connect</span><span class="p">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">res1</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">cms</span><span class="p">.</span><span class="nx">initByProb</span><span class="p">(</span><span class="s1">'bikes:profit'</span><span class="p">,</span> <span class="mf">0.001</span><span class="p">,</span> <span class="mf">0.002</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res1</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; OK </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">res2</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">cms</span><span class="p">.</span><span class="nx">incrBy</span><span class="p">(</span><span class="s1">'bikes:profit'</span><span class="p">,</span> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="nx">item</span><span class="o">:</span> <span class="s1">'Smoky Mountain Striker'</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="nx">incrementBy</span><span class="o">:</span> <span class="mi">100</span> </span></span><span class="line hl"><span class="cl"><span class="p">});</span> </span></span><span class="line hl"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res2</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; [100] </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">res3</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">cms</span><span class="p">.</span><span class="nx">incrBy</span><span class="p">(</span><span class="s1">'bikes:profit'</span><span class="p">,</span> <span class="p">[</span> </span></span><span class="line hl"><span class="cl"> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="nx">item</span><span class="o">:</span> <span class="s1">'Rocky Mountain Racer'</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="nx">incrementBy</span><span class="o">:</span> <span class="mi">200</span> </span></span><span class="line hl"><span class="cl"> <span class="p">},</span> </span></span><span class="line hl"><span class="cl"> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="nx">item</span><span class="o">:</span> <span class="s1">'Cloudy City Cruiser'</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="nx">incrementBy</span><span class="o">:</span> <span class="mi">150</span> </span></span><span class="line hl"><span class="cl"> <span class="p">}</span> </span></span><span class="line hl"><span class="cl"><span class="p">]);</span> </span></span><span class="line hl"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res3</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; [200, 150] </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">res4</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">cms</span><span class="p">.</span><span class="nx">query</span><span class="p">(</span><span class="s1">'bikes:profit'</span><span class="p">,</span> <span class="s1">'Smoky Mountain Striker'</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res4</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; [100] </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">res5</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">cms</span><span class="p">.</span><span class="nx">info</span><span class="p">(</span><span class="s1">'bikes:profit'</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res5</span><span class="p">.</span><span class="nx">width</span><span class="p">,</span> <span class="nx">res5</span><span class="p">.</span><span class="nx">depth</span><span class="p">,</span> <span class="nx">res5</span><span class="p">.</span><span class="nx">count</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 2000 9 450 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Nodejs_cms_tutorial-stepcms')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Nodejs_cms_tutorial-stepcms" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/nodejs/" tabindex="1" title="Quick-Start"> Node.js Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/node-redis/tree/emb-examples/doctests/dt-cms.js" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="java" id="Java_cms_tutorial-stepcms" name="cms_tutorial-stepcms" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Java_cms_tutorial-stepcms" title="Open example"> Java </label> <div aria-labelledby="tab-cms_tutorial-stepcms" class="panel order-last hidden w-full mt-0 relative" id="panel_Java_cms_tutorial-stepcms" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="kn">package</span> <span class="nn">io.redis.examples</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kd">public</span> <span class="kd">class</span> <span class="nc">CMSExample</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kd">public</span> <span class="kt">void</span> <span class="nf">run</span><span class="o">()</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">UnifiedJedis</span> <span class="n">jedis</span> <span class="o">=</span> <span class="k">new</span> <span class="n">UnifiedJedis</span><span class="o">(</span><span class="s">"redis://localhost:6379"</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="n">String</span> <span class="n">res1</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">cmsInitByProb</span><span class="o">(</span><span class="s">"bikes:profit"</span><span class="o">,</span> <span class="mf">0.001d</span><span class="o">,</span> <span class="mf">0.002d</span><span class="o">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res1</span><span class="o">);</span> <span class="c1">// &gt;&gt;&gt; OK </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"> <span class="kt">long</span> <span class="n">res2</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">cmsIncrBy</span><span class="o">(</span><span class="s">"bikes:profit"</span><span class="o">,</span> <span class="s">"Smoky Mountain Striker"</span><span class="o">,</span> <span class="mi">100L</span><span class="o">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res2</span><span class="o">);</span> <span class="c1">// &gt;&gt;&gt; 100 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Long</span><span class="o">&gt;</span> <span class="n">res3</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">cmsIncrBy</span><span class="o">(</span><span class="s">"bikes:profit"</span><span class="o">,</span> <span class="k">new</span> <span class="n">HashMap</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Long</span><span class="o">&gt;()</span> <span class="o">{{</span> </span></span><span class="line hl"><span class="cl"> <span class="n">put</span><span class="o">(</span><span class="s">"Rocky Mountain Racer"</span><span class="o">,</span> <span class="mi">200L</span><span class="o">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">put</span><span class="o">(</span><span class="s">"Cloudy City Cruiser"</span><span class="o">,</span> <span class="mi">150L</span><span class="o">);</span> </span></span><span class="line hl"><span class="cl"> <span class="o">}});</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res3</span><span class="o">);</span> <span class="c1">// &gt;&gt;&gt; [200, 150] </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Long</span><span class="o">&gt;</span> <span class="n">res4</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">cmsQuery</span><span class="o">(</span><span class="s">"bikes:profit"</span><span class="o">,</span> <span class="s">"Smoky Mountain Striker"</span><span class="o">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res4</span><span class="o">);</span> <span class="c1">// &gt;&gt;&gt; [100] </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"> <span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Object</span><span class="o">&gt;</span> <span class="n">res5</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">cmsInfo</span><span class="o">(</span><span class="s">"bikes:profit"</span><span class="o">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res5</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"width"</span><span class="o">)</span> <span class="o">+</span> <span class="s">" "</span> <span class="o">+</span> <span class="n">res5</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"depth"</span><span class="o">)</span> <span class="o">+</span> <span class="s">" "</span> <span class="o">+</span> <span class="n">res5</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"count"</span><span class="o">));</span> <span class="c1">// &gt;&gt;&gt; 2000 9 450 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="o">}</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="o">}</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Java_cms_tutorial-stepcms')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Java_cms_tutorial-stepcms" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/java/jedis/" tabindex="1" title="Quick-Start"> Java Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/jedis/tree/master/src/test/java/io/redis/examples/CMSExample.java" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="go" id="Go_cms_tutorial-stepcms" name="cms_tutorial-stepcms" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Go_cms_tutorial-stepcms" title="Open example"> Go </label> <div aria-labelledby="tab-cms_tutorial-stepcms" class="panel order-last hidden w-full mt-0 relative" id="panel_Go_cms_tutorial-stepcms" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="kn">package</span> <span class="nx">example_commands_test</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"context"</span> </span></span><span class="line"><span class="cl"> <span class="s">"fmt"</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">"github.com/redis/go-redis/v9"</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kd">func</span> <span class="nf">ExampleClient_cms</span><span class="p">()</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">ctx</span> <span class="o">:=</span> <span class="nx">context</span><span class="p">.</span><span class="nf">Background</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">rdb</span> <span class="o">:=</span> <span class="nx">redis</span><span class="p">.</span><span class="nf">NewClient</span><span class="p">(</span><span class="o">&amp;</span><span class="nx">redis</span><span class="p">.</span><span class="nx">Options</span><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">Addr</span><span class="p">:</span> <span class="s">"localhost:6379"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">Password</span><span class="p">:</span> <span class="s">""</span><span class="p">,</span> <span class="c1">// no password docs </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="nx">DB</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1">// use default DB </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="p">})</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="nx">res1</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">CMSInitByProb</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bikes:profit"</span><span class="p">,</span> <span class="mf">0.001</span><span class="p">,</span> <span class="mf">0.002</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="p">}</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">res1</span><span class="p">)</span> <span class="c1">// &gt;&gt;&gt; OK </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"> <span class="nx">res2</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">CMSIncrBy</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bikes:profit"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s">"Smoky Mountain Striker"</span><span class="p">,</span> <span class="mi">100</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="p">}</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">res2</span><span class="p">)</span> <span class="c1">// &gt;&gt;&gt; [100] </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"> <span class="nx">res3</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">CMSIncrBy</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bikes:profit"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s">"Rocky Mountain Racer"</span><span class="p">,</span> <span class="mi">200</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s">"Cloudy City Cruiser"</span><span class="p">,</span> <span class="mi">150</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="p">}</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">res3</span><span class="p">)</span> <span class="c1">// &gt;&gt;&gt; [200 150] </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"> <span class="nx">res4</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">CMSQuery</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bikes:profit"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s">"Smoky Mountain Striker"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="p">}</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">res4</span><span class="p">)</span> <span class="c1">// &gt;&gt;&gt; [100] </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"> <span class="nx">res5</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">CMSInfo</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"bikes:profit"</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="p">}</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Printf</span><span class="p">(</span><span class="s">"Width: %v, Depth: %v, Count: %v"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="nx">res5</span><span class="p">.</span><span class="nx">Width</span><span class="p">,</span> <span class="nx">res5</span><span class="p">.</span><span class="nx">Depth</span><span class="p">,</span> <span class="nx">res5</span><span class="p">.</span><span class="nx">Count</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="c1">// &gt;&gt;&gt; Width: 2000, Depth: 9, Count: 450 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Go_cms_tutorial-stepcms')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Go_cms_tutorial-stepcms" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/go/" tabindex="1" title="Quick-Start"> Go Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/go-redis/tree/master/doctests/cms_tutorial_test.go" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="dotnet" id="Csharp_cms_tutorial-stepcms" name="cms_tutorial-stepcms" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Csharp_cms_tutorial-stepcms" title="Open example"> C# </label> <div aria-labelledby="tab-cms_tutorial-stepcms" class="panel order-last hidden w-full mt-0 relative" id="panel_Csharp_cms_tutorial-stepcms" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-C#" data-lang="C#"><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.CountMinSketch.DataTypes</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.RedisStackCommands</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.Tests</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">StackExchange.Redis</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">public</span> <span class="k">class</span> <span class="nc">Cms_tutorial</span> </span></span><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">public</span> <span class="k">void</span> <span class="n">run</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">muxer</span> <span class="p">=</span> <span class="n">ConnectionMultiplexer</span><span class="p">.</span><span class="n">Connect</span><span class="p">(</span><span class="s">"localhost:6379"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">db</span> <span class="p">=</span> <span class="n">muxer</span><span class="p">.</span><span class="n">GetDatabase</span><span class="p">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="kt">bool</span> <span class="n">res1</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">CMS</span><span class="p">().</span><span class="n">InitByProb</span><span class="p">(</span><span class="s">"bikes:profit"</span><span class="p">,</span> <span class="m">0.001</span><span class="p">,</span> <span class="m">0.002</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">res1</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; True</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="kt">long</span> <span class="n">res2</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">CMS</span><span class="p">().</span><span class="n">IncrBy</span><span class="p">(</span><span class="s">"bikes:profit"</span><span class="p">,</span> <span class="s">"Smoky Mountain Striker"</span><span class="p">,</span> <span class="m">100</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">res2</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 100</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="kt">long</span><span class="p">[]</span> <span class="n">res3</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">CMS</span><span class="p">().</span><span class="n">IncrBy</span><span class="p">(</span><span class="s">"bikes:profit"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="k">new</span> <span class="n">Tuple</span><span class="p">&lt;</span><span class="n">RedisValue</span><span class="p">,</span> <span class="kt">long</span><span class="p">&gt;[]{</span> </span></span><span class="line hl"><span class="cl"> <span class="k">new</span> <span class="n">Tuple</span><span class="p">&lt;</span><span class="n">RedisValue</span><span class="p">,</span> <span class="kt">long</span><span class="p">&gt;(</span><span class="s">"Rocky Mountain Racer"</span><span class="p">,</span> <span class="m">200</span><span class="p">),</span> </span></span><span class="line hl"><span class="cl"> <span class="k">new</span> <span class="n">Tuple</span><span class="p">&lt;</span><span class="n">RedisValue</span><span class="p">,</span> <span class="kt">long</span><span class="p">&gt;(</span><span class="s">"Cloudy City Cruiser"</span><span class="p">,</span> <span class="m">150</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="p">}</span> </span></span><span class="line hl"><span class="cl"> <span class="p">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="kt">string</span><span class="p">.</span><span class="n">Join</span><span class="p">(</span><span class="s">", "</span><span class="p">,</span> <span class="n">res3</span><span class="p">));</span> <span class="c1">// &gt;&gt;&gt; 200, 150</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="kt">long</span><span class="p">[]</span> <span class="n">res4</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">CMS</span><span class="p">().</span><span class="n">Query</span><span class="p">(</span><span class="s">"bikes:profit"</span><span class="p">,</span> <span class="k">new</span> <span class="n">RedisValue</span><span class="p">[]</span> <span class="p">{</span> <span class="s">"Smoky Mountain Striker"</span> <span class="p">});</span> </span></span><span class="line hl"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="kt">string</span><span class="p">.</span><span class="n">Join</span><span class="p">(</span><span class="s">", "</span><span class="p">,</span> <span class="n">res4</span><span class="p">));</span> <span class="c1">// &gt;&gt;&gt; 100</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="n">CmsInformation</span> <span class="n">res5</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">CMS</span><span class="p">().</span><span class="n">Info</span><span class="p">(</span><span class="s">"bikes:profit"</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">$"Width: {res5.Width}, Depth: {res5.Depth}, Count: {res5.Count}"</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"> <span class="c1">// &gt;&gt;&gt; Width: 2000, Depth: 9, Count: 450</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'cms' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Csharp_cms_tutorial-stepcms')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Csharp_cms_tutorial-stepcms" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/dotnet/" tabindex="1" title="Quick-Start"> C# Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/NRedisStack/tree/master/tests/Doc/Cms_tutorial.cs" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> </div> <h5 id="example-1"> Example 1: </h5> <p> If we had a uniform distribution of 1000 elements where each has a count of around 500 the threshold would be 500: </p> <pre tabindex="0"><code>threshold = error * total_count = 0.001 * (1000*500) = 500 </code></pre> <p> This shows that a CMS is maybe not the best data structure to count frequency of a uniformly distributed stream. Let's try decreasing the error to 0.01%: </p> <pre tabindex="0"><code>threshold = error * total_count = 0.0001 * (1000*500) = 100 </code></pre> <p> This threshold looks more acceptable already, but it means we will need a bigger sketch width <code> w = 2/error = 20 000 </code> and consequently - more memory. </p> <h5 id="example-2"> Example 2: </h5> <p> In another example let's imagine a normal (gaussian) distribution where we have 1000 elements, out of which 800 will have a summed count of 400K (with an average count of 500) and 200 elements will have a much higher summed count of 1.6M (with an average count of 8000), making them the heavy hitters (elephant flow). The threshold after "populating" the sketch with all the 1000 elements would be: </p> <pre tabindex="0"><code>threshold = error * total_count = 0.001 * 2M = 2000 </code></pre> <p> This threshold seems to be sitting comfortably between the 2 average counts 500 and 8000 so the initial chosen error rate should be working well for this case. </p> <h2 id="sizing"> Sizing </h2> <p> Even though the Count-Min sketch is similar to Bloom filter in many ways, its sizing is considerably more complex. The initialisation command receives only two sizing parameters, but you have to understand them thoroughly if you want to have a usable sketch. </p> <pre tabindex="0"><code>CMS.INITBYPROB key error probability </code></pre> <h3 id="1-error"> 1. Error </h3> <p> The <code> error </code> parameter will determine the width <code> w </code> of your sketch and the probability will determine the number of hash functions (depth <code> d </code> ). The error rate we choose will determine the threshold above which we can trust the result from the sketch. The correlation is: </p> <pre tabindex="0"><code>threshold = error * total_count </code></pre> <p> or </p> <pre tabindex="0"><code>error = threshold/total_count </code></pre> <p> where <code> total_count </code> is the sum of the count of all elements that can be obtained from the <code> count </code> key of the result of the <a href="/docs/latest/commands/cms.info/"> <code> CMS.INFO </code> </a> command and is of course dynamic - it changes with every new increment in the sketch. At creation time you can approximate the <code> total_count </code> ratio as a product of the average count you'll be expecting in the sketch and the average number of elements. </p> <p> Since the threshold is a function of the total count in the filter it's very important to note that it will grow as the count grows, but knowing the total count we can always dynamically calculate the threshold. If a result is below it - it can be discarded. </p> <h3 id="2-probability"> 2. Probability </h3> <p> <code> probability </code> in this data structure represents the chance of an element that has a count below the threshold to collide with elements that had a count above the threshold on all sketches/depths thus returning a min-count of a frequently occurring element instead of its own. </p> <h2 id="performance"> Performance </h2> <p> Adding, updating and querying for elements in a CMS has a time complexity O(1). </p> <h2 id="academic-sources"> Academic sources </h2> <ul> <li> <a href="http://dimacs.rutgers.edu/~graham/pubs/papers/cm-full.pdf"> An Improved Data Stream Summary: The Count-Min Sketch and its Applications </a> </li> </ul> <h2 id="references"> References </h2> <ul> <li> <a href="https://redis.com/blog/count-min-sketch-the-art-and-science-of-estimating-stuff/"> Count-Min Sketch: The Art and Science of Estimating Stuff </a> </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/data-types/probabilistic/count-min-sketch/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/swapdb/.html
<section class="prose w-full py-12"> <h1 class="command-name"> SWAPDB </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">SWAPDB index1 index2</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 4.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(N) where N is the count of clients watching or blocking on keys from both databases. </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @keyspace </code> <span class="mr-1 last:hidden"> , </span> <code> @write </code> <span class="mr-1 last:hidden"> , </span> <code> @fast </code> <span class="mr-1 last:hidden"> , </span> <code> @dangerous </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> This command swaps two Redis databases, so that immediately all the clients connected to a given database will see the data of the other database, and the other way around. Example: </p> <pre><code>SWAPDB 0 1 </code></pre> <p> This will swap database 0 with database 1. All the clients connected with database 0 will immediately see the new data, exactly like all the clients connected with database 1 will see the data that was formerly of database 0. </p> <h2 id="examples"> Examples </h2> <pre tabindex="0"><code>SWAPDB 0 1 </code></pre> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#simple-strings"> Simple string reply </a> : <code> OK </code> . <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/swapdb/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/ts.revrange.html
<section class="prose w-full py-12"> <h1 class="command-name"> TS.REVRANGE </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">TS.REVRANGE key fromTimestamp toTimestamp [LATEST] [FILTER_BY_TS ts...] [FILTER_BY_VALUE min max] [COUNT count] [[ALIGN align] AGGREGATION aggregator bucketDuration [BUCKETTIMESTAMP bt] [EMPTY]] </pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available in: </dt> <dd class="m-0"> <a href="/docs/stack"> Redis Stack </a> / <a href="/docs/data-types/timeseries"> TimeSeries 1.4.0 </a> </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> 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 </dd> </dl> <p> Query a range in reverse direction </p> <p> <a href="#examples"> Examples </a> </p> <h2 id="required-arguments"> Required arguments </h2> <details open=""> <summary> <code> key </code> </summary> <p> is the key name for the time series. </p> </details> <details open=""> <summary> <code> fromTimestamp </code> </summary> <p> is start timestamp for the range query (integer Unix timestamp in milliseconds) or <code> - </code> to denote the timestamp of the earliest sample in the time series. </p> </details> <details open=""> <summary> <code> toTimestamp </code> </summary> <p> is end timestamp for the range query (integer Unix timestamp in milliseconds) or <code> + </code> to denote the timestamp of the latest sample in the time series. </p> <p> <note> <b> Note: </b> When the time series is a compaction, the last compacted value may aggregate raw values with timestamp beyond <code> toTimestamp </code> . That is because <code> toTimestamp </code> limits only the timestamp of the compacted value, which is the start time of the raw bucket that was compacted. </note> </p> </details> <h2 id="optional-arguments"> Optional arguments </h2> <details open=""> <summary> <code> LATEST </code> (since RedisTimeSeries v1.8) </summary> <p> is used when a time series is a compaction. With <code> LATEST </code> , TS.REVRANGE also reports the compacted value of the latest, possibly partial, bucket, given that this bucket's start time falls within <code> [fromTimestamp, toTimestamp] </code> . Without <code> LATEST </code> , TS.REVRANGE does not report the latest, possibly partial, bucket. When a time series is not a compaction, <code> LATEST </code> is ignored. </p> <p> The data in the latest bucket of a compaction is possibly partial. A bucket is <em> closed </em> and compacted only upon arrival of a new sample that <em> opens </em> a new <em> latest </em> bucket. There are cases, however, when the compacted value of the latest, possibly partial, bucket is also required. In such a case, use <code> LATEST </code> . </p> </details> <details open=""> <summary> <code> FILTER_BY_TS ts... </code> (since RedisTimeSeries v1.6) </summary> <p> filters samples by a list of specific timestamps. A sample passes the filter if its exact timestamp is specified and falls within <code> [fromTimestamp, toTimestamp] </code> . </p> <p> When used together with <code> AGGREGATION </code> : samples are filtered before being aggregated. </p> </details> <details open=""> <summary> <code> FILTER_BY_VALUE min max </code> (since RedisTimeSeries v1.6) </summary> <p> filters samples by minimum and maximum values. </p> <p> When used together with <code> AGGREGATION </code> : samples are filtered before being aggregated. </p> </details> <details open=""> <summary> <code> COUNT count </code> </summary> <p> When used without <code> AGGREGATION </code> : limits the number of reported samples. </p> <p> When used together with <code> AGGREGATION </code> : limits the number of reported buckets. </p> </details> <details open=""> <summary> <code> ALIGN align </code> (since RedisTimeSeries v1.6) </summary> <p> is a time bucket alignment control for <code> AGGREGATION </code> . It controls the time bucket timestamps by changing the reference timestamp on which a bucket is defined. Values include: </p> <ul> <li> <code> start </code> or <code> - </code> : The reference timestamp will be the query start interval time ( <code> fromTimestamp </code> ) which can't be <code> - </code> </li> <li> <code> end </code> or <code> + </code> : The reference timestamp will be the query end interval time ( <code> toTimestamp </code> ) which can't be <code> + </code> </li> <li> A specific timestamp: align the reference timestamp to a specific time </li> </ul> <p> <note> <b> NOTE: </b> When not provided, alignment is set to <code> 0 </code> . </note> </p> </details> <details open=""> <summary> <code> AGGREGATION aggregator bucketDuration </code> </summary> aggregates samples into time buckets, where: <ul> <li> <p> <code> aggregator </code> takes one of the following aggregation types: </p> <table> <thead> <tr> <th> <code> aggregator </code> </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <code> avg </code> </td> <td> Arithmetic mean of all values </td> </tr> <tr> <td> <code> sum </code> </td> <td> Sum of all values </td> </tr> <tr> <td> <code> min </code> </td> <td> Minimum value </td> </tr> <tr> <td> <code> max </code> </td> <td> Maximum value </td> </tr> <tr> <td> <code> range </code> </td> <td> Difference between the maximum and the minimum value </td> </tr> <tr> <td> <code> count </code> </td> <td> Number of values </td> </tr> <tr> <td> <code> first </code> </td> <td> Value with lowest timestamp in the bucket </td> </tr> <tr> <td> <code> last </code> </td> <td> Value with highest timestamp in the bucket </td> </tr> <tr> <td> <code> std.p </code> </td> <td> Population standard deviation of the values </td> </tr> <tr> <td> <code> std.s </code> </td> <td> Sample standard deviation of the values </td> </tr> <tr> <td> <code> var.p </code> </td> <td> Population variance of the values </td> </tr> <tr> <td> <code> var.s </code> </td> <td> Sample variance of the values </td> </tr> <tr> <td> <code> twa </code> </td> <td> Time-weighted average over the bucket's timeframe (since RedisTimeSeries v1.8) </td> </tr> </tbody> </table> </li> <li> <p> <code> bucketDuration </code> is duration of each bucket, in milliseconds. </p> </li> </ul> <p> Without <code> ALIGN </code> , bucket start times are multiples of <code> bucketDuration </code> . </p> <p> With <code> ALIGN align </code> , bucket start times are multiples of <code> bucketDuration </code> with remainder <code> align % bucketDuration </code> . </p> <p> The first bucket start time is less than or equal to <code> fromTimestamp </code> . </p> </details> <details open=""> <summary> <code> [BUCKETTIMESTAMP bt] </code> (since RedisTimeSeries v1.8) </summary> <p> controls how bucket timestamps are reported. </p> <table> <thead> <tr> <th> <code> bt </code> </th> <th> Timestamp reported for each bucket </th> </tr> </thead> <tbody> <tr> <td> <code> - </code> or <code> start </code> </td> <td> the bucket's start time (default) </td> </tr> <tr> <td> <code> + </code> or <code> end </code> </td> <td> the bucket's end time </td> </tr> <tr> <td> <code> ~ </code> or <code> mid </code> </td> <td> the bucket's mid time (rounded down if not an integer) </td> </tr> </tbody> </table> </details> <details open=""> <summary> <code> [EMPTY] </code> (since RedisTimeSeries v1.8) </summary> is a flag, which, when specified, reports aggregations also for empty buckets. <table> <thead> <tr> <th> <code> aggregator </code> </th> <th> Value reported for each empty bucket </th> </tr> </thead> <tbody> <tr> <td> <code> sum </code> , <code> count </code> </td> <td> <code> 0 </code> </td> </tr> <tr> <td> <code> last </code> </td> <td> The value of the last sample before the bucket's start. <code> NaN </code> when no such sample. </td> </tr> <tr> <td> <code> twa </code> </td> <td> Average value over the bucket's timeframe based on linear interpolation of the last sample before the bucket's start and the first sample after the bucket's end. <code> NaN </code> when no such samples. </td> </tr> <tr> <td> <code> min </code> , <code> max </code> , <code> range </code> , <code> avg </code> , <code> first </code> , <code> std.p </code> , <code> std.s </code> </td> <td> <code> NaN </code> </td> </tr> </tbody> </table> <p> Regardless of the values of <code> fromTimestamp </code> and <code> toTimestamp </code> , no data is reported for buckets that end before the earliest sample or begin after the latest sample in the time series. </p> </details> <h2 id="return-value"> Return value </h2> <p> Returns one of these replies: </p> <ul> <li> <a href="/docs/latest/develop/reference/protocol-spec/#arrays"> Array reply </a> of ( <a href="/docs/latest/develop/reference/protocol-spec/#integers"> Integer reply </a> , <a href="/docs/latest/develop/reference/protocol-spec/#simple-strings"> Simple string reply </a> ) pairs representing (timestamp, value(double)) </li> <li> [] (e.g., on invalid filter value) </li> </ul> <h2 id="complexity"> Complexity </h2> <p> TS.REVRANGE complexity can be improved in the future by using binary search to find the start of the range, which makes this <code> O(Log(n/m)+k*m) </code> . But, because <code> m </code> is small, you can disregard it and look at the operation as <code> O(Log(n)+k) </code> . </p> <h2 id="examples"> Examples </h2> <details open=""> <summary> <b> Filter results by timestamp or sample value </b> </summary> <p> Consider a metric where acceptable values are between -100 and 100, and the value 9999 is used as an indication of bad measurement. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.CREATE temp:TLV LABELS <span class="nb">type</span> temp location TLV </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.MADD temp:TLV <span class="m">1000</span> <span class="m">30</span> temp:TLV <span class="m">1010</span> <span class="m">35</span> temp:TLV <span class="m">1020</span> <span class="m">9999</span> temp:TLV <span class="m">1030</span> <span class="m">40</span> </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1000</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1010</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1020</span> </span></span><span class="line"><span class="cl">4<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1030</span></span></span></code></pre> </div> <p> Now, retrieve all values except out-of-range values. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">TS.REVRANGE temp:TLV - + FILTER_BY_VALUE -100 <span class="m">100</span> </span></span><span class="line"><span class="cl">1<span class="o">)</span> 1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1030</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="m">40</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> 1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1010</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="m">35</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> 1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1000</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="m">30</span></span></span></code></pre> </div> <p> Now, retrieve the average value, while ignoring out-of-range values. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">TS.REVRANGE temp:TLV - + FILTER_BY_VALUE -100 <span class="m">100</span> AGGREGATION avg <span class="m">1000</span> </span></span><span class="line"><span class="cl">1<span class="o">)</span> 1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1000</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="m">35</span></span></span></code></pre> </div> </details> <details open=""> <summary> <b> Align aggregation buckets </b> </summary> <p> To demonstrate alignment, let’s create a stock and add prices at three different timestamps. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.CREATE stock:A LABELS <span class="nb">type</span> stock name A </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.MADD stock:A <span class="m">1000</span> <span class="m">100</span> stock:A <span class="m">1010</span> <span class="m">110</span> stock:A <span class="m">1020</span> <span class="m">120</span> </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1000</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1010</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1020</span> </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.MADD stock:A <span class="m">2000</span> <span class="m">200</span> stock:A <span class="m">2010</span> <span class="m">210</span> stock:A <span class="m">2020</span> <span class="m">220</span> </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">2000</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">2010</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">2020</span> </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.MADD stock:A <span class="m">3000</span> <span class="m">300</span> stock:A <span class="m">3010</span> <span class="m">310</span> stock:A <span class="m">3020</span> <span class="m">320</span> </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">3000</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">3010</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">3020</span></span></span></code></pre> </div> <p> Next, aggregate without using <code> ALIGN </code> , defaulting to alignment 0. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.REVRANGE stock:A - + AGGREGATION min <span class="m">20</span> </span></span><span class="line"><span class="cl">1<span class="o">)</span> 1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">3020</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="m">320</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> 1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">3000</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="m">300</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> 1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">2020</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="m">220</span> </span></span><span class="line"><span class="cl">4<span class="o">)</span> 1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">2000</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="m">200</span> </span></span><span class="line"><span class="cl">5<span class="o">)</span> 1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1020</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="m">120</span> </span></span><span class="line"><span class="cl">6<span class="o">)</span> 1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1000</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="m">100</span></span></span></code></pre> </div> <p> And now set <code> ALIGN </code> to 10 to have a bucket start at time 10, and align all the buckets with a 20 milliseconds duration. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.REVRANGE stock:A - + ALIGN <span class="m">10</span> AGGREGATION min <span class="m">20</span> </span></span><span class="line"><span class="cl">1<span class="o">)</span> 1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">3010</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="m">310</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> 1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">2990</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="m">300</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> 1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">2010</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="m">210</span> </span></span><span class="line"><span class="cl">4<span class="o">)</span> 1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1990</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="m">200</span> </span></span><span class="line"><span class="cl">5<span class="o">)</span> 1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1010</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="m">110</span> </span></span><span class="line"><span class="cl">6<span class="o">)</span> 1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">990</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="m">100</span></span></span></code></pre> </div> <p> When the start timestamp for the range query is explicitly stated (not <code> - </code> ), you can set ALIGN to that time by setting align to <code> - </code> or to <code> start </code> . </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.REVRANGE stock:A <span class="m">5</span> + ALIGN - AGGREGATION min <span class="m">20</span> </span></span><span class="line"><span class="cl">1<span class="o">)</span> 1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">3005</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="m">310</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> 1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">2985</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="m">300</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> 1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">2005</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="m">210</span> </span></span><span class="line"><span class="cl">4<span class="o">)</span> 1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1985</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="m">200</span> </span></span><span class="line"><span class="cl">5<span class="o">)</span> 1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1005</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="m">110</span> </span></span><span class="line"><span class="cl">6<span class="o">)</span> 1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">985</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="m">100</span></span></span></code></pre> </div> <p> Similarly, when the end timestamp for the range query is explicitly stated, you can set ALIGN to that time by setting align to <code> + </code> or to <code> end </code> . </p> </details> <h2 id="see-also"> See also </h2> <p> <a href="/docs/latest/commands/ts.range/"> <code> TS.RANGE </code> </a> | <a href="/docs/latest/commands/ts.mrange/"> <code> TS.MRANGE </code> </a> | <a href="/docs/latest/commands/ts.mrevrange/"> <code> TS.MREVRANGE </code> </a> </p> <h2 id="related-topics"> Related topics </h2> <p> <a href="/docs/latest/develop/data-types/timeseries/"> RedisTimeSeries </a> </p> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/ts.revrange/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/ft.search.html
<section class="prose w-full py-12"> <h1 class="command-name"> FT.SEARCH </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-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 m | km | mi | ft [ GEOFILTER geo_field lon lat radius m | km | mi | ft ...]] [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] [WITHCOUNT]] [LIMIT offset num] [PARAMS nargs name value [ name value ...]] [DIALECT dialect] </pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available in: </dt> <dd class="m-0"> <a href="/docs/stack"> Redis Stack </a> / <a href="/docs/interact/search-and-query"> Search 1.0.0 </a> </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(N) </dd> </dl> <p> Search the index with a textual query, returning either documents or just ids </p> <p> <a href="#examples"> Examples </a> </p> <h2 id="required-arguments"> Required arguments </h2> <details open=""> <summary> <code> index </code> </summary> <p> is index name. You must first create the index using <a href="/docs/latest/commands/ft.create/"> <code> FT.CREATE </code> </a> . </p> </details> <details open=""> <summary> <code> query </code> </summary> <p> is text query to search. If it's more than a single word, put it in quotes. Refer to <a href="/docs/latest/develop/interact/search-and-query/query/"> Query syntax </a> for more details. </p> </details> <h2 id="optional-arguments"> Optional arguments </h2> <details open=""> <summary> <code> NOCONTENT </code> </summary> <p> returns the document ids and not the content. This is useful if RediSearch is only an index on an external document collection. </p> </details> <details open=""> <summary> <code> VERBATIM </code> </summary> <p> does not try to use stemming for query expansion but searches the query terms verbatim. </p> </details> <details open=""> <summary> <code> WITHSCORES </code> </summary> <p> also returns the relative internal score of each document. This can be used to merge results from multiple instances. </p> </details> <details open=""> <summary> <code> WITHPAYLOADS </code> </summary> <p> retrieves optional document payloads. See <a href="/docs/latest/commands/ft.create/"> <code> FT.CREATE </code> </a> . The payloads follow the document id and, if <code> WITHSCORES </code> is set, the scores. </p> </details> <details open=""> <summary> <code> WITHSORTKEYS </code> </summary> <p> returns the value of the sorting key, right after the id and score and/or payload, if requested. This is usually not needed, and exists for distributed search coordination purposes. This option is relevant only if used in conjunction with <code> SORTBY </code> . </p> </details> <details open=""> <summary> <code> FILTER numeric_attribute min max </code> </summary> <p> limits results to those having numeric values ranging between <code> min </code> and <code> max </code> , if numeric_attribute is defined as a numeric attribute in <a href="/docs/latest/commands/ft.create/"> <code> FT.CREATE </code> </a> . <code> min </code> and <code> max </code> follow <a href="/docs/latest/commands/zrange/"> <code> ZRANGE </code> </a> syntax, and can be <code> -inf </code> , <code> +inf </code> , and use <code> ( </code> for exclusive ranges. Multiple numeric filters for different attributes are supported in one query. <strong> Deprecated since v2.10 </strong> : <a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/dialects/#dialect-2"> Query dialect 2 </a> explains the query syntax for numeric fields that replaces this argument. </p> </details> <details open=""> <summary> <code> GEOFILTER {geo_attribute} {lon} {lat} {radius} m|km|mi|ft </code> </summary> <p> filter the results to a given <code> radius </code> from <code> lon </code> and <code> lat </code> . Radius is given as a number and units. See <a href="/docs/latest/commands/georadius/"> <code> GEORADIUS </code> </a> for more details. <strong> Deprecated since v2.6 </strong> : <a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/dialects/#dialect-3"> Query dialect 3 </a> explains the query syntax for geospatial fields that replaces this argument. </p> </details> <details open=""> <summary> <code> INKEYS {num} {attribute} ... </code> </summary> <p> limits the result to a given set of keys specified in the list. The first argument must be the length of the list and greater than zero. Non-existent keys are ignored, unless all the keys are non-existent. </p> </details> <details open=""> <summary> <code> INFIELDS {num} {attribute} ... </code> </summary> <p> filters the results to those appearing only in specific attributes of the document, like <code> title </code> or <code> URL </code> . You must include <code> num </code> , which is the number of attributes you're filtering by. For example, if you request <code> title </code> and <code> URL </code> , then <code> num </code> is 2. </p> </details> <details open=""> <summary> <code> RETURN {num} {identifier} AS {property} ... </code> </summary> <p> limits the attributes returned from the document. <code> num </code> is the number of attributes following the keyword. If <code> num </code> is 0, it acts like <code> NOCONTENT </code> . <code> identifier </code> is either an attribute name (for hashes and JSON) or a JSON Path expression (for JSON). <code> property </code> is an optional name used in the result. If not provided, the <code> identifier </code> is used in the result. </p> </details> <details open=""> <summary> <code> SUMMARIZE ... </code> </summary> <p> returns only the sections of the attribute that contain the matched text. See <a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/highlight/"> Highlighting </a> for more information. </p> </details> <details open=""> <summary> <code> HIGHLIGHT ... </code> </summary> <p> formats occurrences of matched text. See <a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/highlight/"> Highlighting </a> for more information. </p> </details> <details open=""> <summary> <code> SLOP {slop} </code> </summary> <p> is the number of intermediate terms allowed to appear between the terms of the query. Suppose you're searching for a phrase <em> hello world </em> . If some terms appear in-between <em> hello </em> and <em> world </em> , a <code> SLOP </code> greater than <code> 0 </code> allows for these text attributes to match. By default, there is no <code> SLOP </code> constraint. </p> </details> <details open=""> <summary> <code> INORDER </code> </summary> <p> requires the terms in the document to have the same order as the terms in the query, regardless of the offsets between them. Typically used in conjunction with <code> SLOP </code> . Default is <code> false </code> . </p> </details> <details open=""> <summary> <code> LANGUAGE {language} </code> </summary> <p> use a stemmer for the supplied language during search for query expansion. If querying documents in Chinese, set to <code> chinese </code> to properly tokenize the query terms. Defaults to English. If an unsupported language is sent, the command returns an error. See <a href="/docs/latest/commands/ft.create/"> <code> FT.CREATE </code> </a> for the list of languages. If <code> LANGUAGE </code> was specified as part of index creation, it doesn't need to specified with <code> FT.SEARCH </code> . </p> </details> <details open=""> <summary> <code> EXPANDER {expander} </code> </summary> <p> uses a custom query expander instead of the stemmer. See <a href="/docs/latest/develop/interact/search-and-query/administration/extensions/"> Extensions </a> . </p> </details> <details open=""> <summary> <code> SCORER {scorer} </code> </summary> <p> uses a <a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/scoring/"> built-in </a> or a <a href="/docs/latest/develop/interact/search-and-query/administration/extensions/"> user-provided </a> scoring function. </p> </details> <details open=""> <summary> <code> EXPLAINSCORE </code> </summary> <p> returns a textual description of how the scores were calculated. Using this option requires <code> WITHSCORES </code> . </p> </details> <details open=""> <summary> <code> PAYLOAD {payload} </code> </summary> <p> adds an arbitrary, binary safe payload that is exposed to custom scoring functions. See <a href="/docs/latest/develop/interact/search-and-query/administration/extensions/"> Extensions </a> . </p> </details> <details open=""> <summary> <code> SORTBY {attribute} [ASC|DESC] [WITHCOUNT] </code> </summary> <p> orders the results by the value of this attribute. This applies to both text and numeric attributes. Attributes needed for <code> SORTBY </code> should be declared as <code> SORTABLE </code> in the index, in order to be available with very low latency. Note that this adds memory overhead. </p> <p> <strong> Sorting Optimizations </strong> : performance is optimized for sorting operations on <code> DIALECT 4 </code> in different scenarios: </p> <ul> <li> Skip Sorter - applied when there is no sort of any kind. The query can return after it reaches the <code> LIMIT </code> requested results. </li> <li> Partial Range - applied when there is a <code> SORTBY </code> clause over a numeric field, with no filter or filter by the same numeric field, the query iterate on a range large enough to satisfy the <code> LIMIT </code> requested results. </li> <li> Hybrid - applied when there is a <code> SORTBY </code> clause over a numeric field and another non-numeric filter. Some results will get filtered, and the initial range may not be large enough. The iterator is then rewinding with the following ranges, and an additional iteration takes place to collect the <code> LIMIT </code> requested results. </li> <li> No optimization - If there is a sort by score or by non-numeric field, there is no other option but to retrieve all results and compare their values. </li> </ul> <p> <strong> Counts behavior </strong> : optional <code> WITHCOUNT </code> argument returns accurate counts for the query results with sorting. This operation processes all results in order to get an accurate count, being less performant than the optimized option (default behavior on <code> DIALECT 4 </code> ) </p> </details> <details open=""> <summary> <code> LIMIT first num </code> </summary> <p> limits the results to the offset and number of results given. Note that the offset is zero-indexed. The default is 0 10, which returns 10 items starting from the first result. You can use <code> LIMIT 0 0 </code> to count the number of documents in the result set without actually returning them. </p> <p> <strong> <code> LIMIT </code> behavior </strong> : If you use the <code> LIMIT </code> option without sorting, the results returned are non-deterministic, which means that subsequent queries may return duplicated or missing values. Add <code> SORTBY </code> with a unique field, or use <code> FT.AGGREGATE </code> with the <code> WITHCURSOR </code> option to ensure deterministic result set paging. </p> </details> <details open=""> <summary> <code> TIMEOUT {milliseconds} </code> </summary> <p> overrides the timeout parameter of the module. </p> </details> <details open=""> <summary> <code> PARAMS {nargs} {name} {value} </code> </summary> <p> defines one or more value parameters. Each parameter has a name and a value. </p> <p> You can reference parameters in the <code> query </code> by a <code> $ </code> , followed by the parameter name, for example, <code> $user </code> . Each such reference in the search query to a parameter name is substituted by the corresponding parameter value. For example, with parameter definition <code> PARAMS 4 lon 29.69465 lat 34.95126 </code> , the expression <code> @loc:[$lon $lat 10 km] </code> is evaluated to <code> @loc:[29.69465 34.95126 10 km] </code> . You cannot reference parameters in the query string where concrete values are not allowed, such as in field names, for example, <code> @loc </code> . To use <code> PARAMS </code> , set <a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/dialects/#dialect-2"> <code> DIALECT </code> </a> to <code> 2 </code> or greater than <code> 2 </code> (this requires <a href="https://github.com/RediSearch/RediSearch/releases/tag/v2.4.3"> RediSearch v2.4 </a> or above). </p> </details> <details open=""> <summary> <code> DIALECT {dialect_version} </code> </summary> <p> selects the dialect version under which to execute the query. If not specified, the query will execute under the default dialect version set during module initial loading or via <a href="/docs/latest/commands/ft.config-set/"> <code> FT.CONFIG SET </code> </a> command. See <a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/dialects/"> Query dialects </a> for more information. </p> </details> <h2 id="return"> Return </h2> <p> FT.SEARCH returns an array reply, where the first element is an integer reply of the total number of results, and then array reply pairs of document ids, and array replies of attribute/value pairs. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Notes: </div> <ul> <li> If <code> NOCONTENT </code> is given, an array is returned where the first element is the total number of results, and the rest of the members are document ids. </li> <li> If a relevant key expires while a query is running, an attempt to load the key's value will return a null array. However, the key is still counted in the total number of results. </li> </ul> </div> </div> <h3 id="return-multiple-values"> Return multiple values </h3> <p> When the index is defined <code> ON JSON </code> , a reply for a single attribute or a single JSONPath may return multiple values when the JSONPath matches multiple values, or when the JSONPath matches an array. </p> <p> Prior to RediSearch v2.6, only the first of the matched values was returned. Starting with RediSearch v2.6, all values are returned, wrapped with a top-level array. </p> <p> In order to maintain backward compatibility, the default behavior with RediSearch v2.6 is to return only the first value. </p> <p> To return all the values, use <code> DIALECT </code> 3 (or greater, when available). </p> <p> The <code> DIALECT </code> can be specified as a parameter in the FT.SEARCH command. If it is not specified, the <code> DEFAULT_DIALECT </code> is used, which can be set using <a href="/docs/latest/commands/ft.config-set/"> <code> FT.CONFIG SET </code> </a> or by passing it as an argument to the <code> redisearch </code> module when it is loaded. </p> <p> For example, with the following document and index: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">127.0.0.1:6379&gt; JSON.SET doc:1 $ <span class="s1">'[{"arr": [1, 2, 3]}, {"val": "hello"}, {"val": "world"}]'</span> </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.CREATE idx ON JSON PREFIX <span class="m">1</span> doc: SCHEMA $..arr AS arr NUMERIC $..val AS val TEXT </span></span><span class="line"><span class="cl">OK </span></span></code></pre> </div> <p> Notice the different replies, with and without <code> DIALECT 3 </code> : </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH idx * RETURN <span class="m">2</span> arr val </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"doc:1"</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> 1<span class="o">)</span> <span class="s2">"arr"</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"[1,2,3]"</span> </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> <span class="s2">"val"</span> </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="s2">"hello"</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH idx * RETURN <span class="m">2</span> arr val DIALECT <span class="m">3</span> </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"doc:1"</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> 1<span class="o">)</span> <span class="s2">"arr"</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"[[1,2,3]]"</span> </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> <span class="s2">"val"</span> </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="s2">"[\"hello\",\"world\"]"</span> </span></span></code></pre> </div> <h2 id="complexity"> Complexity </h2> <p> FT.SEARCH complexity is O(n) for single word queries. <code> n </code> is the number of the results in the result set. Finding all the documents that have a specific term is O(1), however, a scan on all those documents is needed to load the documents data from redis hashes and return them. </p> <p> The time complexity for more complex queries varies, but in general it's proportional to the number of words, the number of intersection points between them and the number of results in the result set. </p> <h2 id="examples"> Examples </h2> <details open=""> <summary> <b> Search for a term in every text attribute </b> </summary> <p> Search for the term "wizard" in every TEXT attribute of an index containing book data. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH books-idx <span class="s2">"wizard"</span></span></span></code></pre> </div> </details> <details open=""> <summary> <b> Search for a term in title attribute </b> </summary> <p> Search for the term <em> dogs </em> in the <code> title </code> attribute. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH books-idx <span class="s2">"@title:dogs"</span></span></span></code></pre> </div> </details> <details open=""> <summary> <b> Search for books from specific years </b> </summary> <p> Search for books published in 2020 or 2021. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH books-idx <span class="s2">"@published_at:[2020 2021]"</span></span></span></code></pre> </div> </details> <details open=""> <summary> <b> Search for a restaurant by distance from longitude/latitude </b> </summary> <p> Search for Chinese restaurants within 5 kilometers of longitude -122.41, latitude 37.77 (San Francisco). </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH restaurants-idx <span class="s2">"chinese @location:[-122.41 37.77 5 km]"</span></span></span></code></pre> </div> </details> <details open=""> <summary> <b> Search for a book by terms but boost specific term </b> </summary> <p> Search for the term <em> dogs </em> or <em> cats </em> in the <code> title </code> attribute, but give matches of <em> dogs </em> a higher relevance score (also known as <em> boosting </em> ). </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH books-idx <span class="s2">"(@title:dogs | @title:cats) | (@title:dogs) =&gt; { </span><span class="nv">$weight</span><span class="s2">: 5.0; }"</span></span></span></code></pre> </div> </details> <details open=""> <summary> <b> Search for a book by a term and EXPLAINSCORE </b> </summary> <p> Search for books with <em> dogs </em> in any TEXT attribute in the index and request an explanation of scoring for each result. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH books-idx <span class="s2">"dogs"</span> WITHSCORES EXPLAINSCORE</span></span></code></pre> </div> </details> <details open=""> <summary> <b> Search for a book by a term and TAG </b> </summary> <p> Search for books with <em> space </em> in the title that have <code> science </code> in the TAG attribute <code> categories </code> . </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH books-idx <span class="s2">"@title:space @categories:{science}"</span></span></span></code></pre> </div> </details> <details open=""> <summary> <b> Search for a book by a term but limit the number </b> </summary> <p> Search for books with <em> Python </em> in any <code> TEXT </code> attribute, returning 10 results starting with the 11th result in the entire result set (the offset parameter is zero-based), and return only the <code> title </code> attribute for each result. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH books-idx <span class="s2">"python"</span> LIMIT <span class="m">10</span> <span class="m">10</span> RETURN <span class="m">1</span> title</span></span></code></pre> </div> </details> <details open=""> <summary> <b> Search for a book by a term and price </b> </summary> <p> Search for books with <em> Python </em> in any <code> TEXT </code> attribute, returning the price stored in the original JSON document. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH books-idx <span class="s2">"python"</span> RETURN <span class="m">3</span> $.book.price AS price</span></span></code></pre> </div> </details> <details open=""> <summary> <b> Search for a book by title and distance </b> </summary> <p> Search for books with semantically similar title to <em> Planet Earth </em> . Return top 10 results sorted by distance. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH books-idx <span class="s2">"*=&gt;[KNN 10 @title_embedding </span><span class="nv">$query_vec</span><span class="s2"> AS title_score]"</span> PARAMS <span class="m">2</span> query_vec &lt;<span class="s2">"Planet Earth"</span> embedding BLOB&gt; SORTBY title_score DIALECT <span class="m">2</span></span></span></code></pre> </div> </details> <details open=""> <summary> <b> Search for a phrase using SLOP </b> </summary> <p> Search for a phrase <em> hello world </em> . First, create an index. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.CREATE memes SCHEMA phrase TEXT </span></span><span class="line"><span class="cl">OK</span></span></code></pre> </div> <p> Add variations of the phrase <em> hello world </em> . </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; HSET s1 phrase <span class="s2">"hello world"</span> </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; HSET s2 phrase <span class="s2">"hello simple world"</span> </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; HSET s3 phrase <span class="s2">"hello somewhat less simple world"</span> </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; HSET s4 phrase <span class="s2">"hello complicated yet encouraging problem solving world"</span> </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; HSET s5 phrase <span class="s2">"hello complicated yet amazingly encouraging problem solving world"</span> </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span></span></span></code></pre> </div> <p> Then, search for the phrase <em> hello world </em> . The result returns all documents that contain the phrase. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH memes <span class="s1">'@phrase:(hello world)'</span> NOCONTENT </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">5</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"s1"</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> <span class="s2">"s2"</span> </span></span><span class="line"><span class="cl">4<span class="o">)</span> <span class="s2">"s3"</span> </span></span><span class="line"><span class="cl">5<span class="o">)</span> <span class="s2">"s4"</span> </span></span><span class="line"><span class="cl">6<span class="o">)</span> <span class="s2">"s5"</span></span></span></code></pre> </div> <p> Now, return all documents that have one of fewer words between <em> hello </em> and <em> world </em> . </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH memes <span class="s1">'@phrase:(hello world)'</span> NOCONTENT SLOP <span class="m">1</span> </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">2</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"s1"</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> <span class="s2">"s2"</span></span></span></code></pre> </div> <p> Now, return all documents with three or fewer words between <em> hello </em> and <em> world </em> . </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH memes <span class="s1">'@phrase:(hello world)'</span> NOCONTENT SLOP <span class="m">3</span> </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">3</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"s1"</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> <span class="s2">"s2"</span> </span></span><span class="line"><span class="cl">4<span class="o">)</span> <span class="s2">"s3"</span></span></span></code></pre> </div> <p> <code> s5 </code> needs a higher <code> SLOP </code> to match, <code> SLOP 6 </code> or higher, to be exact. See what happens when you set <code> SLOP </code> to <code> 5 </code> . </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH memes <span class="s1">'@phrase:(hello world)'</span> NOCONTENT SLOP <span class="m">5</span> </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">4</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"s1"</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> <span class="s2">"s2"</span> </span></span><span class="line"><span class="cl">4<span class="o">)</span> <span class="s2">"s3"</span> </span></span><span class="line"><span class="cl">5<span class="o">)</span> <span class="s2">"s4"</span></span></span></code></pre> </div> <p> If you add additional terms (and stemming), you get these results. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH memes <span class="s1">'@phrase:(hello amazing world)'</span> NOCONTENT </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"s5"</span></span></span></code></pre> </div> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH memes <span class="s1">'@phrase:(hello encouraged world)'</span> NOCONTENT SLOP <span class="m">5</span> </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">2</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"s4"</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> <span class="s2">"s5"</span></span></span></code></pre> </div> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH memes <span class="s1">'@phrase:(hello encouraged world)'</span> NOCONTENT SLOP <span class="m">4</span> </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"s4"</span></span></span></code></pre> </div> <p> If you swap the terms, you can still retrieve the correct phrase. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH memes <span class="s1">'@phrase:(amazing hello world)'</span> NOCONTENT </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"s5"</span></span></span></code></pre> </div> <p> But, if you use <code> INORDER </code> , you get zero results. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH memes <span class="s1">'@phrase:(amazing hello world)'</span> NOCONTENT INORDER </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span></span></span></code></pre> </div> <p> Likewise, if you use a query attribute <code> $inorder </code> set to <code> true </code> , <code> s5 </code> is not retrieved. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH memes <span class="s1">'@phrase:(amazing hello world)=&gt;{$inorder: true;}'</span> NOCONTENT </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span></span></span></code></pre> </div> <p> To sum up, the <code> INORDER </code> argument or <code> $inorder </code> query attribute require the query terms to match terms with similar ordering. </p> </details> <details open=""> <summary> <b> Polygon Search with WITHIN, CONTAINS, INTERSECTS, and DISJOINT operators </b> </summary> <p> Query for polygons which: </p> <ul> <li> contain a given geoshape </li> <li> are within a given geoshape </li> <li> intersect with a given geoshape </li> <li> are disjoint (nothing in common) with a given shape </li> </ul> <p> <code> INTERSECTS </code> and <code> DISJOINT </code> were introduced in v2.10. </p> <p> First, create an index using <code> GEOSHAPE </code> type with a <code> FLAT </code> coordinate system: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.CREATE idx SCHEMA geom GEOSHAPE FLAT </span></span><span class="line"><span class="cl">OK</span></span></code></pre> </div> <p> Adding a couple of geometries using <a href="/docs/latest/commands/hset/"> <code> HSET </code> </a> : </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; HSET small geom <span class="s1">'POLYGON((1 1, 1 100, 100 100, 100 1, 1 1))'</span> </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; HSET large geom <span class="s1">'POLYGON((1 1, 1 200, 200 200, 200 1, 1 1))'</span> </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span></span></span></code></pre> </div> <p> Query with <code> WITHIN </code> operator: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH idx <span class="s1">'@geom:[WITHIN $poly]'</span> PARAMS <span class="m">2</span> poly <span class="s1">'POLYGON((0 0, 0 150, 150 150, 150 0, 0 0))'</span> DIALECT <span class="m">3</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"small"</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> 1<span class="o">)</span> <span class="s2">"geom"</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"POLYGON((1 1, 1 100, 100 100, 100 1, 1 1))"</span></span></span></code></pre> </div> <p> Query with <code> CONTAINS </code> operator: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SEARCH idx <span class="s1">'@geom:[CONTAINS $poly]'</span> PARAMS <span class="m">2</span> poly <span class="s1">'POLYGON((2 2, 2 50, 50 50, 50 2, 2 2))'</span> DIALECT <span class="m">3</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">2</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"small"</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> 1<span class="o">)</span> <span class="s2">"geom"</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"POLYGON((1 1, 1 100, 100 100, 100 1, 1 1))"</span> </span></span><span class="line"><span class="cl">4<span class="o">)</span> <span class="s2">"large"</span> </span></span><span class="line"><span class="cl">5<span class="o">)</span> 1<span class="o">)</span> <span class="s2">"geom"</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"POLYGON((1 1, 1 200, 200 200, 200 1, 1 1))"</span></span></span></code></pre> </div> </details> <h2 id="see-also"> See also </h2> <p> <a href="/docs/latest/commands/ft.create/"> <code> FT.CREATE </code> </a> | <a href="/docs/latest/commands/ft.aggregate/"> <code> FT.AGGREGATE </code> </a> </p> <h2 id="related-topics"> Related topics </h2> <ul> <li> <a href="/docs/latest/develop/interact/search-and-query/administration/extensions/"> Extensions </a> </li> <li> <a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/highlight/"> Highlighting </a> </li> <li> <a href="/docs/latest/develop/interact/search-and-query/query/"> Query syntax </a> </li> <li> <a href="/docs/latest/develop/interact/search-and-query/"> RediSearch </a> </li> </ul> <br/> <h2> History </h2> <ul> <li> Starting with Redis version 2.0.0: Deprecated <code> WITHPAYLOADS </code> and <code> PAYLOAD </code> arguments </li> <li> Starting with Redis version 2.6: Deprecated <code> GEOFILTER </code> argument </li> <li> Starting with Redis version 2.10: Deprecated <code> FILTER </code> argument </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/ft.search/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/acl/.html
<section class="prose w-full py-12"> <h1 class="command-name"> ACL </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">ACL</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 6.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> Depends on subcommand. </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> This is a container command for <a href="/docs/latest/operate/oss_and_stack/management/security/acl/"> Access Control List </a> commands. </p> <p> To see the list of available commands you can call <a href="/docs/latest/commands/acl-help/"> <code> ACL HELP </code> </a> . </p> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/acl/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/sort/.html
<section class="prose w-full py-12"> <h1 class="command-name"> SORT </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">SORT key [BYΒ pattern] [LIMITΒ offset count] [GETΒ pattern [GET pattern ...]] [ASC | DESC] [ALPHA] [STOREΒ destination]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 1.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> 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). </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @write </code> <span class="mr-1 last:hidden"> , </span> <code> @set </code> <span class="mr-1 last:hidden"> , </span> <code> @sortedset </code> <span class="mr-1 last:hidden"> , </span> <code> @list </code> <span class="mr-1 last:hidden"> , </span> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> <code> @dangerous </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Returns or stores the elements contained in the <a href="/develop/data-types#lists"> list </a> , <a href="/develop/data-types#set"> set </a> or <a href="/develop/data-types#sorted-sets"> sorted set </a> at <code> key </code> . </p> <p> There is also the <a href="/docs/latest/commands/sort_ro/"> <code> SORT_RO </code> </a> read-only variant of this command. </p> <p> By default, sorting is numeric and elements are compared by their value interpreted as double precision floating point number. This is <code> SORT </code> in its simplest form: </p> <pre tabindex="0"><code>SORT mylist </code></pre> <p> Assuming <code> mylist </code> is a list of numbers, this command will return the same list with the elements sorted from small to large. In order to sort the numbers from large to small, use the <code> DESC </code> modifier: </p> <pre tabindex="0"><code>SORT mylist DESC </code></pre> <p> When <code> mylist </code> contains string values and you want to sort them lexicographically, use the <code> ALPHA </code> modifier: </p> <pre tabindex="0"><code>SORT mylist ALPHA </code></pre> <p> Redis is UTF-8 aware, assuming you correctly set the <code> LC_COLLATE </code> environment variable. </p> <p> The number of returned elements can be limited using the <code> LIMIT </code> modifier. This modifier takes the <code> offset </code> argument, specifying the number of elements to skip and the <code> count </code> argument, specifying the number of elements to return from starting at <code> offset </code> . The following example will return 10 elements of the sorted version of <code> mylist </code> , starting at element 0 ( <code> offset </code> is zero-based): </p> <pre tabindex="0"><code>SORT mylist LIMIT 0 10 </code></pre> <p> Almost all modifiers can be used together. The following example will return the first 5 elements, lexicographically sorted in descending order: </p> <pre tabindex="0"><code>SORT mylist LIMIT 0 5 ALPHA DESC </code></pre> <h2 id="sorting-by-external-keys"> Sorting by external keys </h2> <p> Sometimes you want to sort elements using external keys as weights to compare instead of comparing the actual elements in the list, set or sorted set. Let's say the list <code> mylist </code> contains the elements <code> 1 </code> , <code> 2 </code> and <code> 3 </code> representing unique IDs of objects stored in <code> object_1 </code> , <code> object_2 </code> and <code> object_3 </code> . When these objects have associated weights stored in <code> weight_1 </code> , <code> weight_2 </code> and <code> weight_3 </code> , <code> SORT </code> can be instructed to use these weights to sort <code> mylist </code> with the following statement: </p> <pre tabindex="0"><code>SORT mylist BY weight_* </code></pre> <p> The <code> BY </code> option takes a pattern (equal to <code> weight_* </code> in this example) that is used to generate the keys that are used for sorting. These key names are obtained substituting the first occurrence of <code> * </code> with the actual value of the element in the list ( <code> 1 </code> , <code> 2 </code> and <code> 3 </code> in this example). </p> <h2 id="skip-sorting-the-elements"> Skip sorting the elements </h2> <p> The <code> BY </code> option can also take a non-existent key, which causes <code> SORT </code> to skip the sorting operation. This is useful if you want to retrieve external keys (see the <code> GET </code> option below) without the overhead of sorting. </p> <pre tabindex="0"><code>SORT mylist BY nosort </code></pre> <h2 id="retrieving-external-keys"> Retrieving external keys </h2> <p> Our previous example returns just the sorted IDs. In some cases, it is more useful to get the actual objects instead of their IDs ( <code> object_1 </code> , <code> object_2 </code> and <code> object_3 </code> ). Retrieving external keys based on the elements in a list, set or sorted set can be done with the following command: </p> <pre tabindex="0"><code>SORT mylist BY weight_* GET object_* </code></pre> <p> The <code> GET </code> option can be used multiple times in order to get more keys for every element of the original list, set or sorted set. </p> <p> It is also possible to <code> GET </code> the element itself using the special pattern <code> # </code> : </p> <pre tabindex="0"><code>SORT mylist BY weight_* GET object_* GET # </code></pre> <h2 id="restrictions-for-using-external-keys"> Restrictions for using external keys </h2> <p> Before 7.4, when enabling <code> Redis cluster-mode </code> there is no way to guarantee the existence of the external keys on the node which the command is processed on. In this case, any use of <a href="/docs/latest/commands/get/"> <code> GET </code> </a> or <code> BY </code> which reference external key pattern will cause the command to fail with an error. </p> <p> Starting from 7.4, pattern with hash tag can be mapped to a slot, and so in <code> Redis cluster-mode </code> , the use of <code> BY </code> or <a href="/docs/latest/commands/get/"> <code> GET </code> </a> is allowed when pattern contains hash tag and implies a specific slot which the key is also in, which means any key matching this pattern must be in the same slot as the key, and therefore in the same node. For example, in cluster mode, <code> {mylist}weight_* </code> is acceptable as a pattern when sorting <code> mylist </code> , while pattern <code> {abc}weight_* </code> will be denied, causing the command to fail with an error. </p> <p> To use pattern with hash tag, see <a href="/docs/latest/operate/oss_and_stack/reference/cluster-spec#hash-tags"> Hash tags </a> for more information. </p> <p> Starting from Redis 7.0, any use of <a href="/docs/latest/commands/get/"> <code> GET </code> </a> or <code> BY </code> which reference external key pattern will only be allowed in case the current user running the command has full key read permissions. Full key read permissions can be set for the user by, for example, specifying <code> '%R~*' </code> or <code> '~* </code> with the relevant command access rules. You can check the <a href="/docs/latest/commands/acl-setuser/"> <code> ACL SETUSER </code> </a> command manual for more information on setting ACL access rules. If full key read permissions aren't set, the command will fail with an error. </p> <h2 id="storing-the-result-of-a-sort-operation"> Storing the result of a SORT operation </h2> <p> By default, <code> SORT </code> returns the sorted elements to the client. With the <code> STORE </code> option, the result will be stored as a list at the specified key instead of being returned to the client. </p> <pre tabindex="0"><code>SORT mylist BY weight_* STORE resultkey </code></pre> <p> An interesting pattern using <code> SORT ... STORE </code> consists in associating an <a href="/docs/latest/commands/expire/"> <code> EXPIRE </code> </a> timeout to the resulting key so that in applications where the result of a <code> SORT </code> operation can be cached for some time. Other clients will use the cached list instead of calling <code> SORT </code> for every request. When the key will timeout, an updated version of the cache can be created by calling <code> SORT ... STORE </code> again. </p> <p> Note that for correctly implementing this pattern it is important to avoid multiple clients rebuilding the cache at the same time. Some kind of locking is needed here (for instance using <a href="/docs/latest/commands/setnx/"> <code> SETNX </code> </a> ). </p> <h2 id="using-hashes-in-by-and-get"> Using hashes in <code> BY </code> and <code> GET </code> </h2> <p> It is possible to use <code> BY </code> and <code> GET </code> options against hash fields with the following syntax: </p> <pre tabindex="0"><code>SORT mylist BY weight_*-&gt;fieldname GET object_*-&gt;fieldname </code></pre> <p> The string <code> -&gt; </code> is used to separate the key name from the hash field name. The key is substituted as documented above, and the hash stored at the resulting key is accessed to retrieve the specified hash field. </p> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> : without passing the <em> STORE </em> option, the command returns a list of sorted elements. <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : when the <em> STORE </em> option is specified, the command returns the number of sorted elements in the destination list. <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/sort/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/zinter/.html
<section class="prose w-full py-12"> <h1 class="command-name"> ZINTER </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">ZINTER numkeys key [key ...] [WEIGHTSΒ weight [weight ...]] [AGGREGATEΒ &lt;SUM | MIN | MAX&gt;] [WITHSCORES]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 6.2.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> 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. </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @read </code> <span class="mr-1 last:hidden"> , </span> <code> @sortedset </code> <span class="mr-1 last:hidden"> , </span> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> This command is similar to <a href="/docs/latest/commands/zinterstore/"> <code> ZINTERSTORE </code> </a> , but instead of storing the resulting sorted set, it is returned to the client. </p> <p> For a description of the <code> WEIGHTS </code> and <code> AGGREGATE </code> options, see <a href="/docs/latest/commands/zunionstore/"> <code> ZUNIONSTORE </code> </a> . </p> <h2 id="examples"> Examples </h2> <div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex"> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z"> </path> </svg> </div> <form class="redis-cli overflow-y-auto max-h-80"> <pre tabindex="0">redis&gt; ZADD zset1 1 "one" (integer) 1 redis&gt; ZADD zset1 2 "two" (integer) 1 redis&gt; ZADD zset2 1 "one" (integer) 1 redis&gt; ZADD zset2 2 "two" (integer) 1 redis&gt; ZADD zset2 3 "three" (integer) 1 redis&gt; ZINTER 2 zset1 zset2 1) "one" 2) "two" redis&gt; ZINTER 2 zset1 zset2 WITHSCORES 1) "one" 2) "2" 3) "two" 4) "4" </pre> <div class="prompt" style=""> <span> redis&gt; </span> <input autocomplete="off" name="prompt" spellcheck="false" type="text"/> </div> </form> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <ul> <li> <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> : the result of the intersection including, optionally, scores when the <em> WITHSCORES </em> option is used. </li> </ul> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/zinter/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/slowlog-reset/.html
<section class="prose w-full py-12"> <h1 class="command-name"> SLOWLOG RESET </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">SLOWLOG RESET</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 2.2.12 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(N) where N is the number of entries in the slowlog </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @admin </code> <span class="mr-1 last:hidden"> , </span> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> <code> @dangerous </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> This command resets the slow log, clearing all entries in it. </p> <p> Once deleted the information is lost forever. </p> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#simple-strings"> Simple string reply </a> : <code> OK </code> . <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/slowlog-reset/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/security/certificates/create-certificates/.html
<section class="prose w-full py-12 max-w-none"> <h1> Create certificates </h1> <p class="text-lg -mt-5 mb-10"> Create self-signed certificates to install on a Redis Enterprise cluster. </p> <p> When you first install Redis Enterprise Software, self-signed certificates are created to enable encryption for Redis Enterprise endpoints. These certificates expire after a year (365 days) and must be renewed. </p> <p> You can renew these certificates by replacing them with new self-signed certificates or by replacing them with certificates signed by a <a href="https://en.wikipedia.org/wiki/Certificate_authority"> certificate authority </a> (CA). </p> <h2 id="renew-self-signed-certificates"> Renew self-signed certificates </h2> <p> As of <a href="/docs/latest/operate/rs/release-notes/rs-6-2-18-releases/rs-6-2-18-70/"> v6.2.18-70 </a> , Redis Enterprise Software includes a script to generate self-signed certificates. </p> <p> By default, the <code> generate_self_signed_certs.sh </code> script is located in <code> /opt/redislabs/utils/ </code> . </p> <p> Here, you learn how to use this script to generate new certificates and how to install them. </p> <h3 id="step-1-generate-new-certificates"> Step 1: Generate new certificates </h3> <p> Sign in to the machine hosting the cluster's master node and then run the following command: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">% sudo -u redislabs /opt/redislabs/utils/generate_self_signed_certs.sh <span class="se">\ </span></span></span><span class="line"><span class="cl"><span class="se"></span> -f <span class="s2">"&lt;DomainName1 DomainName2&gt;"</span> -d &lt;Days&gt; -t &lt;Type&gt; </span></span></code></pre> </div> <p> where: </p> <ul> <li> <p> <em> &lt;DomainName1&gt; </em> is the fully qualified domain name (FQDN) of the cluster. (This is the name given to the cluster when first created.) </p> </li> <li> <p> <em> &lt;DomainName2&gt; </em> is an optional FQDN for the cluster. Multiple domain names are allowed, separated by whitespace. Quotation marks ( <code> "" </code> ) should enclose the full set of names. </p> </li> <li> <p> <em> &lt;Days&gt; </em> is an integer specifying the number of days the certificate should be valid. We recommend against setting this longer than a year (365 days). </p> <p> <em> &lt;Days&gt; </em> is optional and defaults to <code> 365 </code> . </p> </li> <li> <p> <em> &lt;Type&gt; </em> is a string identifying the name of the certificate to generate. </p> <p> The following values are supported: </p> <table> <thead> <tr> <th> Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <code> api </code> </td> <td> The REST API </td> </tr> <tr> <td> <code> cm </code> </td> <td> The Cluster Manager UI </td> </tr> <tr> <td> <code> metrics </code> </td> <td> The metrics exporter </td> </tr> <tr> <td> <code> proxy </code> </td> <td> The database endpoint </td> </tr> <tr> <td> <code> syncer </code> </td> <td> The synchronization process </td> </tr> <tr> <td> <code> all </code> </td> <td> Generates all certificates in a single operation </td> </tr> </tbody> </table> <p> <em> Type </em> is optional and defaults to <code> all </code> . </p> </li> </ul> <p> When you run the script, it either reports success ( <code> "Self signed cert generated successfully" </code> ) or an error message. Use the error message to troubleshoot any issues. </p> <p> The following example generates all self signed certificates for <code> mycluster.example.com </code> ; these certificates expire one year after the command is run: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ sudo -u redislabs /opt/redislabs/utils/generate_self_signed_certs.sh <span class="se">\ </span></span></span><span class="line"><span class="cl"><span class="se"></span> -f <span class="s2">"mycluster.example.com"</span><span class="sb">`</span> </span></span></code></pre> </div> <p> Suppose you want to create a Cluster Manager UI certificate to support two clusters for a period of two years. The following example shows how: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ sudo -u redislabs /opt/redislabs/utils/generate_self_signed_certs.sh <span class="se">\ </span></span></span><span class="line"><span class="cl"><span class="se"></span> -f <span class="s2">"mycluster.example.com anothercluster.example.com"</span> -d <span class="m">730</span> -t cm </span></span></code></pre> </div> <p> Here, a certificate file and certificate key are generated to support the following domains: </p> <div class="highlight"> <pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">mycluster.example.com </span></span><span class="line"><span class="cl">*.mycluster.example.com </span></span><span class="line"><span class="cl">anothercluster.example.com </span></span><span class="line"><span class="cl">*.anothercluster.example.com </span></span></code></pre> </div> <h3 id="step-2-locate-the-new-certificate-files"> Step 2: Locate the new certificate files </h3> <p> When successful, the script generates two .PEM files for each generated certificate: a certificate file and a certificate key, each named after the type of certificate generated (see earlier table for individual certificate names.) </p> <p> These files can be found in the <code> /tmp </code> directory. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ ls -la /tmp/*.pem </span></span></code></pre> </div> <h3 id="step-3-set-permissions"> Step 3: Set permissions </h3> <p> We recommend setting the permissions of your new certificate files to limit read and write access to the file owner and to set group and other user permissions to read access. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ sudo chmod <span class="m">644</span> /tmp/*.pem </span></span></code></pre> </div> <h3 id="replace-self-signed"> Step 4: Replace existing certificates </h3> <p> You can use <code> rladmin </code> to replace the existing certificates with new certificates: </p> <div class="highlight"> <pre class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span> rladmin cluster certificate <span class="nb">set</span> &lt;CertName&gt; certificate_file <span class="se">\ </span></span></span><span class="line"><span class="cl"><span class="se"></span><span class="go"> &lt;CertFilename&gt;.pem key_file &lt;KeyFilename&gt;.pem </span></span></span></code></pre> </div> <p> The following values are supported for the <em> &lt;CertName&gt; </em> parameter: </p> <table> <thead> <tr> <th> Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <code> api </code> </td> <td> The REST API </td> </tr> <tr> <td> <code> cm </code> </td> <td> The Cluster Manager UI </td> </tr> <tr> <td> <code> metrics_exporter </code> </td> <td> The metrics exporter </td> </tr> <tr> <td> <code> proxy </code> </td> <td> The database endpoint </td> </tr> <tr> <td> <code> syncer </code> </td> <td> The synchronization process </td> </tr> </tbody> </table> <p> You can also use the REST API. To learn more, see <a href="/docs/latest/operate/rs/7.4/security/certificates/updating-certificates/#how-to-update-certificates"> Update certificates </a> . </p> <h2 id="create-ca-signed-certificates"> Create CA-signed certificates </h2> <p> You can use certificates signed by a <a href="https://en.wikipedia.org/wiki/Certificate_authority"> certificate authority </a> (CA). </p> <p> For best results, use the following guidelines to create the certificates. </p> <h3 id="tls-certificate-guidelines"> TLS certificate guidelines </h3> <p> When you create certificates signed by a certificate authority, you need to create server certificates and client certificates. The following provide guidelines that apply to both certificates and guidance for each certificate type. </p> <h4 id="guidelines-for-server-and-client-certificates"> Guidelines for server and client certificates </h4> <ol> <li> <p> Include the full <a href="https://en.wikipedia.org/wiki/X.509#Certificate_chains_and_cross-certification"> certificate chain </a> when creating certificate .PEM files for either server or client certificates. </p> </li> <li> <p> List ( <em> chain </em> ) certificates in the .PEM file in the following order: </p> <div class="highlight"> <pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">-----BEGIN CERTIFICATE----- </span></span><span class="line"><span class="cl">Domain (leaf) certificate </span></span><span class="line"><span class="cl">-----END CERTIFICATE----- </span></span><span class="line"><span class="cl">-----BEGIN CERTIFICATE----- </span></span><span class="line"><span class="cl">Intermediate CA certificate </span></span><span class="line"><span class="cl">-----END CERTIFICATE---- </span></span><span class="line"><span class="cl">-----BEGIN CERTIFICATE----- </span></span><span class="line"><span class="cl">Trusted Root CA certificate </span></span><span class="line"><span class="cl">-----END CERTIFICATE----- </span></span></code></pre> </div> </li> </ol> <h4 id="server-certificate-guidelines"> Server certificate guidelines </h4> <p> Server certificates support clusters. </p> <p> In addition to the general guidelines described earlier, the following guidelines apply to server certificates: </p> <ol> <li> <p> Use the cluster's fully qualified domain name (FQDN) as the certificate Common Name (CN). </p> </li> <li> <p> Set the following values according to the values specified by your security team or certificate authority: </p> <ul> <li> Country Name (C) </li> <li> State or Province Name (ST) </li> <li> Locality Name (L) </li> <li> Organization Name (O) </li> <li> Organization Unit (OU) </li> </ul> </li> <li> <p> The <a href="https://en.wikipedia.org/wiki/Subject_Alternative_Name"> Subject Alternative Name </a> (SAN) should include the following values based on the FQDN: </p> <div class="highlight"> <pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">dns=&lt;cluster-fqdn&gt; </span></span><span class="line"><span class="cl">dns=*.&lt;cluster-fqdn&gt; </span></span><span class="line"><span class="cl">dns=internal.&lt;cluster-fqdn&gt; </span></span><span class="line"><span class="cl">dns=*.internal.&lt;cluster-fqdn&gt; </span></span></code></pre> </div> </li> <li> <p> The Extended Key Usage attribute should be set to <code> TLS Web Client Authentication </code> and <code> TLS Web Server Authentication </code> . </p> </li> <li> <p> We strongly recommend using a strong hash algorithm, such as <nobr> SHA-256 </nobr> or <nobr> SHA-512 </nobr> . </p> <p> Individual operating systems might limit access to specific algorithms. For example, Ubuntu 20.04 <a href="https://manpages.ubuntu.com/manpages/focal/man7/crypto-policies.7.html"> limits access </a> to <nobr> SHA-1 </nobr> . In such cases, Redis Enterprise Software is limited to the features supported by the underlying operating system. </p> </li> </ol> <h4 id="client-certificate-guidelines"> Client certificate guidelines </h4> <p> Client certificates support database connections. </p> <p> In addition to the general guidelines described earlier, the following guidelines apply to client certificates: </p> <ol> <li> <p> The Extended Key Usage attribute should be set to <code> TLS Web Client Authentication </code> . </p> </li> <li> <p> We strongly recommend using a strong hash algorithm, such as <nobr> SHA-256 </nobr> or <nobr> SHA-512 </nobr> . </p> <p> Individual operating systems might limit access to specific algorithms. For example, Ubuntu 20.04 <a href="https://manpages.ubuntu.com/manpages/focal/man7/crypto-policies.7.html"> limits access </a> to <nobr> SHA-1 </nobr> . In such cases, Redis Enterprise Software is limited to the features supported by the underlying operating system. </p> </li> </ol> <h3 id="create-certificates"> Create certificates </h3> <p> The actual process of creating CA-signed certificates varies according to the CA. In addition, your security team may have custom instructions that you need to follow. </p> <p> Here, we demonstrate the general process using OpenSSL. If your CA provides alternate tools, you should use those according to their instructions. </p> <p> However you choose to create the certificates, be sure to incorporate the guidelines described earlier. </p> <ol> <li> <p> Create a private key. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ openssl genrsa -out &lt;key-file-name&gt;.pem <span class="m">2048</span> </span></span></code></pre> </div> </li> <li> <p> Create a certificate signing request. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ openssl req -new -key &lt;key-file-name&gt;.pem -out <span class="se">\ </span></span></span><span class="line"><span class="cl"><span class="se"></span> &lt;key-file-name&gt;.csr -config &lt;csr-config-file&gt;.cnf </span></span></code></pre> </div> <p> <em> Important: </em> The .CNF file is a configuration file. Check with your security team or certificate authority for help creating a valid configuration file for your environment. </p> </li> <li> <p> Sign the private key using your certificate authority. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ openssl x509 -req -in &lt;key-file-name&gt;.csr -signkey &lt;key-file-name&gt;.pem -out &lt;cert-name&gt;.pem </span></span></code></pre> </div> <p> The signing process varies for each organization and CA vendor. Consult your security team and certificate authority for specific instructions describing how to sign a certificate. </p> </li> <li> <p> Upload the certificate to your cluster. </p> <p> You can use <a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/cluster/certificate/"> <code> rladmin </code> </a> to replace the existing certificates with new certificates: </p> <div class="highlight"> <pre class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span> rladmin cluster certificate <span class="nb">set</span> &lt;cert-name&gt; certificate_file <span class="se">\ </span></span></span><span class="line"><span class="cl"><span class="se"></span><span class="go"> &lt;cert-name&gt;.pem key_file &lt;key-file-name&gt;.pem </span></span></span></code></pre> </div> <p> For a list of values supported by the <code> &lt;cert-name&gt; </code> parameter, see the <a href="#replace-self-signed"> earlier table </a> . </p> <p> You can also use the REST API. To learn more, see <a href="/docs/latest/operate/rs/7.4/security/certificates/updating-certificates/#how-to-update-certificates"> Update certificates </a> . </p> </li> </ol> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/security/certificates/create-certificates/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/ssubscribe/.html
<section class="prose w-full py-12"> <h1 class="command-name"> SSUBSCRIBE </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">SSUBSCRIBE shardchannel [shardchannel ...]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 7.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(N) where N is the number of shard channels to subscribe to. </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @pubsub </code> <span class="mr-1 last:hidden"> , </span> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Subscribes the client to the specified shard channels. </p> <p> In a Redis cluster, shard channels are assigned to slots by the same algorithm used to assign keys to slots. Client(s) can subscribe to a node covering a slot (primary/replica) to receive the messages published. All the specified shard channels needs to belong to a single slot to subscribe in a given <code> SSUBSCRIBE </code> call, A client can subscribe to channels across different slots over separate <code> SSUBSCRIBE </code> call. </p> <p> For more information about sharded Pub/Sub, see <a href="/docs/latest/develop/interact/pubsub/#sharded-pubsub"> Sharded Pub/Sub </a> . </p> <h2 id="examples"> Examples </h2> <pre tabindex="0"><code>&gt; ssubscribe orders Reading messages... (press Ctrl-C to quit) 1) "ssubscribe" 2) "orders" 3) (integer) 1 1) "smessage" 2) "orders" 3) "hello" </code></pre> <h2 id="resp2-reply"> RESP2 Reply </h2> When successful, this command doesn't return anything. Instead, for each shard channel, one message with the first element being the string <code> ssubscribe </code> is pushed as a confirmation that the command succeeded. Note that this command can also return a -MOVED redirect. <h2 id="resp3-reply"> RESP3 Reply </h2> When successful, this command doesn't return anything. Instead, for each shard channel, one message with the first element being the string 'ssubscribe' is pushed as a confirmation that the command succeeded. Note that this command can also return a -MOVED redirect. <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/ssubscribe/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/grouptopk.html
<section class="prose w-full py-12"> <h1> Commands </h1> </section>
https://redis.io/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/.html
<section class="prose w-full py-12 max-w-none"> <h1> Redis Enterprise Software release notes 7.2.4 </h1> <p class="text-lg -mt-5 mb-10"> Redis 7.0 and 7.2 features. Auto Tiering (enhanced successor to Redis on Flash). RESP3 support. Sharded pub/sub. Preview of the new Cluster Manager UI. Redis Stack 7.2 features. Three Redis database versions. License file structure updates. Redis ACL selectors and enhanced key-based permissions. New INFO fields. Log rotation enhancements. Multi-OS upgrade support for clusters with modules. </p> <p> ​ <a href="https://redis.com/redis-enterprise-software/download-center/software/"> ​Redis Enterprise Software version 7.2.4 </a> is now available! </p> <h2 id="highlights"> Highlights </h2> <p> This version offers: </p> <ul> <li> <p> Redis 7.0 and 7.2 features </p> </li> <li> <p> Auto Tiering (enhanced successor to Redis on Flash) </p> </li> <li> <p> RESP3 support </p> </li> <li> <p> Sharded pub/sub </p> </li> <li> <p> A preview of the new Cluster Manager UI (admin console) </p> </li> <li> <p> Redis Stack 7.2 features </p> </li> <li> <p> Three Redis database versions: 7.2, 6.2, 6.0 </p> </li> <li> <p> License file structure updates </p> </li> <li> <p> Redis ACL selectors and enhanced key-based permissions </p> </li> <li> <p> New INFO fields </p> </li> <li> <p> Log rotation enhancements </p> </li> <li> <p> Multi-OS upgrade support for clusters with modules </p> </li> </ul> <h2 id="detailed-release-notes"> Detailed release notes </h2> <p> For more detailed release notes, select a build version from the following table: </p> <table> <thead> <tr> <th style="text-align:left"> VersionΒ (ReleaseΒ date) </th> <th style="text-align:left"> Major changes </th> <th style="text-align:left"> OSSΒ Redis compatibility </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-109/"> 7.2.4-109 (May 2024) </a> </td> <td style="text-align:left"> Bug fixes. </td> <td style="text-align:left"> Redis 7.2.0 </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-105/"> 7.2.4-105 (February 2024) </a> </td> <td style="text-align:left"> LDAP authentication timeout is configurable using the REST API. RHEL 8.9 support. </td> <td style="text-align:left"> Redis 7.2.0 </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-92/"> 7.2.4-92 (November 2023) </a> </td> <td style="text-align:left"> New Cluster Manager UI enhancements - LDAP configuration improvements. New `capability_name` field added to module REST API object. Automatic removal of deprecated, predefined roles and ACLs upon cluster upgrade, unless they are associated with any users or databases. </td> <td style="text-align:left"> Redis 7.2.0 </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-72/"> 7.2.4-72 (October 2023) </a> </td> <td style="text-align:left"> New Cluster Manager UI enhancements - database upgrade configuration, database defaults, user lockout parameters, and TLS configuration improvements. </td> <td style="text-align:left"> Redis 7.2.0 </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-64/"> 7.2.4-64 (September 2023) </a> </td> <td style="text-align:left"> Improved cluster recovery with manually uploaded modules. Support package contains supervisorctl status. Configure port range using rladmin and REST API. License API returns the number of used shards (RAM &amp; flash). </td> <td style="text-align:left"> Redis 7.2.0 </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-52/"> 7.2.4-52 (August 2023) </a> </td> <td style="text-align:left"> Redis 7.0 and 7.2 features. Auto Tiering (enhanced successor to Redis on Flash). RESP3 support. Sharded pub/sub. Preview of the new Cluster Manager UI. Redis Stack 7.2 features. Three Redis database versions. License file structure updates. Redis ACL selectors and enhanced key-based permissions. New INFO fields. Log rotation enhancements. Multi-OS upgrade support for clusters with modules. </td> <td style="text-align:left"> Redis 7.2.0 </td> </tr> </tbody> </table> <h2 id="version-changes"> Version changes </h2> <h3 id="breaking-changes"> Breaking changes </h3> <p> For a list of potentially breaking changes introduced in version 7.2, see: </p> <ul> <li> <p> <a href="/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-52/#breaking-changes"> Breaking changes </a> </p> </li> <li> <p> <a href="/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-52/#redis-72-breaking-changes"> Redis 7.2 breaking changes </a> </p> </li> </ul> <p> To prevent potential application issues due to RESP3 breaking changes, see <a href="/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-52/#client-prerequisites-for-redis-72-upgrade"> Client prerequisites for Redis 7.2 upgrade </a> . </p> <h3 id="deprecations"> Deprecations </h3> <h4 id="command-deprecations"> Command deprecations </h4> <ul> <li> <p> <a href="/docs/latest/commands/cluster-slots/"> <code> CLUSTER SLOTS </code> </a> is deprecated as of Redis 7.0 </p> </li> <li> <p> <a href="/docs/latest/commands/json.resp"> <code> JSON.RESP </code> </a> is deprecated as of Redis Stack 7.2. </p> </li> <li> <p> <a href="/docs/latest/commands/quit/"> <code> QUIT </code> </a> is deprecated as of Redis 7.2 </p> </li> </ul> <h4 id="api-deprecations"> API deprecations </h4> <p> Fields deprecated as of Redis Enterprise v4.3.3: </p> <ul> <li> <p> <code> smtp_use_tls </code> (replaced with <code> smtp_tls_mode </code> ) </p> </li> <li> <p> <code> dns_address_master </code> </p> </li> <li> <p> <code> endpoint_node </code> </p> </li> <li> <p> <code> endpoint_ip </code> </p> </li> <li> <p> <code> public_addr </code> (replaced with <code> external_addr </code> ) </p> </li> </ul> <p> Fields deprecated as of Redis Enterprise v4.4.2: </p> <ul> <li> <code> default_shards_overbooking </code> (replaced with <code> shards_overbooking </code> ) </li> </ul> <p> Fields deprecated as of Redis Enterprise v6.4.2: </p> <ul> <li> <p> <code> use_ipv6 </code> (replaced with <code> use_external_ipv6 </code> ) </p> </li> <li> <p> <code> redis_cleanup_job_settings </code> (replaced with <code> persistence_cleanup_scan_interval </code> ) </p> </li> </ul> <p> Fields deprecated as of Redis Enterprise v5.0.1: </p> <ul> <li> <p> <code> bdb_high_syncer_lag </code> (replaced with <code> replica_src_high_syncer_lag </code> and <code> crdt_src_high_syncer_lag </code> ) </p> </li> <li> <p> <code> bdb_syncer_connection_error </code> </p> </li> <li> <p> <code> bdb_syncer_general_error </code> </p> </li> <li> <p> <code> sync_sources </code> (replaced with <code> replica_sources </code> and <code> crdt_sources </code> ) </p> </li> <li> <p> <code> sync </code> (replaced with <code> replica_sync </code> and <code> crdt_sync </code> ) </p> </li> <li> <p> <code> ssl </code> (replaced with <code> tls_mode </code> ) </p> </li> </ul> <p> Fields deprecated as of Redis Enterprise v7.2.4: </p> <ul> <li> <p> <code> node.bigstore_driver </code> (replaced with <code> cluster.bigstore_driver </code> ) </p> </li> <li> <p> <code> auth_method </code> </p> </li> <li> <p> <code> authentication_redis_pass </code> (replaced with multiple passwords feature in version 6.0.X) </p> </li> <li> <p> <code> slave_ha </code> cluster policy </p> </li> </ul> <p> Other deprecated fields: </p> <ul> <li> <p> <code> import/rdb_url </code> (deprecated as of Redis Enterprise v4.X) </p> </li> <li> <p> <code> logrotate_dir </code> (to be replaced with <code> logrotate_config </code> or removed) </p> </li> </ul> <p> Deprecated CLI commands: </p> <ul> <li> <p> <code> rlutil change_master </code> (deprecated as of Redis Enterprise v6.2.18, replaced with <code> rladmin change_master </code> ) </p> </li> <li> <p> <code> rlutil reserved_ports </code> (deprecated as of Redis Enterprise v7.2.4, replaced with <code> rladmin cluster config reserved_ports </code> ) </p> </li> </ul> <p> REST API requests deprecated as of Redis Enterprise v7.2.4: </p> <ul> <li> <p> <code> POST /v1/modules </code> (replaced with <code> POST /v2/modules </code> ) </p> </li> <li> <p> <code> DELETE /v1/modules </code> (replaced with <code> DELETE /v2/modules </code> ) </p> </li> </ul> <h4 id="access-control-deprecations"> Access control deprecations </h4> <ul> <li> <p> The following predefined roles and Redis ACLs are not available after upgrading to Redis Enterprise Software version 7.2.4 if they are not associated with any users or databases in the cluster: </p> <ul> <li> <p> Custom roles (not management roles): Cluster Member, Cluster Viewer, DB Member, DB Viewer, None. </p> </li> <li> <p> Redis ACLs: Not Dangerous and Read Only. </p> </li> </ul> </li> <li> <p> A deprecation notice for SASL-based LDAP was included in <a href="/docs/latest/operate/rs/release-notes/rs-6-2-4-august-2021/#deprecation-notices"> previous Redis Enterprise Software release notes </a> . When you upgrade to Redis Enterprise Software version 7.2.4, all existing "external" users (previously used to support SASL-based LDAP) will be removed. </p> </li> </ul> <h4 id="legacy-ui"> Legacy UI </h4> <p> With the release of the new Cluster Manager UI, the legacy UI is considered deprecated and will eventually be phased out. New functionality will only be implemented in the new Cluster Manager UI, and the old UI will no longer be maintained except for critical bug fixes. </p> <h4 id="redisgraph"> RedisGraph </h4> <p> Redis has announced the end of life for RedisGraph. Redis will continue to support all RedisGraph customers, including releasing patch versions until January 31, 2025. </p> <p> See the <a href="https://redis.com/blog/redisgraph-eol/"> RedisGraph end-of-life announcement </a> for more details. </p> <h4 id="rhel-and-centos-70-79"> RHEL and CentOS 7.0-7.9 </h4> <p> Support for RHEL and CentOS 7.0-7.9 is considered deprecated and will be removed in a future release. </p> <h4 id="oracle-linux-7"> Oracle Linux 7 </h4> <p> Oracle Linux 7 support is considered deprecated and will be removed in a future release. </p> <h4 id="amazon-linux-1"> Amazon Linux 1 </h4> <p> Amazon Linux 1 support is considered deprecated and will be removed in a future release. </p> <h4 id="ubuntu-1604"> Ubuntu 16.04 </h4> <p> The deprecation of Ubuntu 16.04 was announced in the <a href="/docs/latest/operate/rs/release-notes/rs-6-4-2-releases/#deprecations"> Redis Enterprise Software 6.4.2 release notes </a> . As of Redis Enterprise Software 7.2.4, Ubuntu 16.04 is no longer supported. </p> <h4 id="rc4-encryption-cipher"> RC4 encryption cipher </h4> <p> The RC4 encryption cipher is considered deprecated in favor of stronger ciphers. Support for RC4 by the <a href="/docs/latest/operate/rs/databases/durability-ha/discovery-service/"> discovery service </a> will be removed in a future release. </p> <h4 id="3des-encryption-cipher"> 3DES encryption cipher </h4> <p> The 3DES encryption cipher is considered deprecated in favor of stronger ciphers like AES. Please verify that all clients, apps, and connections support the AES cipher. Support for 3DES will be removed in a future release. Certain operating systems, such as RHEL 8, have already removed support for 3DES. Redis Enterprise Software cannot support cipher suites that are not supported by the underlying operating system. </p> <h4 id="tls-10-and-tls-11"> TLS 1.0 and TLS 1.1 </h4> <p> TLS 1.0 and TLS 1.1 connections are considered deprecated in favor of TLS 1.2 or later. Please verify that all clients, apps, and connections support TLS 1.2. Support for the earlier protocols will be removed in a future release. Certain operating systems, such as RHEL 8, have already removed support for the earlier protocols. Redis Enterprise Software cannot support connection protocols that are not supported by the underlying operating system. </p> <h3 id="supported-platforms"> Supported platforms </h3> <p> The following table provides a snapshot of supported platforms as of this Redis Enterprise Software release. See the <a href="/docs/latest/operate/rs/references/supported-platforms/"> supported platforms reference </a> for more details about operating system compatibility. </p> <p> <span title="Check mark icon"> βœ… </span> Supported – The platform is supported for this version of Redis Enterprise Software. </p> <p> <span title="Warning icon"> ⚠️ </span> Deprecated – The platform is still supported for this version of Redis Enterprise Software, but support will be removed in a future release. </p> <p> <span title="X icon"> ❌ </span> End of life – Platform support ended in this version of Redis Enterprise Software. </p> <table> <thead> <tr> <th> Redis Enterprise </th> <th> 7.2.4 </th> <th> 6.4.2 </th> <th> 6.2.18 </th> <th> 6.2.12 </th> <th> 6.2.10 </th> <th> 6.2.8 </th> <th> 6.2.4 </th> </tr> </thead> <tbody> <tr> <td> <strong> Ubuntu </strong> <sup> <a href="#table-note-1"> 1 </a> </sup> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 20.04 </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> <sup> <a href="#table-note-6"> 6 </a> </sup> </td> <td> – </td> <td> – </td> <td> – </td> <td> – </td> <td> – </td> </tr> <tr> <td> 18.04 </td> <td> <span title="Deprecated"> ⚠️ </span> </td> <td> <span title="Supported"> <span title="Supported"> βœ… </span> </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> </tr> <tr> <td> 16.04 </td> <td> <span title="End of life"> ❌ </span> </td> <td> <span title="Deprecated"> ⚠️ </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> </tr> <tr> <td> <strong> RHEL &amp; CentOS </strong> <sup> <a href="#table-note-2"> 2 </a> </sup> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 8.8 </td> <td> <span title="Supported"> βœ… </span> </td> <td> – </td> <td> – </td> <td> – </td> <td> – </td> <td> – </td> <td> – </td> </tr> <tr> <td> 8.7 </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> – </td> <td> – </td> <td> – </td> <td> – </td> <td> – </td> </tr> <tr> <td> 8.5-8.6 </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> – </td> <td> – </td> </tr> <tr> <td> 8.0-8.4 </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> – </td> </tr> <tr> <td> 7.0-7.9 </td> <td> <span title="Deprecated"> ⚠️ </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> </tr> <tr> <td> <strong> Oracle Linux </strong> <sup> <a href="#table-note-3"> 3 </a> </sup> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 8 </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> – </td> <td> – </td> </tr> <tr> <td> 7 </td> <td> <span title="Deprecated"> ⚠️ </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> </tr> <tr> <td> <strong> Rocky Linux </strong> <sup> <a href="#table-note-3"> 3 </a> </sup> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 8 </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> – </td> <td> – </td> <td> – </td> <td> – </td> </tr> <tr> <td> <strong> Amazon Linux </strong> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 2 </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> <sup> <a href="#table-note-7"> 7 </a> </sup> </td> <td> – </td> <td> – </td> <td> – </td> <td> – </td> <td> – </td> </tr> <tr> <td> 1 </td> <td> <span title="Deprecated"> ⚠️ </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> </tr> <tr> <td> <strong> Docker </strong> <sup> <a href="#table-note-4"> 4 </a> </sup> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> </tr> <tr> <td> <strong> Kubernetes </strong> <sup> <a href="#table-note-5"> 5 </a> </sup> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> </tr> </tbody> </table> <ol> <li> <p> <a name="table-note-1" style="display: block; height: 80px; margin-top: -80px;"> </a> The server version of Ubuntu is recommended for production installations. The desktop version is only recommended for development deployments. </p> </li> <li> <p> <a name="table-note-2" style="display: block; height: 80px; margin-top: -80px;"> </a> RHEL and CentOS deployments require OpenSSL 1.0.2 and <a href="/docs/latest/operate/rs/installing-upgrading/configuring/centos-rhel-firewall/"> firewall configuration </a> . </p> </li> <li> <p> <a name="table-note-3" style="display: block; height: 80px; margin-top: -80px;"> </a> Based on the corresponding RHEL version. </p> </li> <li> <p> <a name="table-note-4" style="display: block; height: 80px; margin-top: -80px;"> </a> <a href="/docs/latest/operate/rs/installing-upgrading/quickstarts/docker-quickstart/"> Docker images </a> of Redis Enterprise Software are certified for development and testing only. </p> </li> <li> <p> <a name="table-note-5" style="display: block; height: 80px; margin-top: -80px;"> </a> See the <a href="/docs/latest/operate/kubernetes/"> Redis Enterprise for Kubernetes documentation </a> . </p> </li> <li> <p> <a name="table-note-6" style="display: block; height: 80px; margin-top: -80px;"> </a> Ubuntu 20.04 support was added in Redis Enterprise Software <a href="/docs/latest/operate/rs/release-notes/rs-6-4-2-releases/rs-6-4-2-43/"> 6.4.2-43 </a> . </p> </li> <li> <p> <a name="table-note-7" style="display: block; height: 80px; margin-top: -80px;"> </a> A release candidate for Amazon Linux 2 support was added in Redis Enterprise Software <a href="/docs/latest/operate/rs/release-notes/rs-6-4-2-releases/rs-6-4-2-61/"> 6.4.2-61 </a> . Official support for Amazon Linux 2 was added in Redis Enterprise Software <a href="/docs/latest/operate/rs/release-notes/rs-6-4-2-releases/rs-6-4-2-69/"> 6.4.2-69 </a> . </p> </li> </ol> <h2 id="known-issues"> Known issues </h2> <ul> <li> <p> RS114185 - During an upgrade to <a href="/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-92/"> Redis Enterprise Software version 7.2.4-86 </a> , the proxy might not start due to a <code> Failed to get default_suffix </code> error, which appears in <code> dmcproxy.log </code> . </p> <p> As a workaround, start <code> dmcproxy </code> manually: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">supervisorctl restart dmcproxy </span></span></code></pre> </div> <p> This issue was fixed in <a href="/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-92/"> Redis Enterprise Software version 7.2.4-92 </a> . </p> </li> <li> <p> RS123142 - In an Active-Active setup with at least three participating clusters, removing and re-adding a cluster after removing older clusters without re-adding them can cause missing keys and potentially lead to data loss or data inconsistency. </p> <p> This issue will be fixed in a future maintenance release. To prevent this issue, avoid adding clusters until you upgrade to the upcoming maintenance release when available. </p> </li> </ul> <h2 id="known-limitations"> Known limitations </h2> <h4 id="command-limitations"> Command limitations </h4> <ul> <li> <p> <a href="/docs/latest/commands/client-no-touch/"> <code> CLIENT NO-TOUCH </code> </a> might not run correctly in the following cases: </p> <ul> <li> <p> The Redis database version is earlier than 7.2.0. </p> </li> <li> <p> The <code> CLIENT NO-TOUCH </code> command is forbidden by ACL rules. </p> </li> </ul> <p> Before sending this command, clients should verify the database version is 7.2.0 or later and that using this command is allowed. </p> </li> <li> <p> You cannot use <a href="/docs/latest/commands/sunsubscribe/"> <code> SUNSUBSCRIBE </code> </a> to unsubscribe from a shard channel if the regex changed while subscribed. </p> </li> <li> <p> Using <a href="/docs/latest/commands/xreadgroup/"> <code> XREADGROUP BLOCK </code> </a> with <code> &gt; </code> to return all new streams will cause the Redis database to freeze until the shard is restarted. ( <a href="https://github.com/redis/redis/pull/12301"> #12031 </a> ) </p> </li> <li> <p> Because a rejected command does not record the duration for command stats, an error will appear after it is reprocessed that will cause the Redis database to freeze until the shard is restarted. ( <a href="https://github.com/redis/redis/pull/12247"> #12247 </a> ) </p> </li> </ul> <h4 id="modules-cannot-load-in-oracle-linux-7--8"> Modules cannot load in Oracle Linux 7 &amp; 8 </h4> <p> Databases hosted on Oracle Linux 7 &amp; 8 cannot load modules. </p> <p> As a temporary workaround, you can change the node's <code> os_name </code> in the Cluster Configuration Store (CCS): </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">ccs-cli hset node:&lt;ID&gt; os_name rhel </span></span></code></pre> </div> <p> This limitation was fixed in <a href="/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-64/"> Redis Enterprise Software version 7.2.4-64 </a> . </p> <h4 id="cluster-recovery-with-manually-uploaded-modules"> Cluster recovery with manually uploaded modules </h4> <p> For clusters containing databases with manually uploaded modules, <a href="/docs/latest/operate/rs/clusters/cluster-recovery/"> cluster recovery </a> requires an extra step. </p> <p> After installing Redis Enterprise Software on the cluster nodes, upload compatible modules to <code> modulesdir </code> ( <code> /opt/redislabs/lib/modules </code> ) before continuing the recovery process. </p> <p> This limitation was fixed in <a href="/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-64/"> Redis Enterprise Software version 7.2.4-64 </a> . </p> <h4 id="cannot-create-redis-v6x-active-active-databases-with-modules"> Cannot create Redis v6.x Active-Active databases with modules </h4> <p> You cannot create Active-Active databases that use Redis version 6.0 or 6.2 with modules. Databases that use Redis version 7.2 do not have this limitation. </p> <p> This limitation will be fixed in a maintenance release for Redis Enterprise version 7.4.2. </p> <h4 id="modules-prevent-nodes-from-joining-upgraded-clusters-on-rhel-clones"> Modules prevent nodes from joining upgraded clusters on RHEL clones </h4> <p> If you upgrade an existing cluster to Redis Enterprise Software version 7.2.4 and any existing databases use earlier module versions, new nodes will fail to join the cluster on operating systems that are RHEL clones. RHEL, Ubuntu, and Amazon Linux are not affected by this issue. </p> <p> For a workaround for affected operating systems, <a href="https://redis.io/support/"> contact support </a> . </p> <p> This limitation will be fixed in a future release. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/security/access-control/ldap/map-ldap-groups-to-roles/.html
<section class="prose w-full py-12 max-w-none"> <h1> Map LDAP groups to roles </h1> <p class="text-lg -mt-5 mb-10"> Describes how to map LDAP authorization groups to Redis Enterprise roles using the Cluster Manager UI. </p> <p> Redis Enterprise Software uses a role-based mechanism to enable LDAP authentication and authorization. </p> <p> Once LDAP is enabled, you need to map LDAP groups to Redis Enterprise access control roles. </p> <h2 id="map-ldap-groups-to-roles"> Map LDAP groups to roles </h2> <p> To map LDAP groups to access control roles in the Cluster Manager UI: </p> <ol> <li> <p> Select <strong> Access Control &gt; LDAP &gt; Mapping </strong> . </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> You can map LDAP roles when LDAP configuration is not enabled, but they won't have any effect until you <a href="/docs/latest/operate/rs/security/access-control/ldap/enable-role-based-ldap/"> configure and enable LDAP </a> . </div> </div> <a href="/docs/latest/images/rs/access-control-ldap-mappings-panel.png" sdata-lightbox="/images/rs/access-control-ldap-mappings-panel.png"> <img alt="Enable LDAP mappings Panel" src="/docs/latest/images/rs/access-control-ldap-mappings-panel.png"/> </a> </li> <li> <p> Select the <strong> + Add LDAP Mapping </strong> button to create a new mapping and then enter the following details: </p> <table> <thead> <tr> <th style="text-align:left"> <em> Setting </em> </th> <th style="text-align:left"> <em> Description </em> </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <strong> Name </strong> </td> <td style="text-align:left"> A descriptive, unique name for the mapping </td> </tr> <tr> <td style="text-align:left"> <strong> Distinguished Name </strong> </td> <td style="text-align:left"> The distinguished name of the LDAP group to be mapped. <br/> Example: <code> cn=admins,ou=groups,dc=example,dc=com </code> </td> </tr> <tr> <td style="text-align:left"> <strong> Role </strong> </td> <td style="text-align:left"> The Redis Software access control role defined for this group </td> </tr> <tr> <td style="text-align:left"> <strong> Email </strong> </td> <td style="text-align:left"> <em> (Optional) </em> An address to receive alerts </td> </tr> <tr> <td style="text-align:left"> <strong> Alerts </strong> </td> <td style="text-align:left"> Selections identifying the desired alerts. </td> </tr> </tbody> </table> <a href="/docs/latest/images/rs/access-control-ldap-mappings-add.png" sdata-lightbox="/images/rs/access-control-ldap-mappings-add.png"> <img alt="Enable LDAP mappings Panel" src="/docs/latest/images/rs/access-control-ldap-mappings-add.png"/> </a> </li> <li> <p> When finished, select the <strong> Save </strong> button. </p> </li> </ol> <p> Create a mapping for each LDAP group used to authenticate and/or authorize access to Redis Enterprise Software resources. </p> <p> The scope of the authorization depends on the access control role: </p> <ul> <li> <p> If the role authorizes admin management, LDAP users are authorized as cluster management administrators. </p> </li> <li> <p> If the role authorizes database access, LDAP users are authorized to use the database to the limits specified in the role. </p> </li> <li> <p> To authorize LDAP users to specific databases, update the database access control lists (ACLs) to include the mapped LDAP role. </p> </li> </ul> <h2 id="more-info"> More info </h2> <ul> <li> Enable and configure <a href="/docs/latest/operate/rs/security/access-control/ldap/enable-role-based-ldap/"> role-based LDAP </a> </li> <li> Update database ACLs to <a href="/docs/latest/operate/rs/security/access-control/ldap/update-database-acls/"> authorize LDAP access </a> </li> <li> Learn more about Redis Enterprise Software <a href="/docs/latest/operate/rs/security/"> security and practices </a> </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/security/access-control/ldap/map-ldap-groups-to-roles/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/function-flush/.html
<section class="prose w-full py-12"> <h1 class="command-name"> FUNCTION FLUSH </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">FUNCTION FLUSH [ASYNC | SYNC]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 7.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(N) where N is the number of functions deleted </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @write </code> <span class="mr-1 last:hidden"> , </span> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> <code> @scripting </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Deletes all the libraries. </p> <p> Unless called with the optional mode argument, the <code> lazyfree-lazy-user-flush </code> configuration directive sets the effective behavior. Valid modes are: </p> <ul> <li> <code> ASYNC </code> : Asynchronously flush the libraries. </li> <li> <code> SYNC </code> : Synchronously flush the libraries. </li> </ul> <p> For more information please refer to <a href="/docs/latest/develop/interact/programmability/functions-intro/"> Introduction to Redis Functions </a> . </p> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#simple-strings"> Simple string reply </a> : <code> OK </code> . <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/function-flush/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/readers/.html
<section class="prose w-full py-12 max-w-none"> <h1> RedisGears readers </h1> <p class="text-lg -mt-5 mb-10"> Extracts data from the database and creates records to pass through a RedisGears pipeline. </p> <p> A reader extracts data from the database and creates records. </p> <p> The <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsbuilder/creategearsbuilder/"> <code> GearsBuilder.CreateGearsBuilder(reader) </code> </a> function takes a reader as a parameter and passes the generated records through a pipeline of RedisGears functions. </p> <h2 id="classes"> Classes </h2> <table> <thead> <tr> <th style="text-align:left"> Class </th> <th style="text-align:left"> Description </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/readers/commandoverrider/"> CommandOverrider </a> </td> <td style="text-align:left"> Override a Redis command. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/readers/commandreader/"> CommandReader </a> </td> <td style="text-align:left"> Run RedisGears functions on command. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/readers/javareader/"> JavaReader </a> </td> <td style="text-align:left"> A template for creating custom readers. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/readers/keysonlyreader/"> KeysOnlyReader </a> </td> <td style="text-align:left"> Gets key names from a database. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/readers/keysreader/"> KeysReader </a> </td> <td style="text-align:left"> Gets keys and their values from a database. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/readers/shardsidreader/"> ShardsIDReader </a> </td> <td style="text-align:left"> Gets the shard ID for each shard in a database. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/readers/streamreader/"> StreamReader </a> </td> <td style="text-align:left"> Reads Redis stream data. </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/readers/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/object/.html
<section class="prose w-full py-12"> <h1 class="command-name"> OBJECT </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">OBJECT</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 2.2.3 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> Depends on subcommand. </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> This is a container command for object introspection commands. </p> <p> To see the list of available commands you can call <a href="/docs/latest/commands/object-help/"> <code> OBJECT HELP </code> </a> . </p> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/object/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/kubernetes/release-notes/7-4-6-releases/7-4-6-2/.html
<section class="prose w-full py-12 max-w-none"> <h1> Redis Enterprise for Kubernetes 7.4.6-2 (July 2024) release notes </h1> <p class="text-lg -mt-5 mb-10"> This is a feature release with a new version of Redis Enterprise Software 7.4.6. </p> <h2 id="highlights"> Highlights </h2> <p> The primary purpose of this release is to support <a href="/docs/latest/operate/rs/release-notes/rs-7-4-2-releases/rs-7-4-6-22/"> Redis Enterprise Software version 7.4.6 </a> . It also includes updates to supported platform distributions. </p> <h2 id="new-in-this-release"> New in this release </h2> <h3 id="enhancements"> Enhancements </h3> <ul> <li> Removal of multiple unneeded permissions from RBAC roles used by the operator (RED-123478 RED-125020) </li> <li> Support for non-AWS S3 compatible backup targets in REC (RED-73642) </li> <li> Support for Redis Enterprise 7.4.6-22 (RED-13110) </li> </ul> <h3 id="api-changes"> API changes </h3> <table> <thead> <tr> <th> <strong> CRD </strong> </th> <th> <strong> Field </strong> </th> <th> <strong> Change </strong> </th> <th> <strong> Description </strong> </th> </tr> </thead> <tbody> <tr> <td> REC </td> <td> backup.s3.caCertificateSecretName </td> <td> Add </td> <td> Secret name that holds the S3 CA certificate, which contains the TLS certificate mapped to the key in the secret 'cert' </td> </tr> <tr> <td> REC </td> <td> backup.s3.url </td> <td> Add </td> <td> Specifies the URL for S3 export and import (used for custom S3 compatible servers) </td> </tr> </tbody> </table> <h2 id="version-changes"> Version changes </h2> <p> For a list of fixes related to CVEs, see the <a href="/docs/latest/operate/rs/release-notes/rs-7-4-2-releases/rs-7-4-6-22/"> Redis Enterprise 7.2.4-109 release notes </a> . </p> <h3 id="breaking-changes"> Breaking changes </h3> <p> The following changes included in this release affect the upgrade process. Please read carefully before upgrading. </p> <h4 id="validatingwebhookconfiguration"> ValidatingWebhookConfiguration </h4> <p> Versions 6.4.2-4 and later include a new <code> ValidatingWebhookConfiguration </code> resource to replace the <code> redb-admission </code> webhook resource. To use releases 6.4.2-4 or later, delete the old webhook resource and apply the new file. See <a href="/docs/latest/operate/kubernetes/upgrade/upgrade-redis-cluster/#reapply-webhook"> upgrade Redis cluster </a> for instructions. </p> <h4 id="openshift-scc"> OpenShift SCC </h4> <p> Versions 6.4.2-6 and later include a new SCC ( <code> redis-enterprise-scc-v2 </code> ) that you need to bind to your service account before upgrading. OpenShift clusters running version 6.2.12 or earlier upgrading to version 6.2.18 or later might get stuck if you skip this step. See <a href="/docs/latest/operate/kubernetes/upgrade/upgrade-redis-cluster/#before-upgrading"> upgrade a Redis Enterprise cluster (REC) </a> for instructions. </p> <h4 id="upcoming-changes"> Upcoming Changes </h4> <ul> <li> Future Redis Enterprise images will be UBI9-based only, without support for Ubuntu-based images. </li> </ul> <h3 id="supported-distributions"> Supported distributions </h3> <p> The following table shows supported distributions at the time of this release. You can also find this list in <a href="/docs/latest/operate/kubernetes/reference/supported_k8s_distributions/"> Supported Kubernetes distributions </a> . </p> <p> <span title="Check mark icon"> βœ… </span> Supported – This distribution is supported for this version of Redis Enterprise Software for Kubernetes. </p> <p> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> Deprecated – This distribution is still supported for this version of Redis Enterprise Software for Kubernetes, but support will be removed in a future release. </p> <p> <span title="X icon"> ❌ </span> End of life – Support for this distribution ended. </p> <p> Any distribution not listed below is not supported for production workloads. </p> <table> <thead> <tr> <th> <strong> Kubernetes version </strong> </th> <th> <strong> 1.25 </strong> </th> <th> <strong> 1.26 </strong> </th> <th> <strong> 1.27 </strong> </th> <th> <strong> 1.28 </strong> </th> <th> <strong> 1.29 </strong> </th> <th> <strong> 1.30 </strong> </th> </tr> </thead> <tbody> <tr> <td> <strong> Community Kubernetes </strong> </td> <td> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> </tr> <tr> <td> <strong> Amazon EKS </strong> </td> <td> <span title="X icon"> ❌ </span> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> </td> </tr> <tr> <td> <strong> Azure AKS </strong> </td> <td> </td> <td> <span title="X icon"> ❌ </span> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> </tr> <tr> <td> <strong> Google GKE </strong> </td> <td> <span title="X icon"> ❌ </span> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> </tr> <tr> <td> <strong> Rancher RKE2 </strong> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> </td> <td> </td> </tr> <tr> <td> <strong> VMware TKG 2.2 </strong> </td> <td> <span title="X icon"> ❌ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> <strong> VMware TKG 2.3 </strong> </td> <td> <span title="X icon"> ❌ </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> <strong> VMware TKG 2.4 </strong> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> <strong> OpenShift version </strong> </td> <td> <strong> 4.12 </strong> </td> <td> <strong> 4.13 </strong> </td> <td> <strong> 4.14 </strong> </td> <td> <strong> 4.15 </strong> </td> <td> <strong> 4.16 </strong> </td> <td> </td> </tr> <tr> <td> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> </td> </tr> <tr> <td> <strong> VMware TKGI version </strong> </td> <td> <strong> 1.16 </strong> </td> <td> <strong> 1.17 </strong> </td> <td> <strong> 1.18 </strong> </td> <td> <strong> 1.19 </strong> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> </td> <td> </td> </tr> </tbody> </table> <h2 id="downloads"> Downloads </h2> <ul> <li> <strong> Redis Enterprise </strong> : <code> redislabs/redis:7.4.6-22 </code> </li> <li> <strong> Operator </strong> : <code> redislabs/operator:7.4.6-2 </code> </li> <li> <strong> Services Rigger </strong> : <code> redislabs/k8s-controller:7.4.6-2 </code> </li> </ul> <h3 id="openshift-images"> OpenShift images </h3> <ul> <li> <strong> Redis Enterprise </strong> : <code> registry.connect.redhat.com/redislabs/redis-enterprise:7.4.6-22.rhel8-openshift </code> </li> <li> <strong> Operator </strong> : <code> registry.connect.redhat.com/redislabs/redis-enterprise-operator:7.4.6-2 </code> </li> <li> <strong> Services Rigger </strong> : <code> registry.connect.redhat.com/redislabs/services-manager:7.4.6-2 </code> </li> </ul> <h3 id="olm-bundle"> OLM bundle </h3> <p> <strong> Redis Enterprise operator bundle </strong> : <code> v7.4.6-2.0 </code> </p> <h2 id="known-limitations"> Known limitations </h2> <ul> <li> <p> <strong> Missing endpoint for admission endpoint (rare) (RED-119469) </strong> Restart the operator pod. </p> </li> <li> <p> <strong> The REDB β€œredisVersion” field can’t be used for memcached databases(RED-119152) </strong> </p> </li> <li> <p> <strong> When modifying the database suffix for an Active-Active database, while the service-rigger is in a terminating state, the services-rigger will delete and create the ingress or route resources in a loop (RED-107687) </strong> Wait until the services rigger pod has finished to terminate it. </p> </li> <li> <p> <strong> REAADB changes might fail with "gateway timeout" errors, mostly on OpenShift (RED-103048) </strong> Retry the operation. </p> </li> <li> <p> <strong> Creating two databases with the same name directly on Redis Enterprise software will cause the service to be deleted and the database will not be available (RED-99997) </strong> Avoid duplicating database names. Database creation via K8s has validation in place to prevent this. </p> </li> <li> <p> <strong> Installing the operator bundle produces warning: <code> Warning: would violate PodSecurity "restricted: v1.24" </code> (RED-97381) </strong> Ignore the warning. This issue is documented as benign on official Red Hat documentation. </p> </li> <li> <p> <strong> RERC resources must have a unique name (RED-96302) </strong> The string "rec-name"/"rec-namespace" must be different from all other participating clusters in the Active-Active database. </p> </li> <li> <p> <strong> Admission is not blocking REAADB with <code> shardCount </code> which exceeds license quota (RED-96301) </strong> Fix the problems with the REAADB and reapply. </p> </li> <li> <p> <strong> Active-Active controller only supports global database options. Configuration specific to location is not supported (RED-86490) </strong> </p> </li> <li> <p> <strong> Active-Active setup removal might keep services or routes undeleted (RED-77752) </strong> Delete services or routes manually if you encounter this problem. </p> </li> <li> <p> <strong> <code> autoUpgrade </code> set to <code> true </code> can cause unexpected bdb upgrades when <code> redisUpgradePolicy </code> is set to <code> true </code> (RED-72351) </strong> Contact support if your deployment is impacted. </p> </li> <li> <p> <strong> Following the previous quick start guide version causes issues with creating an REDB due to unrecognized memory field name (RED-69515) </strong> The workaround is to use the newer (current) revision of Deploy Redis Enterprise Software for Kubernetes. </p> </li> <li> <p> <strong> PVC size issues when using decimal value in spec (RED-62132) </strong> Make sure you use integer values for the PVC size. </p> </li> <li> <p> <strong> REC might report error states on initial startup (RED-61707) </strong> There is no workaround at this time except to ignore the errors. </p> </li> <li> <p> <strong> Hashicorp Vault integration - no support for Gesher (RED-55080) </strong> There is no workaround for this issue. Gesher support has been deprecated. </p> </li> <li> <p> <strong> REC clusters fail to start on Kubernetes clusters with unsynchronized clocks (RED-47254) </strong> When REC clusters are deployed on Kubernetes clusters without synchronized clocks, the REC cluster does not start correctly. The fix is to use NTP to synchronize the underlying K8s nodes. </p> </li> <li> <p> <strong> Deleting an OpenShift project with an REC deployed may hang (RED-47192) </strong> When an REC cluster is deployed in a project (namespace) and has REDB resources, the REDB resources must be deleted first before the REC can be deleted. Therefore, until the REDB resources are deleted, the project deletion will hang. The fix is to delete the REDB resources first and the REC second. Then, you can delete the project. </p> </li> <li> <p> <strong> Clusters must be named 'rec' in OLM-based deployments (RED-39825) </strong> In OLM-deployed operators, the deployment of the cluster will fail if the name is not "rec". When the operator is deployed via the OLM, the security context constraints (scc) are bound to a specific service account name (namely, "rec"). The workaround is to name the cluster "rec". </p> </li> <li> <p> <strong> Readiness probe incorrect on failures (RED-39300) </strong> STS Readiness probe does not mark a node as "not ready" when running <code> rladmin status </code> on node failure. </p> </li> <li> <p> <strong> Internal DNS and Kubernetes DNS may have conflicts (RED-37462) </strong> DNS conflicts are possible between the cluster <code> mdns_server </code> and the K8s DNS. This only impacts DNS resolution from within cluster nodes for Kubernetes DNS names. </p> </li> <li> <p> <strong> K8s-based 5.4.10 clusters seem to negatively affect existing 5.4.6 clusters (RED-37233) </strong> Upgrade clusters to latest version. </p> </li> <li> <p> <strong> Node CPU usage is reported instead of pod CPU usage (RED-36884) </strong> In Kubernetes, the reported node CPU usage is the usage of the Kubernetes worker node hosting the REC pod. </p> </li> <li> <p> <strong> An unreachable cluster has status running (RED-32805) </strong> When a cluster is in an unreachable state, the state remains <code> running </code> instead of triggering an error. </p> </li> <li> <p> <strong> Long cluster names cause routes to be rejected (RED-25871) </strong> A cluster name longer than 20 characters will result in a rejected route configuration because the host part of the domain name exceeds 63 characters. The workaround is to limit the cluster name to 20 characters or fewer. </p> </li> <li> <p> <strong> Cluster CR (REC) errors are not reported after invalid updates (RED-25542) </strong> A cluster CR specification error is not reported if two or more invalid CR resources are updated in sequence. </p> </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/kubernetes/release-notes/7-4-6-releases/7-4-6-2/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/module-load/.html
<section class="prose w-full py-12"> <h1 class="command-name"> MODULE LOAD </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">MODULE LOAD path [arg [arg ...]]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 4.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @admin </code> <span class="mr-1 last:hidden"> , </span> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> <code> @dangerous </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Loads a module from a dynamic library at runtime. </p> <p> This command loads and initializes the Redis module from the dynamic library specified by the <code> path </code> argument. The <code> path </code> should be the absolute path of the library, including the full filename. Any additional arguments are passed unmodified to the module. </p> <p> <strong> Note </strong> : modules can also be loaded at server startup with <code> loadmodule </code> configuration directive in <code> redis.conf </code> . </p> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#simple-strings"> Simple string reply </a> : <code> OK </code> if the module was loaded. <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/module-load/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/references/rest-api/requests/bdbs/modules/.html
<section class="prose w-full py-12 max-w-none"> <h1> Database modules requests </h1> <p class="text-lg -mt-5 mb-10"> Redis module requests </p> <h2 id="configure-module"> Configure module </h2> <table> <thead> <tr> <th> Method </th> <th> Path </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/references/rest-api/requests/bdbs/modules/config/#post-bdb-modules-config"> POST </a> </td> <td> <code> /v1/bdbs/{uid}/modules/config </code> </td> <td> Configure module </td> </tr> </tbody> </table> <h2 id="upgrade-module"> Upgrade module </h2> <table> <thead> <tr> <th> Method </th> <th> Path </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/references/rest-api/requests/bdbs/modules/upgrade/#post-bdb-modules-upgrade"> POST </a> </td> <td> <code> /v1/bdbs/{uid}/modules/upgrade </code> </td> <td> Upgrade module </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/rest-api/requests/bdbs/modules/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/develop/reference/key-specs.html
<section class="prose w-full py-12"> <h1> Command key specifications </h1> <p class="text-lg -mt-5 mb-10"> What are command key specification and how to use them in your client </p> <p> Many of the commands in Redis accept key names as input arguments. The 9th element in the reply of <a href="/docs/latest/commands/command/"> <code> COMMAND </code> </a> (and <a href="/docs/latest/commands/command-info/"> <code> COMMAND INFO </code> </a> ) is an array that consists of the command's key specifications. </p> <p> A <em> key specification </em> describes a rule for extracting the names of one or more keys from the arguments of a given command. Key specifications provide a robust and flexible mechanism, compared to the <em> first key </em> , <em> last key </em> and <em> step </em> scheme employed until Redis 7.0. Before introducing these specifications, Redis clients had no trivial programmatic means to extract key names for all commands. </p> <p> Cluster-aware Redis clients had to have the keys' extraction logic hard-coded in the cases of commands such as <a href="/docs/latest/commands/eval/"> <code> EVAL </code> </a> and <a href="/docs/latest/commands/zunionstore/"> <code> ZUNIONSTORE </code> </a> that rely on a <em> numkeys </em> argument or <a href="/docs/latest/commands/sort/"> <code> SORT </code> </a> and its many clauses. Alternatively, the <a href="/docs/latest/commands/command-getkeys/"> <code> COMMAND GETKEYS </code> </a> can be used to achieve a similar extraction effect but at a higher latency. </p> <p> A Redis client isn't obligated to support key specifications. It can continue using the legacy <em> first key </em> , <em> last key </em> and <em> step </em> scheme along with the <a href="/docs/latest/commands/command/#flags"> <em> movablekeys </em> flag </a> that remain unchanged. </p> <p> However, a Redis client that implements key specifications support can consolidate most of its keys' extraction logic. Even if the client encounters an unfamiliar type of key specification, it can always revert to the <a href="/docs/latest/commands/command-getkeys/"> <code> COMMAND GETKEYS </code> </a> command. </p> <p> That said, most cluster-aware clients only require a single key name to perform correct command routing, so it is possible that although a command features one unfamiliar specification, its other specification may still be usable by the client. </p> <p> Key specifications are maps with the following keys: </p> <ol> <li> <strong> begin_search: </strong> : the starting index for keys' extraction. </li> <li> <strong> find_keys: </strong> the rule for identifying the keys relative to the BS. </li> <li> <strong> notes </strong> : notes about this key spec, if there are any. </li> <li> <strong> flags </strong> : indicate the type of data access. </li> </ol> <h2 id="begin_search"> begin_search </h2> <p> The <em> begin_search </em> value of a specification informs the client of the extraction's beginning. The value is a map. There are three types of <code> begin_search </code> : </p> <ol> <li> <strong> index: </strong> key name arguments begin at a constant index. </li> <li> <strong> keyword: </strong> key names start after a specific keyword (token). </li> <li> <strong> unknown: </strong> an unknown type of specification - see the <a href="#incomplete"> incomplete flag section </a> for more details. </li> </ol> <h3 id="index"> index </h3> <p> The <em> index </em> type of <code> begin_search </code> indicates that input keys appear at a constant index. It is a map under the <em> spec </em> key with a single key: </p> <ol> <li> <strong> index: </strong> the 0-based index from which the client should start extracting key names. </li> </ol> <h3 id="keyword"> keyword </h3> <p> The <em> keyword </em> type of <code> begin_search </code> means a literal token precedes key name arguments. It is a map under the <em> spec </em> with two keys: </p> <ol> <li> <strong> keyword: </strong> the keyword (token) that marks the beginning of key name arguments. </li> <li> <strong> startfrom: </strong> an index to the arguments array from which the client should begin searching. This can be a negative value, which means the search should start from the end of the arguments' array, in reverse order. For example, <em> -2 </em> 's meaning is to search reverse from the penultimate argument. </li> </ol> <p> More examples of the <em> keyword </em> search type include: </p> <ul> <li> <a href="/docs/latest/commands/set/"> <code> SET </code> </a> has a <code> begin_search </code> specification of type <em> index </em> with a value of <em> 1 </em> . </li> <li> <a href="/docs/latest/commands/xread/"> <code> XREAD </code> </a> has a <code> begin_search </code> specification of type <em> keyword </em> with the values <em> "STREAMS" </em> and <em> 1 </em> as <em> keyword </em> and <em> startfrom </em> , respectively. </li> <li> <a href="/docs/latest/commands/migrate/"> <code> MIGRATE </code> </a> has a <em> start_search </em> specification of type <em> keyword </em> with the values of <em> "KEYS" </em> and <em> -2 </em> . </li> </ul> <h2 id="find_keys"> find_keys </h2> <p> The <code> find_keys </code> value of a key specification tells the client how to continue the search for key names. <code> find_keys </code> has three possible types: </p> <ol> <li> <strong> range: </strong> keys stop at a specific index or relative to the last argument. </li> <li> <strong> keynum: </strong> an additional argument specifies the number of input keys. </li> <li> <strong> unknown: </strong> an unknown type of specification - see the <a href="#incomplete"> incomplete flag section </a> for more details. </li> </ol> <h3 id="range"> range </h3> <p> The <em> range </em> type of <code> find_keys </code> is a map under the <em> spec </em> key with three keys: </p> <ol> <li> <strong> lastkey: </strong> the index, relative to <code> begin_search </code> , of the last key argument. This can be a negative value, in which case it isn't relative. For example, <em> -1 </em> indicates to keep extracting keys until the last argument, <em> -2 </em> until one before the last, and so on. </li> <li> <strong> keystep: </strong> the number of arguments that should be skipped, after finding a key, to find the next one. </li> <li> <strong> limit: </strong> if <em> lastkey </em> is has the value of <em> -1 </em> , we use the <em> limit </em> to stop the search by a factor. <em> 0 </em> and <em> 1 </em> mean no limit. <em> 2 </em> means half of the remaining arguments, 3 means a third, and so on. </li> </ol> <h3 id="keynum"> keynum </h3> <p> The <em> keynum </em> type of <code> find_keys </code> is a map under the <em> spec </em> key with three keys: </p> <ul> <li> <strong> keynumidx: </strong> the index, relative to <code> begin_search </code> , of the argument containing the number of keys. </li> <li> <strong> firstkey: </strong> the index, relative to <code> begin_search </code> , of the first key. This is usually the next argument after <em> keynumidx </em> , and its value, in this case, is greater by one. </li> <li> <strong> keystep: </strong> Tthe number of arguments that should be skipped, after finding a key, to find the next one. </li> </ul> <p> Examples: </p> <ul> <li> The <a href="/docs/latest/commands/set/"> <code> SET </code> </a> command has a <em> range </em> of <em> 0 </em> , <em> 1 </em> and <em> 0 </em> . </li> <li> The <a href="/docs/latest/commands/mset/"> <code> MSET </code> </a> command has a <em> range </em> of <em> -1 </em> , <em> 2 </em> and <em> 0 </em> . </li> <li> The <a href="/docs/latest/commands/xread/"> <code> XREAD </code> </a> command has a <em> range </em> of <em> -1 </em> , <em> 1 </em> and <em> 2 </em> . </li> <li> The <a href="/docs/latest/commands/zunion/"> <code> ZUNION </code> </a> command has a <em> start_search </em> type <em> index </em> with the value <em> 1 </em> , and <code> find_keys </code> of type <em> keynum </em> with values of <em> 0 </em> , <em> 1 </em> and <em> 1 </em> . </li> <li> The <a href="https://oss.redislabs.com/redisai/master/commands/#aidagrun"> <code> AI.DAGRUN </code> </a> command has a <em> start_search </em> of type <em> keyword </em> with values of <em> "LOAD" </em> and <em> 1 </em> , and <code> find_keys </code> of type <em> keynum </em> with values of <em> 0 </em> , <em> 1 </em> and <em> 1 </em> . </li> </ul> <p> <strong> Note: </strong> this isn't a perfect solution as the module writers can come up with anything. However, this mechanism should allow the extraction of key name arguments for the vast majority of commands. </p> <h2 id="notes"> notes </h2> <p> Notes about non-obvious key specs considerations, if applicable. </p> <h2 id="flags"> flags </h2> <p> A key specification can have additional flags that provide more details about the key. These flags are divided into three groups, as described below. </p> <h3 id="access-type-flags"> Access type flags </h3> <p> The following flags declare the type of access the command uses to a key's value or its metadata. A key's metadata includes LRU/LFU counters, type, and cardinality. These flags do not relate to the reply sent back to the client. </p> <p> Every key specification has precisely one of the following flags: </p> <ul> <li> <strong> RW: </strong> the read-write flag. The command modifies the data stored in the value of the key or its metadata. This flag marks every operation that isn't distinctly a delete, an overwrite, or read-only. </li> <li> <strong> RO: </strong> the read-only flag. The command only reads the value of the key (although it doesn't necessarily return it). </li> <li> <strong> OW: </strong> the overwrite flag. The command overwrites the data stored in the value of the key. </li> <li> <strong> RM: </strong> the remove flag. The command deletes the key. </li> </ul> <h3 id="logical-operation-flags"> Logical operation flags </h3> <p> The following flags declare the type of operations performed on the data stored as the key's value and its TTL (if any), not the metadata. These flags describe the logical operation that the command executes on data, driven by the input arguments. The flags do not relate to modifying or returning metadata (such as a key's type, cardinality, or existence). </p> <p> Every key specification may include the following flag: </p> <ul> <li> <strong> access: </strong> the access flag. This flag indicates that the command returns, copies, or somehow uses the user's data that's stored in the key. </li> </ul> <p> In addition, the specification may include precisely one of the following: </p> <ul> <li> <strong> update: </strong> the update flag. The command updates the data stored in the key's value. The new value may depend on the old value. This flag marks every operation that isn't distinctly an insert or a delete. </li> <li> <strong> insert: </strong> the insert flag. The command only adds data to the value; existing data isn't modified or deleted. </li> <li> <strong> delete: </strong> the delete flag. The command explicitly deletes data from the value stored at the key. </li> </ul> <h3 id="miscellaneous-flags"> Miscellaneous flags </h3> <p> Key specifications may have the following flags: </p> <ul> <li> <strong> not_key: </strong> this flag indicates that the specified argument isn't a key. This argument is treated the same as a key when computing which slot a command should be assigned to for Redis cluster. For all other purposes this argument should not be considered a key. </li> <li> <strong> incomplete: </strong> this flag is explained below. </li> <li> <strong> variable_flags: </strong> this flag is explained below. </li> </ul> <h3 id="incomplete"> incomplete </h3> <p> Some commands feature exotic approaches when it comes to specifying their keys, which makes extraction difficult. Consider, for example, what would happen with a call to <a href="/docs/latest/commands/migrate/"> <code> MIGRATE </code> </a> that includes the literal string <em> "KEYS" </em> as an argument to its <em> AUTH </em> clause. Our key specifications would miss the mark, and extraction would begin at the wrong index. </p> <p> Thus, we recognize that key specifications are incomplete and may fail to extract all keys. However, we assure that even incomplete specifications never yield the wrong names of keys, providing that the command is syntactically correct. </p> <p> In the case of <a href="/docs/latest/commands/migrate/"> <code> MIGRATE </code> </a> , the search begins at the end ( <em> startfrom </em> has the value of <em> -1 </em> ). If and when we encounter a key named <em> "KEYS" </em> , we'll only extract the subset of the key name arguments after it. That's why <a href="/docs/latest/commands/migrate/"> <code> MIGRATE </code> </a> has the <em> incomplete </em> flag in its key specification. </p> <p> Another case of incompleteness is the <a href="/docs/latest/commands/sort/"> <code> SORT </code> </a> command. Here, the <code> begin_search </code> and <code> find_keys </code> are of type <em> unknown </em> . The client should revert to calling the <a href="/docs/latest/commands/command-getkeys/"> <code> COMMAND GETKEYS </code> </a> command to extract key names from the arguments, short of implementing it natively. The difficulty arises, for example, because the string <em> "STORE" </em> is both a keyword (token) and a valid literal argument for <a href="/docs/latest/commands/sort/"> <code> SORT </code> </a> . </p> <p> <strong> Note: </strong> the only commands with <em> incomplete </em> key specifications are <a href="/docs/latest/commands/sort/"> <code> SORT </code> </a> and <a href="/docs/latest/commands/migrate/"> <code> MIGRATE </code> </a> . We don't expect the addition of such commands in the future. </p> <h3 id="variable_flags"> variable_flags </h3> <p> In some commands, the flags for the same key name argument can depend on other arguments. For example, consider the <a href="/docs/latest/commands/set/"> <code> SET </code> </a> command and its optional <em> GET </em> argument. Without the <em> GET </em> argument, <a href="/docs/latest/commands/set/"> <code> SET </code> </a> is write-only, but it becomes a read and write command with it. When this flag is present, it means that the key specification flags cover all possible options, but the effective flags depend on other arguments. </p> <h2 id="examples"> Examples </h2> <h3 id="sethahahugoshortcode-s25-hbhbs-key-specifications"> <a href="/docs/latest/commands/set/"> <code> SET </code> </a> 's key specifications </h3> <pre tabindex="0"><code> 1) 1) "flags" 2) 1) RW 2) access 3) update 3) "begin_search" 4) 1) "type" 2) "index" 3) "spec" 4) 1) "index" 2) (integer) 1 5) "find_keys" 6) 1) "type" 2) "range" 3) "spec" 4) 1) "lastkey" 2) (integer) 0 3) "keystep" 4) (integer) 1 5) "limit" 6) (integer) 0 </code></pre> <h3 id="zunionhahahugoshortcode-s26-hbhbs-key-specifications"> <a href="/docs/latest/commands/zunion/"> <code> ZUNION </code> </a> 's key specifications </h3> <pre tabindex="0"><code> 1) 1) "flags" 2) 1) RO 2) access 3) "begin_search" 4) 1) "type" 2) "index" 3) "spec" 4) 1) "index" 2) (integer) 1 5) "find_keys" 6) 1) "type" 2) "keynum" 3) "spec" 4) 1) "keynumidx" 2) (integer) 0 3) "firstkey" 4) (integer) 1 5) "keystep" 6) (integer) 1 </code></pre> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/reference/key-specs/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/exists/.html
<section class="prose w-full py-12"> <h1 class="command-name"> EXISTS </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">EXISTS key [key ...]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 1.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(N) where N is the number of keys to check. </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @keyspace </code> <span class="mr-1 last:hidden"> , </span> <code> @read </code> <span class="mr-1 last:hidden"> , </span> <code> @fast </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Returns if <code> key </code> exists. </p> <p> The user should be aware that if the same existing key is mentioned in the arguments multiple times, it will be counted multiple times. So if <code> somekey </code> exists, <code> EXISTS somekey somekey </code> will return 2. </p> <h2 id="examples"> Examples </h2> <div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex"> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z"> </path> </svg> </div> <form class="redis-cli overflow-y-auto max-h-80"> <pre tabindex="0">redis&gt; SET key1 "Hello" "OK" redis&gt; EXISTS key1 (integer) 1 redis&gt; EXISTS nosuchkey (integer) 0 redis&gt; SET key2 "World" "OK" redis&gt; EXISTS key1 key2 nosuchkey (integer) 2 </pre> <div class="prompt" style=""> <span> redis&gt; </span> <input autocomplete="off" name="prompt" spellcheck="false" type="text"/> </div> </form> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : the number of keys that exist from those specified as arguments. <br/> <h2> History </h2> <ul> <li> Starting with Redis version 3.0.3: Accepts multiple <code> key </code> arguments. </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/exists/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/ft._list/.html
<section class="prose w-full py-12"> <h1 class="command-name"> FT._LIST </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">FT._LIST</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available in: </dt> <dd class="m-0"> <a href="/docs/stack"> Redis Stack </a> / <a href="/docs/interact/search-and-query"> Search 2.0.0 </a> </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> </dl> <p> Returns a list of all existing indexes. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Temporary command: </div> <p> The prefix <code> _ </code> in the command indicates, this is a temporary command. </p> <p> In the future, a <a href="/docs/latest/commands/scan/"> <code> SCAN </code> </a> type of command will be added, for use when a database contains a large number of indices. </p> </div> </div> <h2 id="return"> Return </h2> <p> <a href="/docs/latest/develop/reference/protocol-spec/#arrays"> Array reply </a> with index names. </p> <h2 id="examples"> Examples </h2> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="n">FT</span><span class="p">.</span><span class="n">_LIST</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"idx"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"movies"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="s2">"imdb"</span><span class="w"> </span></span></span></code></pre> </div> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/ft._list/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/develop/data-types/json/performance/.html
<section class="prose w-full py-12 max-w-none"> <h1> Performance </h1> <p class="text-lg -mt-5 mb-10"> Performance benchmarks </p> <p> To get an early sense of what Redis JSON is capable of, you can test it with <code> redis-benchmark </code> just like any other Redis command. However, in order to have more control over the tests, we'll use a a tool written in Go called <em> ReJSONBenchmark </em> that we expect to release in the near future. </p> <p> The following figures were obtained from an AWS EC2 c4.8xlarge instance that ran both the Redis server as well the as the benchmarking tool. Connections to the server are via the networking stack. All tests are non-pipelined. </p> <blockquote> <p> NOTE: The results below are measured using the preview version of Redis JSON, which is still very much unoptimized. </p> </blockquote> <h2 id="redis-json-baseline"> Redis JSON baseline </h2> <h3 id="a-smallish-object"> A smallish object </h3> <p> We test a JSON value that, while purely synthetic, is interesting. The test subject is <a href="https://github.com/RedisLabsModules/redisjson/blob/master/tests/files/pass-100.json"> /tests/files/pass-100.json </a> , who weighs in at 380 bytes and is nested. We first test SETting it, then GETting it using several different paths: </p> <p> <img alt="ReJSONBenchmark pass-100.json" src="images/bench_pass_100.png"/> </p> <p> <img alt="ReJSONBenchmark pass-100.json percentiles" src="images/bench_pass_100_p.png"/> </p> <h3 id="a-bigger-array"> A bigger array </h3> <p> Moving on to bigger values, we use the 1.4 kB array in <a href="https://github.com/RedisLabsModules/redisjson/blob/master/tests/files/pass-jsonsl-1.json"> /tests/files/pass-jsonsl-1.json </a> : </p> <p> <img alt="ReJSONBenchmark pass-jsonsl-1.json" src="images/bench_pass_jsonsl_1.png"/> </p> <p> <img alt="ReJSONBenchmark pass-jsonsl-1.json percentiles" src="images/bench_pass_jsonsl_1_p.png"/> </p> <h3 id="a-largish-object"> A largish object </h3> <p> More of the same to wrap up, now we'll take on a behemoth of no less than 3.5 kB as given by <a href="https://github.com/RedisLabsModules/redisjson/blob/master/tests/files/pass-json-parser-0000.json"> /tests/files/pass-json-parser-0000.json </a> : </p> <p> <img alt="ReJSONBenchmark pass-json-parser-0000.json" src="images/bench_pass_json_parser_0000.png"/> </p> <p> <img alt="ReJSONBenchmark pass-json-parser-0000.json percentiles" src="images/bench_pass_json_parser_0000_p.png"/> </p> <h3 id="number-operations"> Number operations </h3> <p> Last but not least, some adding and multiplying: </p> <p> <img alt="ReJSONBenchmark number operations" src="images/bench_numbers.png"/> </p> <p> <img alt="ReJSONBenchmark number operations percentiles" src="images/bench_numbers_p.png"/> </p> <h3 id="baseline"> Baseline </h3> <p> To establish a baseline, we'll use the Redis <a href="/docs/latest/commands/ping/"> <code> PING </code> </a> command. First, lets see what <code> redis-benchmark </code> reports: </p> <pre tabindex="0"><code>~$ redis/src/redis-benchmark -n 1000000 ping ====== ping ====== 1000000 requests completed in 7.11 seconds 50 parallel clients 3 bytes payload keep alive: 1 99.99% &lt;= 1 milliseconds 100.00% &lt;= 1 milliseconds 140587.66 requests per second </code></pre> <p> ReJSONBenchmark's concurrency is configurable, so we'll test a few settings to find a good one. Here are the results, which indicate that 16 workers yield the best throughput: </p> <p> <img alt="ReJSONBenchmark PING" src="images/bench_ping.png"/> </p> <p> <img alt="ReJSONBenchmark PING percentiles" src="images/bench_ping_p.png"/> </p> <p> Note how our benchmarking tool does slightly worse in PINGing - producing only 116K ops, compared to <code> redis-cli </code> 's 140K. </p> <h3 id="the-empty-string"> The empty string </h3> <p> Another JSON benchmark is that of setting and getting an empty string - a value that's only two bytes long (i.e. <code> "" </code> ). Granted, that's not very useful, but it teaches us something about the basic performance of the module: </p> <p> <img alt="ReJSONBenchmark empty string" src="images/bench_empty_string.png"/> </p> <p> <img alt="ReJSONBenchmark empty string percentiles" src="images/bench_empty_string_p.png"/> </p> <h2 id="comparison-vs-server-side-lua-scripting"> Comparison vs. server-side Lua scripting </h2> <p> We compare Redis Stack's JSON performance with Redis' embedded Lua engine. For this purpose, we use the Lua scripts at <a href="https://github.com/RedisLabsModules/redisjson/tree/master/benchmarks/lua"> /benchmarks/lua </a> . These scripts provide JSON's GET and SET functionality on values stored in JSON or MessagePack formats. Each of the different operations (set root, get root, set path and get path) is executed with each "engine" on objects of varying sizes. </p> <h3 id="setting-and-getting-the-root"> Setting and getting the root </h3> <p> Storing raw JSON performs best in this test, but that isn't really surprising as all it does is serve unprocessed strings. While you can and should use Redis for caching opaque data, and JSON "blobs" are just one example, this does not allow any updates other than these of the entire value. </p> <p> A more meaningful comparison therefore is between JSON and the MessagePack variant, since both process the incoming JSON value before actually storing it. While the rates and latencies of these two behave in a very similar way, the absolute measurements suggest that Redis JSON's performance may be further improved. </p> <p> <img alt="VS. Lua set root" src="images/bench_lua_set_root.png"/> </p> <p> <img alt="VS. Lua set root latency" src="images/bench_lua_set_root_l.png"/> </p> <p> <img alt="VS. Lua get root" src="images/bench_lua_get_root.png"/> </p> <p> <img alt="VS. Lua get root latency" src="images/bench_lua_get_root_l.png"/> </p> <h3 id="setting-and-getting-parts-of-objects"> Setting and getting parts of objects </h3> <p> This test shows why Redis JSON exists. Not only does it outperform the Lua variants, it retains constant rates and latencies regardless the object's overall size. There's no magic here - JSON keeps the value deserialized so that accessing parts of it is a relatively inexpensive operation. In deep contrast are both raw JSON as well as MessagePack, which require decoding the entire object before anything can be done with it (a process that becomes more expensive the larger the object is). </p> <p> <img alt="VS. Lua set path to scalar" src="images/bench_lua_set_path.png"/> </p> <p> <img alt="VS. Lua set path to scalar latency" src="images/bench_lua_set_path_l.png"/> </p> <p> <img alt="VS. Lua get scalar from path" src="images/bench_lua_get_path.png"/> </p> <p> <img alt="VS. Lua get scalar from path latency" src="images/bench_lua_get_path_l.png"/> </p> <h3 id="even-more-charts"> Even more charts </h3> <p> These charts are more of the same but independent for each file (value): </p> <p> <img alt="VS. Lua pass-100.json rate" src="images/bench_lua_pass_100.png"/> </p> <p> <img alt="VS. Lua pass-100.json average latency" src="images/bench_lua_pass_100_l.png"/> </p> <p> <img alt="VS. Lua pass-jsonsl-1.json rate" src="images/bench_lua_pass_jsonsl_1.png"/> </p> <p> <img alt="VS. Lua pass-jsonsl-1.json average latency" src="images/bench_lua_pass_jsonsl_1_l.png"/> </p> <p> <img alt="VS. Lua pass-json-parser-0000.json rate" src="images/bench_lua_pass_json_parser_0000.png"/> </p> <p> <img alt="VS. Lua pass-json-parser-0000.json latency" src="images/bench_lua_pass_json_parser_0000_l.png"/> </p> <p> <img alt="VS. Lua pass-jsonsl-yahoo2.json rate" src="images/bench_lua_pass_jsonsl_yahoo2.png"/> </p> <p> <img alt="VS. Lua pass-jsonsl-yahoo2.json latency" src="images/bench_lua_pass_jsonsl_yahoo2_l.png"/> </p> <p> <img alt="VS. Lua pass-jsonsl-yelp.json rate" src="images/bench_lua_pass_jsonsl_yelp.png"/> </p> <p> <img alt="VS. Lua pass-jsonsl-yelp.json latency" src="images/bench_lua_pass_jsonsl_yelp_l.png"/> </p> <h2 id="raw-results"> Raw results </h2> <p> The following are the raw results from the benchmark in CSV format. </p> <h3 id="json-results"> JSON results </h3> <pre tabindex="0"><code>title,concurrency,rate,average latency,50.00%-tile,90.00%-tile,95.00%-tile,99.00%-tile,99.50%-tile,100.00%-tile [ping],1,22128.12,0.04,0.04,0.04,0.05,0.05,0.05,1.83 [ping],2,54641.13,0.04,0.03,0.05,0.05,0.06,0.07,2.14 [ping],4,76000.18,0.05,0.05,0.07,0.07,0.09,0.10,2.10 [ping],8,106750.99,0.07,0.07,0.10,0.11,0.14,0.16,2.99 [ping],12,111297.33,0.11,0.10,0.15,0.16,0.20,0.22,6.81 [ping],16,116292.19,0.14,0.13,0.19,0.21,0.27,0.33,7.50 [ping],20,110622.82,0.18,0.17,0.24,0.27,0.38,0.47,12.21 [ping],24,107468.51,0.22,0.20,0.31,0.38,0.58,0.71,13.86 [ping],28,102827.35,0.27,0.25,0.38,0.44,0.66,0.79,12.87 [ping],32,105733.51,0.30,0.28,0.42,0.50,0.79,0.97,10.56 [ping],36,102046.43,0.35,0.33,0.48,0.56,0.90,1.13,14.66 JSON.SET {key} . {empty string size: 2 B},16,80276.63,0.20,0.18,0.28,0.32,0.41,0.45,6.48 JSON.GET {key} .,16,92191.23,0.17,0.16,0.24,0.27,0.34,0.38,9.80 JSON.SET {key} . {pass-100.json size: 380 B},16,41512.77,0.38,0.35,0.50,0.62,0.81,0.86,9.56 JSON.GET {key} .,16,48374.10,0.33,0.29,0.47,0.56,0.72,0.79,9.36 JSON.GET {key} sclr,16,94801.23,0.17,0.15,0.24,0.27,0.35,0.39,13.21 JSON.SET {key} sclr 1,16,82032.08,0.19,0.18,0.27,0.31,0.40,0.44,8.97 JSON.GET {key} sub_doc,16,81633.51,0.19,0.18,0.27,0.32,0.43,0.49,9.88 JSON.GET {key} sub_doc.sclr,16,95052.35,0.17,0.15,0.24,0.27,0.35,0.39,7.39 JSON.GET {key} array_of_docs,16,68223.05,0.23,0.22,0.29,0.31,0.44,0.50,8.84 JSON.GET {key} array_of_docs[1],16,76390.57,0.21,0.19,0.30,0.34,0.44,0.49,9.99 JSON.GET {key} array_of_docs[1].sclr,16,90202.13,0.18,0.16,0.25,0.29,0.36,0.39,7.87 JSON.SET {key} . {pass-jsonsl-1.json size: 1.4 kB},16,16117.11,0.99,0.91,1.22,1.55,2.17,2.35,9.27 JSON.GET {key} .,16,15193.51,1.05,0.94,1.41,1.75,2.33,2.42,7.19 JSON.GET {key} [0],16,78198.90,0.20,0.19,0.29,0.33,0.42,0.47,10.87 "JSON.SET {key} [0] ""foo""",16,80156.90,0.20,0.18,0.28,0.32,0.40,0.44,12.03 JSON.GET {key} [7],16,99013.98,0.16,0.15,0.23,0.26,0.34,0.38,7.67 JSON.GET {key} [8].zero,16,90562.19,0.17,0.16,0.25,0.28,0.35,0.38,7.03 JSON.SET {key} . {pass-json-parser-0000.json size: 3.5 kB},16,14239.25,1.12,1.06,1.21,1.48,2.35,2.59,11.91 JSON.GET {key} .,16,8366.31,1.91,1.86,2.00,2.04,2.92,3.51,12.92 "JSON.GET {key} [""web-app""].servlet",16,9339.90,1.71,1.68,1.74,1.78,2.68,3.26,10.47 "JSON.GET {key} [""web-app""].servlet[0]",16,13374.88,1.19,1.07,1.54,1.95,2.69,2.82,12.15 "JSON.GET {key} [""web-app""].servlet[0][""servlet-name""]",16,81267.36,0.20,0.18,0.28,0.31,0.38,0.42,9.67 "JSON.SET {key} [""web-app""].servlet[0][""servlet-name""] ""bar""",16,79955.04,0.20,0.18,0.27,0.33,0.42,0.46,6.72 JSON.SET {key} . {pass-jsonsl.yahoo2-json size: 18 kB},16,3394.07,4.71,4.62,4.72,4.79,7.35,9.03,17.78 JSON.GET {key} .,16,891.46,17.92,17.33,17.56,20.12,31.77,42.87,66.64 JSON.SET {key} ResultSet.totalResultsAvailable 1,16,75513.03,0.21,0.19,0.30,0.34,0.42,0.46,9.21 JSON.GET {key} ResultSet.totalResultsAvailable,16,91202.84,0.17,0.16,0.24,0.28,0.35,0.38,5.30 JSON.SET {key} . {pass-jsonsl-yelp.json size: 40 kB},16,1624.86,9.84,9.67,9.86,9.94,15.86,19.36,31.94 JSON.GET {key} .,16,442.55,36.08,35.62,37.78,38.14,55.23,81.33,88.40 JSON.SET {key} message.code 1,16,77677.25,0.20,0.19,0.28,0.33,0.42,0.45,11.07 JSON.GET {key} message.code,16,89206.61,0.18,0.16,0.25,0.28,0.36,0.39,8.60 [JSON.SET num . 0],16,84498.21,0.19,0.17,0.26,0.30,0.39,0.43,8.08 [JSON.NUMINCRBY num . 1],16,78640.20,0.20,0.18,0.28,0.33,0.44,0.48,11.05 [JSON.NUMMULTBY num . 2],16,77170.85,0.21,0.19,0.28,0.33,0.43,0.47,6.85 </code></pre> <h3 id="lua-using-cjson"> Lua using cjson </h3> <pre tabindex="0"><code>json-set-root.lua empty string,16,86817.84,0.18,0.17,0.26,0.31,0.39,0.42,9.36 json-get-root.lua,16,90795.08,0.17,0.16,0.25,0.28,0.36,0.39,8.75 json-set-root.lua pass-100.json,16,84190.26,0.19,0.17,0.27,0.30,0.38,0.41,12.00 json-get-root.lua,16,87170.45,0.18,0.17,0.26,0.29,0.38,0.45,9.81 json-get-path.lua sclr,16,54556.80,0.29,0.28,0.35,0.38,0.57,0.64,7.53 json-set-path.lua sclr 1,16,35907.30,0.44,0.42,0.53,0.67,0.93,1.00,8.57 json-get-path.lua sub_doc,16,51158.84,0.31,0.30,0.36,0.39,0.50,0.62,7.22 json-get-path.lua sub_doc sclr,16,51054.47,0.31,0.29,0.39,0.47,0.66,0.74,7.43 json-get-path.lua array_of_docs,16,39103.77,0.41,0.37,0.57,0.68,0.87,0.94,8.02 json-get-path.lua array_of_docs 1,16,45811.31,0.35,0.32,0.45,0.56,0.77,0.83,8.17 json-get-path.lua array_of_docs 1 sclr,16,47346.83,0.34,0.31,0.44,0.54,0.72,0.79,8.07 json-set-root.lua pass-jsonsl-1.json,16,82100.90,0.19,0.18,0.28,0.31,0.39,0.43,12.43 json-get-root.lua,16,77922.14,0.20,0.18,0.30,0.34,0.66,0.86,8.71 json-get-path.lua 0,16,38162.83,0.42,0.40,0.49,0.59,0.88,0.96,6.16 "json-set-path.lua 0 ""foo""",16,21205.52,0.75,0.70,0.84,1.07,1.60,1.74,5.77 json-get-path.lua 7,16,37254.89,0.43,0.39,0.55,0.69,0.92,0.98,10.24 json-get-path.lua 8 zero,16,33772.43,0.47,0.43,0.63,0.77,1.01,1.09,7.89 json-set-root.lua pass-json-parser-0000.json,16,76314.18,0.21,0.19,0.29,0.33,0.41,0.44,8.16 json-get-root.lua,16,65177.87,0.24,0.21,0.35,0.42,0.89,1.01,9.02 json-get-path.lua web-app servlet,16,15938.62,1.00,0.88,1.45,1.71,2.11,2.20,8.07 json-get-path.lua web-app servlet 0,16,19469.27,0.82,0.78,0.90,1.07,1.67,1.84,7.59 json-get-path.lua web-app servlet 0 servlet-name,16,24694.26,0.65,0.63,0.71,0.74,1.07,1.31,8.60 "json-set-path.lua web-app servlet 0 servlet-name ""bar""",16,16555.74,0.96,0.92,1.05,1.25,1.98,2.20,9.08 json-set-root.lua pass-jsonsl-yahoo2.json,16,47544.65,0.33,0.31,0.41,0.47,0.59,0.64,10.52 json-get-root.lua,16,25369.92,0.63,0.57,0.91,1.05,1.37,1.56,9.95 json-set-path.lua ResultSet totalResultsAvailable 1,16,5077.32,3.15,3.09,3.20,3.24,5.12,6.26,14.98 json-get-path.lua ResultSet totalResultsAvailable,16,7652.56,2.09,2.05,2.13,2.17,3.23,3.95,9.65 json-set-root.lua pass-jsonsl-yelp.json,16,29575.20,0.54,0.52,0.64,0.75,0.94,1.00,12.66 json-get-root.lua,16,18424.29,0.87,0.84,1.25,1.40,1.82,1.95,7.35 json-set-path.lua message code 1,16,2251.07,7.10,6.98,7.14,7.22,11.00,12.79,21.14 json-get-path.lua message code,16,3380.72,4.73,4.44,5.03,6.82,10.28,11.06,14.93 </code></pre> <h3 id="lua-using-cmsgpack"> Lua using cmsgpack </h3> <pre tabindex="0"><code>msgpack-set-root.lua empty string,16,82592.66,0.19,0.18,0.27,0.31,0.38,0.42,10.18 msgpack-get-root.lua,16,89561.41,0.18,0.16,0.25,0.29,0.37,0.40,9.52 msgpack-set-root.lua pass-100.json,16,44326.47,0.36,0.34,0.43,0.54,0.78,0.86,6.45 msgpack-get-root.lua,16,41036.58,0.39,0.36,0.51,0.62,0.84,0.91,7.21 msgpack-get-path.lua sclr,16,55845.56,0.28,0.26,0.36,0.44,0.64,0.70,11.29 msgpack-set-path.lua sclr 1,16,43608.26,0.37,0.34,0.47,0.58,0.78,0.85,10.27 msgpack-get-path.lua sub_doc,16,50153.07,0.32,0.29,0.41,0.50,0.69,0.75,8.56 msgpack-get-path.lua sub_doc sclr,16,54016.35,0.29,0.27,0.38,0.46,0.62,0.67,6.38 msgpack-get-path.lua array_of_docs,16,45394.79,0.35,0.32,0.45,0.56,0.78,0.85,11.88 msgpack-get-path.lua array_of_docs 1,16,48336.48,0.33,0.30,0.42,0.52,0.71,0.76,7.69 msgpack-get-path.lua array_of_docs 1 sclr,16,53689.41,0.30,0.27,0.38,0.46,0.64,0.69,11.16 msgpack-set-root.lua pass-jsonsl-1.json,16,28956.94,0.55,0.51,0.65,0.82,1.17,1.26,8.39 msgpack-get-root.lua,16,26045.44,0.61,0.58,0.68,0.83,1.28,1.42,8.56 "msgpack-set-path.lua 0 ""foo""",16,29813.56,0.53,0.49,0.67,0.83,1.15,1.22,6.82 msgpack-get-path.lua 0,16,44827.58,0.36,0.32,0.48,0.58,0.76,0.81,9.19 msgpack-get-path.lua 7,16,47529.14,0.33,0.31,0.42,0.53,0.73,0.79,7.47 msgpack-get-path.lua 8 zero,16,44442.72,0.36,0.33,0.45,0.56,0.77,0.85,8.11 msgpack-set-root.lua pass-json-parser-0000.json,16,19585.82,0.81,0.78,0.85,1.05,1.66,1.86,4.33 msgpack-get-root.lua,16,19014.08,0.84,0.73,1.23,1.45,1.76,1.84,13.52 msgpack-get-path.lua web-app servlet,16,18992.61,0.84,0.73,1.23,1.45,1.75,1.82,8.19 msgpack-get-path.lua web-app servlet 0,16,24328.78,0.66,0.64,0.73,0.77,1.15,1.34,8.81 msgpack-get-path.lua web-app servlet 0 servlet-name,16,31012.81,0.51,0.49,0.57,0.65,1.02,1.13,8.11 "msgpack-set-path.lua web-app servlet 0 servlet-name ""bar""",16,20388.54,0.78,0.73,0.88,1.08,1.63,1.78,7.22 msgpack-set-root.lua pass-jsonsl-yahoo2.json,16,5597.60,2.85,2.81,2.89,2.94,4.57,5.59,10.19 msgpack-get-root.lua,16,6585.01,2.43,2.39,2.52,2.66,3.76,4.80,10.59 msgpack-set-path.lua ResultSet totalResultsAvailable 1,16,6666.95,2.40,2.35,2.43,2.47,3.78,4.59,12.08 msgpack-get-path.lua ResultSet totalResultsAvailable,16,10733.03,1.49,1.45,1.60,1.66,2.36,2.93,13.15 msgpack-set-root-lua pass-jsonsl-yelp.json,16,2291.53,6.97,6.87,7.01,7.12,10.54,12.89,21.75 msgpack-get-root.lua,16,2889.59,5.53,5.45,5.71,5.86,8.80,10.48,25.55 msgpack-set-path.lua message code 1,16,2847.85,5.61,5.44,5.56,6.01,10.58,11.90,16.91 msgpack-get-path.lua message code,16,5030.95,3.18,3.07,3.24,3.57,6.08,6.92,12.44 </code></pre> <nav> </nav> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/data-types/json/performance/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/actions/import/.html
<section class="prose w-full py-12 max-w-none"> <h1> Import database action requests </h1> <p class="text-lg -mt-5 mb-10"> Import database requests </p> <table> <thead> <tr> <th> Method </th> <th> Path </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="#post-bdbs-actions-import"> POST </a> </td> <td> <code> /v1/bdbs/{uid}/actions/import </code> </td> <td> Initiate manual dataset import </td> </tr> </tbody> </table> <h2 id="post-bdbs-actions-import"> Initiate manual dataset import </h2> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">POST /v1/bdbs/<span class="o">{</span>int: uid<span class="o">}</span>/actions/import </span></span></code></pre> </div> <p> Initiate a manual import process. </p> <h3 id="permissions"> Permissions </h3> <table> <thead> <tr> <th> Permission name </th> <th> Roles </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#start_bdb_import"> start_bdb_import </a> </td> <td> admin <br/> cluster_member <br/> db_member </td> </tr> </tbody> </table> <h3 id="post-request"> Request </h3> <h4 id="example-http-request"> Example HTTP request </h4> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">POST /bdbs/1/actions/import </span></span></code></pre> </div> <h4 id="headers"> Headers </h4> <table> <thead> <tr> <th> Key </th> <th> Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> Host </td> <td> cnm.cluster.fqdn </td> <td> Domain name </td> </tr> <tr> <td> Accept </td> <td> application/json </td> <td> Accepted media type </td> </tr> <tr> <td> Content-Length </td> <td> 0 </td> <td> Length of the request body in octets </td> </tr> </tbody> </table> <h4 id="url-parameters"> URL parameters </h4> <table> <thead> <tr> <th> Field </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> uid </td> <td> integer </td> <td> The unique ID of the database </td> </tr> </tbody> </table> <h4 id="body"> Body </h4> <p> The request <em> may </em> contain a subset of the <a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/bdb/"> BDB JSON object </a> , which includes the following import-related attributes: </p> <table> <thead> <tr> <th> Field </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> dataset_import_sources </td> <td> array of <a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/bdb/dataset_import_sources/"> dataset_import_sources </a> objects </td> <td> Details for the import sources. Call <a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/jsonschema/#get-jsonschema"> <code> GET /jsonschema </code> </a> on the bdb object and review the <code> dataset_import_sources </code> field to retrieve the object's structure. </td> </tr> <tr> <td> email_notification </td> <td> boolean </td> <td> Enable/disable an email notification on import failure/ completion. (optional) </td> </tr> </tbody> </table> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> Other attributes are not allowed and will cause the request to fail. </div> </div> <h5 id="example-json-body"> Example JSON Body </h5> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"dataset_import_sources"</span><span class="p">:</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"type"</span><span class="p">:</span> <span class="s2">"url"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"url"</span><span class="p">:</span> <span class="s2">"http://..."</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"type"</span><span class="p">:</span> <span class="s2">"url"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"url"</span><span class="p">:</span> <span class="s2">"redis://..."</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> <span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="nt">"email_notification"</span><span class="p">:</span> <span class="kc">true</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <p> This request initiates an import process using <code> dataset_import_sources </code> values that were previously configured for the database. </p> <h3 id="post-response"> Response </h3> <p> Returns a status code. </p> <h3 id="post-status-codes"> Status codes </h3> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1"> 200 OK </a> </td> <td> The request is accepted and is being processed. In order to monitor progress, the <code> import_status </code> , <code> import_progress </code> , and <code> import_failure_reason </code> attributes can be consulted. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5"> 404 Not Found </a> </td> <td> Attempting to perform an action on a nonexistent database. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7"> 406Β NotΒ Acceptable </a> </td> <td> Not all the modules loaded to the database support 'backup_restore' capability. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10"> 409 Conflict </a> </td> <td> Database is currently busy with another action. In this context, this is a temporary condition and the request should be reattempted later. </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/actions/import/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/integrate/redis-data-integration/release-notes/rdi-1-4-2/.html
<section class="prose w-full py-12"> <h1> Redis Data Integration release notes 1.4.2 (November 2024) </h1> <p class="text-lg -mt-5 mb-10"> Installation on Kubernetes with a Helm chart. Improvements for installation on VMs. </p> <blockquote> <p> This maintenance release replaces the 1.4.1 release. </p> </blockquote> <p> RDI’s mission is to help Redis customers sync Redis Enterprise with live data from their slow disk-based databases to: </p> <ul> <li> Meet the required speed and scale of read queries and provide an excellent and predictable user experience. </li> <li> Save resources and time when building pipelines and coding data transformations. </li> <li> Reduce the total cost of ownership by saving money on expensive database read replicas. </li> </ul> <p> RDI keeps the Redis cache up to date with changes in the primary database, using a <a href="https://en.wikipedia.org/wiki/Change_data_capture"> <em> Change Data Capture (CDC) </em> </a> mechanism. It also lets you <em> transform </em> the data from relational tables into convenient and fast data structures that match your app's requirements. You specify the transformations using a configuration system, so no coding is required. </p> <h2 id="headlines"> Headlines </h2> <ul> <li> <p> Installation on <a href="/docs/latest/integrate/redis-data-integration/installation/install-k8s/"> Kubernetes </a> using a <a href="https://helm.sh/docs/"> Helm chart </a> . You can install on <a href="https://docs.openshift.com/"> OpenShift </a> or other flavours of K8s using Helm. </p> </li> <li> <p> Improvements for installation on VMs: </p> <ul> <li> Installer checks if the OS firewall is enabled on Ubuntu and RHEL. </li> <li> Installer verifies DNS resolution from RDI components. </li> <li> Installer provides log lines from components that failed during RDI deployment if a problem occurs. </li> <li> Improved verification of RDI installation. </li> <li> Installer verifies if the RDI database is in use by another instance of RDI. </li> <li> Installer checks and warns if any <a href="https://www.netfilter.org/projects/iptables/index.html"> <code> iptables </code> </a> rules are set. </li> <li> Improved message when RDI tries to connect to its Redis database with invalid TLS keys. </li> </ul> </li> </ul> <h2 id="issues-fixed"> Issues fixed </h2> <ul> <li> <strong> RDSC-2802 </strong> : Reintroduce checks for DNS resolution and network connectivity from inside a K8s pod. </li> <li> <strong> RDSC-2804 </strong> : RDI installation previously failed if the user specified a non-default HTTPS port. The user can now specify the port correctly. </li> </ul> <h2 id="limitations"> Limitations </h2> <p> RDI can write data to a Redis Active-Active database. However, it doesn't support writing data to two or more Active-Active replicas. Writing data from RDI to several Active-Active replicas could easily harm data integrity as RDI is not synchronous with the source database commits. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/integrate/redis-data-integration/release-notes/rdi-1-4-2/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/lpop/.html
<section class="prose w-full py-12"> <h1 class="command-name"> LPOP </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">LPOP key [count]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 1.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(N) where N is the number of elements returned </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @write </code> <span class="mr-1 last:hidden"> , </span> <code> @list </code> <span class="mr-1 last:hidden"> , </span> <code> @fast </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Removes and returns the first elements of the list stored at <code> key </code> . </p> <p> By default, the command pops a single element from the beginning of the list. When provided with the optional <code> count </code> argument, the reply will consist of up to <code> count </code> elements, depending on the list's length. </p> <h2 id="examples"> Examples </h2> <div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex"> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z"> </path> </svg> </div> <form class="redis-cli overflow-y-auto max-h-80"> <pre tabindex="0">redis&gt; RPUSH mylist "one" "two" "three" "four" "five" (integer) 5 redis&gt; LPOP mylist "one" redis&gt; LPOP mylist 2 1) "two" 2) "three" redis&gt; LRANGE mylist 0 -1 1) "four" 2) "five" </pre> <div class="prompt" style=""> <span> redis&gt; </span> <input autocomplete="off" name="prompt" spellcheck="false" type="text"/> </div> </form> <h2 id="resp2-reply"> RESP2 Reply </h2> <p> One of the following: </p> <ul> <li> <a href="../../develop/reference/protocol-spec#bulk-strings"> Nil reply </a> : if the key does not exist. </li> <li> <a href="../../develop/reference/protocol-spec#bulk-strings"> Bulk string reply </a> : when called without the <em> count </em> argument, the value of the first element. </li> <li> <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> : when called with the <em> count </em> argument, a list of popped elements. </li> </ul> <h2 id="resp3-reply"> RESP3 Reply </h2> <p> One of the following: </p> <ul> <li> <a href="../../develop/reference/protocol-spec#nulls"> Null reply </a> : if the key does not exist. </li> <li> <a href="../../develop/reference/protocol-spec#bulk-strings"> Bulk string reply </a> : when called without the <em> count </em> argument, the value of the first element. </li> <li> <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> : when called with the <em> count </em> argument, a list of popped elements. </li> </ul> <br/> <h2> History </h2> <ul> <li> Starting with Redis version 6.2.0: Added the <code> count </code> argument. </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/lpop/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/ts.queryindex.html
<section class="prose w-full py-12"> <h1 class="command-name"> TS.QUERYINDEX </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">TS.QUERYINDEX filterExpr... </pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available in: </dt> <dd class="m-0"> <a href="/docs/stack"> Redis Stack </a> / <a href="/docs/data-types/timeseries"> TimeSeries 1.0.0 </a> </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(n) where n is the number of time-series that match the filters </dd> </dl> <p> Get all time series keys matching a filter list </p> <p> <a href="#examples"> Examples </a> </p> <h2 id="required-arguments"> Required arguments </h2> <details open=""> <summary> <code> filterExpr... </code> </summary> <p> filters time series based on their labels and label values. Each filter expression has one of the following syntaxes: </p> <ul> <li> <code> label!= </code> - the time series has a label named <code> label </code> </li> <li> <code> label=value </code> - the time series has a label named <code> label </code> with a value equal to <code> value </code> </li> <li> <code> label=(value1,value2,...) </code> - the time series has a label named <code> label </code> with a value equal to one of the values in the list </li> <li> <code> label= </code> - the time series does not have a label named <code> label </code> </li> <li> <code> label!=value </code> - the time series does not have a label named <code> label </code> with a value equal to <code> value </code> </li> <li> <code> label!=(value1,value2,...) </code> - the time series does not have a label named <code> label </code> with a value equal to any of the values in the list </li> </ul> <p> <note> <b> Notes: </b> </note> </p> <ul> <li> At least one filter expression with a syntax <code> label=value </code> or <code> label=(value1,value2,...) </code> is required. </li> <li> Filter expressions are conjunctive. For example, the filter <code> type=temperature room=study </code> means that a time series is a temperature time series of a study room. </li> <li> Whitespaces are unallowed in a filter expression except between quotes or double quotes in values - e.g., <code> x="y y" </code> or <code> x='(y y,z z)' </code> . </li> </ul> </details> <p> <note> <b> Note: </b> The <code> QUERYINDEX </code> command cannot be part of a transaction when running on a Redis cluster. </note> </p> <h2 id="return-value"> Return value </h2> <p> Returns one of these replies: </p> <ul> <li> <a href="/docs/latest/develop/reference/protocol-spec/#arrays"> Array reply </a> where each element is a <a href="/docs/latest/develop/reference/protocol-spec/#bulk-strings"> Bulk string reply </a> : a time series key. The array is empty if no time series matches the filter. </li> <li> [] (e.g., on invalid filter expression) </li> </ul> <h2 id="examples"> Examples </h2> <details open=""> <summary> <b> Find keys by location and sensor type </b> </summary> <p> Create a set of sensors to measure temperature and humidity in your study and kitchen. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.CREATE telemetry:study:temperature LABELS room study <span class="nb">type</span> temperature </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.CREATE telemetry:study:humidity LABELS room study <span class="nb">type</span> humidity </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.CREATE telemetry:kitchen:temperature LABELS room kitchen <span class="nb">type</span> temperature </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.CREATE telemetry:kitchen:humidity LABELS room kitchen <span class="nb">type</span> humidity </span></span><span class="line"><span class="cl">OK</span></span></code></pre> </div> <p> Retrieve keys of all time series representing sensors located in the kitchen. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.QUERYINDEX <span class="nv">room</span><span class="o">=</span>kitchen </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="s2">"telemetry:kitchen:humidity"</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"telemetry:kitchen:temperature"</span></span></span></code></pre> </div> <p> To retrieve the keys of all time series representing sensors that measure temperature, use this query: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.QUERYINDEX <span class="nv">type</span><span class="o">=</span>temperature </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="s2">"telemetry:kitchen:temperature"</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"telemetry:study:temperature"</span></span></span></code></pre> </div> </details> <h2 id="see-also"> See also </h2> <p> <a href="/docs/latest/commands/ts.create/"> <code> TS.CREATE </code> </a> | <a href="/docs/latest/commands/ts.mrange/"> <code> TS.MRANGE </code> </a> | <a href="/docs/latest/commands/ts.mrevrange/"> <code> TS.MREVRANGE </code> </a> | <a href="/docs/latest/commands/ts.mget/"> <code> TS.MGET </code> </a> </p> <h2 id="related-topics"> Related topics </h2> <p> <a href="/docs/latest/develop/data-types/timeseries/"> RedisTimeSeries </a> </p> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/ts.queryindex/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/references/rest-api/objects/cm_settings/.html
<section class="prose w-full py-12 max-w-none"> <h1> Cluster Manager settings object </h1> <p class="text-lg -mt-5 mb-10"> A REST API object that represents Cluster Manager UI settings </p> <table> <thead> <tr> <th> Name </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> timezone </td> <td> string </td> <td> Configurable <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones"> time zone </a> for the Cluster Manager UI. The default time zone is UTC. </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/rest-api/objects/cm_settings/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rc/security/access-control/saml-sso/saml-integration-google/.html
<section class="prose w-full py-12 max-w-none"> <h1> Google Workspace SAML integration guide </h1> <p class="text-lg -mt-5 mb-10"> This integration guide shows how to configure Google Workspace as a SAML single sign on provider for your Redis Cloud account. </p> <p> This guide shows how to configure <a href="https://workspace.google.com/"> Google Workspace </a> as a SAML single sign-on identity provider (IdP) for your Redis Cloud account. </p> <p> To learn more about Redis Cloud support for SAML, see <a href="/docs/latest/operate/rc/security/access-control/saml-sso/"> SAML single sign-on </a> . </p> <p> Before completing this guide, you must <a href="/docs/latest/operate/rc/security/access-control/saml-sso/#verify-domain"> verify ownership of any domains </a> you want to associate with your SAML setup. </p> <h2 id="step-1-set-up-your-identity-provider-idp"> Step 1: Set up your identity provider (IdP) </h2> <h3 id="create-the-google-workspace-saml-application"> Create the Google Workspace SAML application </h3> <ol> <li> <p> Sign in to your <a href="https://admin.google.com/"> Google Workspace admin account </a> . </p> </li> <li> <p> From the main menu, select <strong> Apps </strong> then <strong> Web and mobile apps </strong> . </p> <a href="/docs/latest/images/rc/saml/google_workspace_saml_0.png" sdata-lightbox="/images/rc/saml/google_workspace_saml_0.png"> <img src="/docs/latest/images/rc/saml/google_workspace_saml_0.png"/> </a> </li> <li> <p> Once in Web and mobile apps, select <strong> Add custom SAML app </strong> from the dropdown list. </p> <a href="/docs/latest/images/rc/saml/google_workspace_saml_1.png" sdata-lightbox="/images/rc/saml/google_workspace_saml_1.png"> <img src="/docs/latest/images/rc/saml/google_workspace_saml_1.png"/> </a> </li> <li> <p> To begin, change the <strong> App name </strong> and <strong> Description </strong> to <strong> Redis Cloud </strong> . You can also choose an <strong> App icon </strong> for the application. We suggest you upload a Redis icon. Once complete, select <strong> Continue </strong> . </p> <a href="/docs/latest/images/rc/saml/google_workspace_saml_2.png" sdata-lightbox="/images/rc/saml/google_workspace_saml_2.png"> <img src="/docs/latest/images/rc/saml/google_workspace_saml_2.png"/> </a> </li> <li> <p> In the next screen, you will find all of the information needed to configure SAML in Redis Cloud. Select the <strong> copy </strong> button for the following information sections: </p> <ul> <li> SSO URL </li> <li> Entity ID </li> <li> Certificate </li> </ul> <a href="/docs/latest/images/rc/saml/google_workspace_saml_3.png" sdata-lightbox="/images/rc/saml/google_workspace_saml_3.png"> <img src="/docs/latest/images/rc/saml/google_workspace_saml_3.png"/> </a> </li> </ol> <p> Once complete, select <strong> Continue </strong> . </p> <h2 id="step-2-configure-saml-support-in-redis-cloud"> Step 2: Configure SAML support in Redis Cloud </h2> <p> Now that you have your Google Workspace IdP server information, configure support for SAML in Redis Cloud. </p> <h3 id="sign-in-to-redis-cloud"> Sign in to Redis Cloud </h3> <p> Sign in to your account on the <a href="https://cloud.redis.io/#/login"> Redis Cloud console </a> . </p> <h3 id="activate-saml-in-access-management"> Activate SAML in Access Management </h3> <p> To activate SAML, you must have a local user (or social sign-on user) with the <code> owner </code> role. If you have the correct permissions, you will see the <strong> Single Sign-On </strong> tab. </p> <ol> <li> <p> Add the information you saved previously in the <strong> Google identity provider details </strong> screen. This includes: </p> <ul> <li> <strong> Issuer (IdP Entity ID) </strong> : <code> Entity ID </code> . </li> <li> <strong> IdP server URL </strong> : <code> SSO URL </code> . </li> <li> <strong> Assertion signing certificate </strong> : <code> Certificate </code> . </li> </ul> <a href="/docs/latest/images/rc/saml/sm_saml_1.png" sdata-lightbox="/images/rc/saml/sm_saml_1.png"> <img src="/docs/latest/images/rc/saml/sm_saml_1.png"/> </a> <p> Select <strong> Enable </strong> and wait a few seconds for the status to change. </p> </li> <li> <p> Select <strong> Download </strong> to get the service provider (SP) metadata. Save the file to your local hard disk. </p> <a href="/docs/latest/images/rc/saml/sm_saml_3.png" sdata-lightbox="/images/rc/saml/sm_saml_3.png"> <img src="/docs/latest/images/rc/saml/sm_saml_3.png"/> </a> </li> <li> <p> Open the file in any text editor. Save the following text from the metadata: </p> <ul> <li> <p> <strong> EntityID </strong> : The unique name of the service provider (SP). </p> <a href="/docs/latest/images/rc/saml/sm_saml_4.png" sdata-lightbox="/images/rc/saml/sm_saml_4.png"> <img src="/docs/latest/images/rc/saml/sm_saml_4.png"/> </a> </li> <li> <p> <strong> Location </strong> : The location of the assertion consumer service. </p> </li> </ul> </li> </ol> <a href="/docs/latest/images/rc/saml/sm_saml_5.png" sdata-lightbox="/images/rc/saml/sm_saml_5.png"> <img src="/docs/latest/images/rc/saml/sm_saml_5.png"/> </a> <h2 id="step-3-add-a-custom-attribute-to-google-workspaces-user-profile"> Step 3: Add a custom attribute to Google Workspace's user profile </h2> <ol> <li> <p> From the main menu in Google Workspace, select <strong> Directory </strong> then <strong> Users </strong> , and from the <strong> more options </strong> dropdown select <strong> Manage custom attributes </strong> . </p> <a href="/docs/latest/images/rc/saml/google_workspace_saml_7.png" sdata-lightbox="/images/rc/saml/google_workspace_saml_7.png"> <img src="/docs/latest/images/rc/saml/google_workspace_saml_7.png"/> </a> </li> <li> <p> From the <strong> Manage user attributes </strong> screen, select <strong> Add Custom Attribute </strong> . </p> <a href="/docs/latest/images/rc/saml/google_workspace_saml_8.png" sdata-lightbox="/images/rc/saml/google_workspace_saml_8.png"> <img src="/docs/latest/images/rc/saml/google_workspace_saml_8.png"/> </a> </li> <li> <p> Add the following information for the new custom attribute: </p> <ul> <li> <strong> Category </strong> : <code> Redis Cloud </code> </li> <li> <strong> Name </strong> : <code> redisAccountMapping </code> </li> <li> <strong> Info type </strong> : <code> Text </code> </li> <li> <strong> Visibility </strong> : <code> Visible to user and admin </code> </li> <li> <strong> No. of values </strong> : <code> Single </code> </li> </ul> <a href="/docs/latest/images/rc/saml/google_workspace_saml_9.png" sdata-lightbox="/images/rc/saml/google_workspace_saml_9.png"> <img src="/docs/latest/images/rc/saml/google_workspace_saml_9.png"/> </a> <p> Once complete, select <strong> Add </strong> . The summary page now displays the new <strong> redisAccountMapping </strong> custom field. </p> <a href="/docs/latest/images/rc/saml/google_workspace_saml_10.png" sdata-lightbox="/images/rc/saml/google_workspace_saml_10.png"> <img src="/docs/latest/images/rc/saml/google_workspace_saml_10.png"/> </a> </li> <li> <p> From the main menu in Google Workspace, select <strong> Directory </strong> then <strong> Users </strong> , then select the user you wish to configure. </p> <a href="/docs/latest/images/rc/saml/google_workspace_saml_11.png" sdata-lightbox="/images/rc/saml/google_workspace_saml_11.png"> <img src="/docs/latest/images/rc/saml/google_workspace_saml_11.png"/> </a> </li> <li> <p> Each user who needs to access Redis Cloud through SAML needs to define the <strong> redisAccountMapping </strong> attribute. The <code> redisAccountMapping </code> key-value pair consists of the lowercase role name (owner, member, manager, billing_admin, or viewer) and your Redis Cloud Account ID found in the <a href="/docs/latest/operate/rc/accounts/account-settings/"> account settings </a> . </p> <a href="/docs/latest/images/rc/saml/google_workspace_saml_12.png" sdata-lightbox="/images/rc/saml/google_workspace_saml_12.png"> <img src="/docs/latest/images/rc/saml/google_workspace_saml_12.png"/> </a> <p> Once complete, select <strong> Save </strong> . </p> <a href="/docs/latest/images/rc/saml/google_workspace_saml_13.png" sdata-lightbox="/images/rc/saml/google_workspace_saml_13.png"> <img src="/docs/latest/images/rc/saml/google_workspace_saml_13.png"/> </a> <p> Repeat this step for each user who needs to define the <code> redisAccountMapping </code> attribute. </p> </li> </ol> <h2 id="step-4-finish-saml-configuration-in-google-workspaces-redis-cloud-application"> Step 4: Finish SAML configuration in Google Workspace's Redis Cloud Application </h2> <ol> <li> <p> Return to the <strong> Service provider details </strong> screen in Google Workspace, and add the following information: </p> <ul> <li> <strong> ACS URL </strong> : The Location from the downloaded service provider (SP) metadata </li> <li> <strong> Entity Id </strong> : The EntityID from the downloaded service provider (SP) metadata </li> </ul> <a href="/docs/latest/images/rc/saml/google_workspace_saml_6.png" sdata-lightbox="/images/rc/saml/google_workspace_saml_6.png"> <img src="/docs/latest/images/rc/saml/google_workspace_saml_6.png"/> </a> <p> Leave the <strong> Name ID </strong> default information as it is. Once complete, select <strong> Continue </strong> . </p> </li> <li> <p> Configure the <strong> Redis Cloud </strong> application's attribute mappings. Select <strong> Add Mapping </strong> . </p> <a href="/docs/latest/images/rc/saml/google_workspace_saml_14.png" sdata-lightbox="/images/rc/saml/google_workspace_saml_14.png"> <img src="/docs/latest/images/rc/saml/google_workspace_saml_14.png"/> </a> <p> In the next screen, map these attributes: </p> <ul> <li> <strong> Primary Email </strong> : <code> Email </code> </li> <li> <strong> First name </strong> : <code> FirstName </code> </li> <li> <strong> Last name </strong> : <code> LastName </code> </li> <li> <strong> redisAccountMapping </strong> : <code> redisAccountMapping </code> </li> </ul> <a href="/docs/latest/images/rc/saml/google_workspace_saml_15.png" sdata-lightbox="/images/rc/saml/google_workspace_saml_15.png"> <img src="/docs/latest/images/rc/saml/google_workspace_saml_15.png"/> </a> <p> Once complete, select <strong> Finish </strong> . </p> </li> <li> <p> Next, we need to turn on the Redis Cloud service for all users, select <strong> Web and mobile apps </strong> -&gt; <strong> Redis Cloud </strong> and then <strong> service status </strong> . Select <strong> ON for everyone </strong> . Once complete, select <strong> Save </strong> . </p> <a href="/docs/latest/images/rc/saml/google_workspace_saml_16.png" sdata-lightbox="/images/rc/saml/google_workspace_saml_16.png"> <img src="/docs/latest/images/rc/saml/google_workspace_saml_16.png"/> </a> </li> </ol> <h2 id="step-5-activate-saml-integration"> Step 5: Activate SAML integration </h2> <p> The final step in our SAML integration with AWS IAM identity Center is to activate the SAML integration. </p> <ol> <li> <p> In the Single Sign-On screen, select <strong> Activate </strong> . </p> <a href="/docs/latest/images/rc/saml/sm_saml_8.png" sdata-lightbox="/images/rc/saml/sm_saml_8.png"> <img src="/docs/latest/images/rc/saml/sm_saml_8.png"/> </a> </li> </ol> <p> A logout notification screen displays, letting you know that you are redirected to Google's login screen. </p> <ol> <li> <p> Select the Google account you wish to login with. </p> <a href="/docs/latest/images/rc/saml/google_workspace_saml_18.png" sdata-lightbox="/images/rc/saml/google_workspace_saml_18.png"> <img src="/docs/latest/images/rc/saml/google_workspace_saml_18.png"/> </a> </li> <li> <p> If everything is configured correctly, you should get a <strong> SAML activation succeeded </strong> message. From this point forward, users need to click <strong> SSO </strong> to log in to the Redis Cloud console. </p> <a href="/docs/latest/images/rc/saml/google_workspace_saml_19.png" sdata-lightbox="/images/rc/saml/google_workspace_saml_19.png"> <img src="/docs/latest/images/rc/saml/google_workspace_saml_19.png"/> </a> </li> </ol> <p> A message displays, stating that your local user is now converted to a SAML user. Select <strong> Confirm </strong> . </p> <p> You have successfully configured Google Workspace as an identification provider. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rc/security/access-control/saml-sso/saml-integration-google/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/references/rest-api/requests/logs/.html
<section class="prose w-full py-12 max-w-none"> <h1> Logs requests </h1> <p class="text-lg -mt-5 mb-10"> Cluster event logs requests </p> <table> <thead> <tr> <th> Method </th> <th> Path </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="#get-logs"> GET </a> </td> <td> <code> /v1/logs </code> </td> <td> Get cluster events log </td> </tr> </tbody> </table> <h2 id="get-logs"> Get cluster events log </h2> <pre><code>GET /v1/logs </code></pre> <p> Get cluster events log. </p> <h4 id="required-permissions"> Required permissions </h4> <table> <thead> <tr> <th> Permission name </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/references/rest-api/permissions/#view_logged_events"> view_logged_events </a> </td> </tr> </tbody> </table> <h3 id="get-request"> Request </h3> <h4 id="example-http-request"> Example HTTP request </h4> <pre><code>GET /logs?order=desc </code></pre> <h4 id="request-headers"> Request headers </h4> <table> <thead> <tr> <th> Key </th> <th> Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> Host </td> <td> cnm.cluster.fqdn </td> <td> Domain name </td> </tr> <tr> <td> Accept </td> <td> application/json </td> <td> Accepted media type </td> </tr> </tbody> </table> <h4 id="query-parameters"> Query parameters </h4> <table> <thead> <tr> <th> Field </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> stime </td> <td> ISO_8601 </td> <td> Start time before which we don't want events. (optional) </td> </tr> <tr> <td> etime </td> <td> ISO_8601 </td> <td> End time after which we don't want events. (optional) </td> </tr> <tr> <td> order </td> <td> string </td> <td> desc/asc - get events in descending or ascending order. Defaults to asc. </td> </tr> <tr> <td> limit </td> <td> integer </td> <td> Maximum number of events to return. (optional) </td> </tr> <tr> <td> offset </td> <td> integer </td> <td> Skip offset events before returning first one (useful for pagination). (optional) </td> </tr> </tbody> </table> <h3 id="get-response"> Response </h3> <p> Returns a JSON array of events. </p> <h4 id="example-json-body"> Example JSON body </h4> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"time"</span><span class="p">:</span> <span class="s2">"2014-08-29T11:19:49Z"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"type"</span><span class="p">:</span> <span class="s2">"bdb_name_updated"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"severity"</span><span class="p">:</span> <span class="s2">"INFO"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"bdb_uid"</span><span class="p">:</span> <span class="s2">"1"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"old_val"</span><span class="p">:</span> <span class="s2">"test"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"new_val"</span><span class="p">:</span> <span class="s2">"test123"</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"time"</span><span class="p">:</span> <span class="s2">"2014-08-29T11:18:48Z"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"type"</span><span class="p">:</span> <span class="s2">"cluster_bdb_created"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"severity"</span><span class="p">:</span> <span class="s2">"INFO"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"bdb_uid"</span><span class="p">:</span> <span class="s2">"1"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"bdb_name"</span><span class="p">:</span> <span class="s2">"test"</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"time"</span><span class="p">:</span> <span class="s2">"2014-08-29T11:17:49Z"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"type"</span><span class="p">:</span> <span class="s2">"cluster_node_joined"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"severity"</span><span class="p">:</span> <span class="s2">"INFO"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"node_uid"</span><span class="p">:</span> <span class="mi">2</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">]</span> </span></span></code></pre> </div> <h4 id="event-object"> Event object </h4> <table> <thead> <tr> <th> Field </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> time </td> <td> Timestamp when event happened. </td> </tr> <tr> <td> type </td> <td> Event type. Additional fields may be available for certain event types. </td> </tr> <tr> <td> additional fields </td> <td> Additional fields may be present based on event type. </td> </tr> </tbody> </table> <h3 id="get-status-codes"> Status codes </h3> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1"> 200 OK </a> </td> <td> No error </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/rest-api/requests/logs/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/function-dump/.html
<section class="prose w-full py-12"> <h1 class="command-name"> FUNCTION DUMP </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">FUNCTION DUMP</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 7.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(N) where N is the number of functions </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> <code> @scripting </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Return the serialized payload of loaded libraries. You can restore the serialized payload later with the <a href="/docs/latest/commands/function-restore/"> <code> FUNCTION RESTORE </code> </a> command. </p> <p> For more information please refer to <a href="/docs/latest/develop/interact/programmability/functions-intro/"> Introduction to Redis Functions </a> . </p> <h2 id="examples"> Examples </h2> <p> The following example shows how to dump loaded libraries using <code> FUNCTION DUMP </code> and then it calls <a href="/docs/latest/commands/function-flush/"> <code> FUNCTION FLUSH </code> </a> deletes all the libraries. Then, it restores the original libraries from the serialized payload with <a href="/docs/latest/commands/function-restore/"> <code> FUNCTION RESTORE </code> </a> . </p> <pre tabindex="0"><code>redis&gt; FUNCTION LOAD "#!lua name=mylib \n redis.register_function('myfunc', function(keys, args) return args[1] end)" "mylib" redis&gt; FUNCTION DUMP "\xf5\xc3@X@]\x1f#!lua name=mylib \n redis.registe\rr_function('my@\x0b\x02', @\x06`\x12\nkeys, args) 6\x03turn`\x0c\a[1] end)\x0c\x00\xba\x98\xc2\xa2\x13\x0e$\a" redis&gt; FUNCTION FLUSH OK redis&gt; FUNCTION RESTORE "\xf5\xc3@X@]\x1f#!lua name=mylib \n redis.registe\rr_function('my@\x0b\x02', @\x06`\x12\nkeys, args) 6\x03turn`\x0c\a[1] end)\x0c\x00\xba\x98\xc2\xa2\x13\x0e$\a" OK redis&gt; FUNCTION LIST 1) 1) "library_name" 2) "mylib" 3) "engine" 4) "LUA" 5) "functions" 6) 1) 1) "name" 2) "myfunc" 3) "description" 4) (nil) 5) "flags" 6) (empty array) </code></pre> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#bulk-strings"> Bulk string reply </a> : the serialized payload <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/function-dump/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/zcount/.html
<section class="prose w-full py-12"> <h1 class="command-name"> ZCOUNT </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">ZCOUNT key min max</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 2.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(log(N)) with N being the number of elements in the sorted set. </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @read </code> <span class="mr-1 last:hidden"> , </span> <code> @sortedset </code> <span class="mr-1 last:hidden"> , </span> <code> @fast </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Returns the number of elements in the sorted set at <code> key </code> with a score between <code> min </code> and <code> max </code> . </p> <p> The <code> min </code> and <code> max </code> arguments have the same semantic as described for <a href="/docs/latest/commands/zrangebyscore/"> <code> ZRANGEBYSCORE </code> </a> . </p> <p> Note: the command has a complexity of just O(log(N)) because it uses elements ranks (see <a href="/docs/latest/commands/zrank/"> <code> ZRANK </code> </a> ) to get an idea of the range. Because of this there is no need to do a work proportional to the size of the range. </p> <h2 id="examples"> Examples </h2> <div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex"> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z"> </path> </svg> </div> <form class="redis-cli overflow-y-auto max-h-80"> <pre tabindex="0">redis&gt; ZADD myzset 1 "one" (integer) 1 redis&gt; ZADD myzset 2 "two" (integer) 1 redis&gt; ZADD myzset 3 "three" (integer) 1 redis&gt; ZCOUNT myzset -inf +inf (integer) 3 redis&gt; ZCOUNT myzset (1 3 (integer) 2 </pre> <div class="prompt" style=""> <span> redis&gt; </span> <input autocomplete="off" name="prompt" spellcheck="false" type="text"/> </div> </form> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : the number of members in the specified score range. <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/zcount/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/develop/use/pipelining/.html
<section class="prose w-full py-12"> <h1> Redis pipelining </h1> <p class="text-lg -mt-5 mb-10"> How to optimize round-trip times by batching Redis commands </p> <p> Redis pipelining is a technique for improving performance by issuing multiple commands at once without waiting for the response to each individual command. Pipelining is supported by most Redis clients. This document describes the problem that pipelining is designed to solve and how pipelining works in Redis. </p> <h2 id="requestresponse-protocols-and-round-trip-time-rtt"> Request/Response protocols and round-trip time (RTT) </h2> <p> Redis is a TCP server using the client-server model and what is called a <em> Request/Response </em> protocol. </p> <p> This means that usually a request is accomplished with the following steps: </p> <ul> <li> The client sends a query to the server, and reads from the socket, usually in a blocking way, for the server response. </li> <li> The server processes the command and sends the response back to the client. </li> </ul> <p> So for instance a four commands sequence is something like this: </p> <ul> <li> <em> Client: </em> INCR X </li> <li> <em> Server: </em> 1 </li> <li> <em> Client: </em> INCR X </li> <li> <em> Server: </em> 2 </li> <li> <em> Client: </em> INCR X </li> <li> <em> Server: </em> 3 </li> <li> <em> Client: </em> INCR X </li> <li> <em> Server: </em> 4 </li> </ul> <p> Clients and Servers are connected via a network link. Such a link can be very fast (a loopback interface) or very slow (a connection established over the Internet with many hops between the two hosts). Whatever the network latency is, it takes time for the packets to travel from the client to the server, and back from the server to the client to carry the reply. </p> <p> This time is called RTT (Round Trip Time). It's easy to see how this can affect performance when a client needs to perform many requests in a row (for instance adding many elements to the same list, or populating a database with many keys). For instance if the RTT time is 250 milliseconds (in the case of a very slow link over the Internet), even if the server is able to process 100k requests per second, we'll be able to process at max four requests per second. </p> <p> If the interface used is a loopback interface, the RTT is much shorter, typically sub-millisecond, but even this will add up to a lot if you need to perform many writes in a row. </p> <p> Fortunately there is a way to improve this use case. </p> <h2 id="redis-pipelining"> Redis Pipelining </h2> <p> A Request/Response server can be implemented so that it is able to process new requests even if the client hasn't already read the old responses. This way it is possible to send <em> multiple commands </em> to the server without waiting for the replies at all, and finally read the replies in a single step. </p> <p> This is called pipelining, and is a technique widely in use for many decades. For instance many POP3 protocol implementations already support this feature, dramatically speeding up the process of downloading new emails from the server. </p> <p> Redis has supported pipelining since its early days, so whatever version you are running, you can use pipelining with Redis. This is an example using the raw netcat utility: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ <span class="o">(</span><span class="nb">printf</span> <span class="s2">"PING\r\nPING\r\nPING\r\n"</span><span class="p">;</span> sleep 1<span class="o">)</span> <span class="p">|</span> nc localhost <span class="m">6379</span> </span></span><span class="line"><span class="cl">+PONG </span></span><span class="line"><span class="cl">+PONG </span></span><span class="line"><span class="cl">+PONG </span></span></code></pre> </div> <p> This time we don't pay the cost of RTT for every call, but just once for the three commands. </p> <p> To be explicit, with pipelining the order of operations of our very first example will be the following: </p> <ul> <li> <em> Client: </em> INCR X </li> <li> <em> Client: </em> INCR X </li> <li> <em> Client: </em> INCR X </li> <li> <em> Client: </em> INCR X </li> <li> <em> Server: </em> 1 </li> <li> <em> Server: </em> 2 </li> <li> <em> Server: </em> 3 </li> <li> <em> Server: </em> 4 </li> </ul> <blockquote> <p> <strong> IMPORTANT NOTE </strong> : While the client sends commands using pipelining, the server will be forced to queue the replies, using memory. So if you need to send a lot of commands with pipelining, it is better to send them as batches each containing a reasonable number, for instance 10k commands, read the replies, and then send another 10k commands again, and so forth. The speed will be nearly the same, but the additional memory used will be at most the amount needed to queue the replies for these 10k commands. </p> </blockquote> <h2 id="its-not-just-a-matter-of-rtt"> It's not just a matter of RTT </h2> <p> Pipelining is not just a way to reduce the latency cost associated with the round trip time, it actually greatly improves the number of operations you can perform per second in a given Redis server. This is because without using pipelining, serving each command is very cheap from the point of view of accessing the data structures and producing the reply, but it is very costly from the point of view of doing the socket I/O. This involves calling the <code> read() </code> and <code> write() </code> syscall, that means going from user land to kernel land. The context switch is a huge speed penalty. </p> <p> When pipelining is used, many commands are usually read with a single <code> read() </code> system call, and multiple replies are delivered with a single <code> write() </code> system call. Consequently, the number of total queries performed per second initially increases almost linearly with longer pipelines, and eventually reaches 10 times the baseline obtained without pipelining, as shown in this figure. </p> <p> <img alt="Pipeline size and IOPs" src="pipeline_iops.png"/> </p> <h2 id="a-real-world-code-example"> A real world code example </h2> <p> In the following benchmark we'll use the Redis Ruby client, supporting pipelining, to test the speed improvement due to pipelining: </p> <div class="highlight"> <pre class="chroma"><code class="language-ruby" data-lang="ruby"><span class="line"><span class="cl"><span class="nb">require</span> <span class="s1">'rubygems'</span> </span></span><span class="line"><span class="cl"><span class="nb">require</span> <span class="s1">'redis'</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">bench</span><span class="p">(</span><span class="n">descr</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">start</span> <span class="o">=</span> <span class="no">Time</span><span class="o">.</span><span class="n">now</span> </span></span><span class="line"><span class="cl"> <span class="k">yield</span> </span></span><span class="line"><span class="cl"> <span class="nb">puts</span> <span class="s2">"</span><span class="si">#{</span><span class="n">descr</span><span class="si">}</span><span class="s2"> </span><span class="si">#{</span><span class="no">Time</span><span class="o">.</span><span class="n">now</span> <span class="o">-</span> <span class="n">start</span><span class="si">}</span><span class="s2"> seconds"</span> </span></span><span class="line"><span class="cl"><span class="k">end</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">without_pipelining</span> </span></span><span class="line"><span class="cl"> <span class="n">r</span> <span class="o">=</span> <span class="no">Redis</span><span class="o">.</span><span class="n">new</span> </span></span><span class="line"><span class="cl"> <span class="mi">10_000</span><span class="o">.</span><span class="n">times</span> <span class="k">do</span> </span></span><span class="line"><span class="cl"> <span class="n">r</span><span class="o">.</span><span class="n">ping</span> </span></span><span class="line"><span class="cl"> <span class="k">end</span> </span></span><span class="line"><span class="cl"><span class="k">end</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">with_pipelining</span> </span></span><span class="line"><span class="cl"> <span class="n">r</span> <span class="o">=</span> <span class="no">Redis</span><span class="o">.</span><span class="n">new</span> </span></span><span class="line"><span class="cl"> <span class="n">r</span><span class="o">.</span><span class="n">pipelined</span> <span class="k">do</span> <span class="o">|</span><span class="n">rp</span><span class="o">|</span> </span></span><span class="line"><span class="cl"> <span class="mi">10_000</span><span class="o">.</span><span class="n">times</span> <span class="k">do</span> </span></span><span class="line"><span class="cl"> <span class="n">rp</span><span class="o">.</span><span class="n">ping</span> </span></span><span class="line"><span class="cl"> <span class="k">end</span> </span></span><span class="line"><span class="cl"> <span class="k">end</span> </span></span><span class="line"><span class="cl"><span class="k">end</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">bench</span><span class="p">(</span><span class="s1">'without pipelining'</span><span class="p">)</span> <span class="k">do</span> </span></span><span class="line"><span class="cl"> <span class="n">without_pipelining</span> </span></span><span class="line"><span class="cl"><span class="k">end</span> </span></span><span class="line"><span class="cl"><span class="n">bench</span><span class="p">(</span><span class="s1">'with pipelining'</span><span class="p">)</span> <span class="k">do</span> </span></span><span class="line"><span class="cl"> <span class="n">with_pipelining</span> </span></span><span class="line"><span class="cl"><span class="k">end</span> </span></span></code></pre> </div> <p> Running the above simple script yields the following figures on my Mac OS X system, running over the loopback interface, where pipelining will provide the smallest improvement as the RTT is already pretty low: </p> <pre tabindex="0"><code>without pipelining 1.185238 seconds with pipelining 0.250783 seconds </code></pre> <p> As you can see, using pipelining, we improved the transfer by a factor of five. </p> <h2 id="pipelining-vs-scripting"> Pipelining vs Scripting </h2> <p> Using <a href="/docs/latest/commands/eval/"> Redis scripting </a> , available since Redis 2.6, a number of use cases for pipelining can be addressed more efficiently using scripts that perform a lot of the work needed at the server side. A big advantage of scripting is that it is able to both read and write data with minimal latency, making operations like <em> read, compute, write </em> very fast (pipelining can't help in this scenario since the client needs the reply of the read command before it can call the write command). </p> <p> Sometimes the application may also want to send <a href="/docs/latest/commands/eval/"> <code> EVAL </code> </a> or <a href="/docs/latest/commands/evalsha/"> <code> EVALSHA </code> </a> commands in a pipeline. This is entirely possible and Redis explicitly supports it with the <a href="/docs/latest/commands/script-load/"> SCRIPT LOAD </a> command (it guarantees that <a href="/docs/latest/commands/evalsha/"> <code> EVALSHA </code> </a> can be called without the risk of failing). </p> <h2 id="appendix-why-are-busy-loops-slow-even-on-the-loopback-interface"> Appendix: Why are busy loops slow even on the loopback interface? </h2> <p> Even with all the background covered in this page, you may still wonder why a Redis benchmark like the following (in pseudo code), is slow even when executed in the loopback interface, when the server and the client are running in the same physical machine: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">FOR-ONE-SECOND: </span></span><span class="line"><span class="cl"> Redis.SET<span class="o">(</span><span class="s2">"foo"</span>,<span class="s2">"bar"</span><span class="o">)</span> </span></span><span class="line"><span class="cl">END </span></span></code></pre> </div> <p> After all, if both the Redis process and the benchmark are running in the same box, isn't it just copying messages in memory from one place to another without any actual latency or networking involved? </p> <p> The reason is that processes in a system are not always running, actually it is the kernel scheduler that lets the process run. So, for instance, when the benchmark is allowed to run, it reads the reply from the Redis server (related to the last command executed), and writes a new command. The command is now in the loopback interface buffer, but in order to be read by the server, the kernel should schedule the server process (currently blocked in a system call) to run, and so forth. So in practical terms the loopback interface still involves network-like latency, because of how the kernel scheduler works. </p> <p> Basically a busy loop benchmark is the silliest thing that can be done when metering performances on a networked server. The wise thing is just avoiding benchmarking in this way. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/use/pipelining/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/cluster/create/.html
<section class="prose w-full py-12 max-w-none"> <h1> rladmin cluster create </h1> <p class="text-lg -mt-5 mb-10"> Creates a new cluster. </p> <p> Creates a new cluster. The node where you run <code> rladmin cluster create </code> becomes the first node of the new cluster. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">cluster create </span></span><span class="line"><span class="cl"> name &lt;cluster name&gt; </span></span><span class="line"><span class="cl"> username &lt;admin email&gt; </span></span><span class="line"><span class="cl"> password &lt;admin password&gt; </span></span><span class="line"><span class="cl"> <span class="o">[</span> node_uid &lt;node UID&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> rack_aware <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> rack_id &lt;node rack ID&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> license_file &lt;file&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> ephemeral_path &lt;path&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> persistent_path &lt;path&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> ccs_persistent_path &lt;path&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> register_dns_suffix <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> flash_enabled <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> flash_path &lt;path&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> addr &lt;IP.address&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> external_addr &lt;IP.address.1&gt; <span class="o">[</span>&lt;IP.address.2&gt; ... &lt;IP.address.N&gt;<span class="o">]</span> <span class="o">]</span> </span></span></code></pre> </div> <h3 id="parameters"> Parameters </h3> <table> <thead> <tr> <th> Parameter </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> addr </td> <td> IP address </td> <td> The node's internal IP address (optional) </td> </tr> <tr> <td> ccs_persistent_path </td> <td> filepath (default:Β /var/opt/redislabs/persist) </td> <td> Path to the location of CCS snapshots (optional) </td> </tr> <tr> <td> ephemeral_path </td> <td> filepath (default:Β /var/opt/redislabs) </td> <td> Path to the ephemeral storage location (optional) </td> </tr> <tr> <td> external_addr </td> <td> list of IP addresses </td> <td> A space-delimited list of the node's external IP addresses (optional) </td> </tr> <tr> <td> flash_enabled </td> <td> </td> <td> Enables flash storage (optional) </td> </tr> <tr> <td> flash_path </td> <td> filepath (default:Β /var/opt/redislabs/flash) </td> <td> Path to the flash storage location (optional) </td> </tr> <tr> <td> license_file </td> <td> filepath </td> <td> Path to the RLEC license file (optional) </td> </tr> <tr> <td> name </td> <td> string </td> <td> Cluster name </td> </tr> <tr> <td> node_uid </td> <td> integer </td> <td> Unique node ID (optional) </td> </tr> <tr> <td> password </td> <td> string </td> <td> Admin user's password </td> </tr> <tr> <td> persistent_path </td> <td> filepath (default:Β /var/opt/redislabs/persist) </td> <td> Path to the persistent storage location (optional) </td> </tr> <tr> <td> rack_aware </td> <td> </td> <td> Activates or deactivates rack awareness (optional) </td> </tr> <tr> <td> rack_id </td> <td> string </td> <td> The rack's unique identifier (optional) </td> </tr> <tr> <td> register_dns_suffix </td> <td> </td> <td> Enables database mapping to both internal and external IP addresses (optional) </td> </tr> <tr> <td> username </td> <td> email address </td> <td> Admin user's email address </td> </tr> </tbody> </table> <h3 id="returns"> Returns </h3> <p> Returns <code> ok </code> if the new cluster was created successfully. Otherwise, it returns an error message. </p> <h3 id="example"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin cluster create name cluster.local <span class="se">\ </span></span></span><span class="line"><span class="cl"><span class="se"></span> username [email protected] <span class="se">\ </span></span></span><span class="line"><span class="cl"><span class="se"></span> password admin-password </span></span><span class="line"><span class="cl">Creating a new cluster... ok </span></span></code></pre> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/cluster/create/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/info/.html
<section class="prose w-full py-12"> <h1 class="command-name"> INFO </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">INFO [section [section ...]]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 1.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> <code> @dangerous </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> The <code> INFO </code> command returns information and statistics about the server in a format that is simple to parse by computers and easy to read by humans. </p> <p> The optional parameter can be used to select a specific section of information: </p> <ul> <li> <code> server </code> : General information about the Redis server </li> <li> <code> clients </code> : Client connections section </li> <li> <code> memory </code> : Memory consumption related information </li> <li> <code> persistence </code> : RDB and AOF related information </li> <li> <code> stats </code> : General statistics </li> <li> <code> replication </code> : Master/replica replication information </li> <li> <code> cpu </code> : CPU consumption statistics </li> <li> <code> commandstats </code> : Redis command statistics </li> <li> <code> latencystats </code> : Redis command latency percentile distribution statistics </li> <li> <code> sentinel </code> : Redis Sentinel section (only applicable to Sentinel instances) </li> <li> <code> cluster </code> : Redis Cluster section </li> <li> <code> modules </code> : Modules section </li> <li> <code> keyspace </code> : Database related statistics </li> <li> <code> errorstats </code> : Redis error statistics </li> </ul> <p> It can also take the following values: </p> <ul> <li> <code> all </code> : Return all sections (excluding module generated ones) </li> <li> <code> default </code> : Return only the default set of sections </li> <li> <code> everything </code> : Includes <code> all </code> and <code> modules </code> </li> </ul> <p> When no parameter is provided, the <code> default </code> option is assumed. </p> <div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex"> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z"> </path> </svg> </div> <form class="redis-cli overflow-y-auto max-h-80"> <pre tabindex="0">redis&gt; INFO "# Server redis_version:7.4.0 redis_git_sha1:00000000 redis_git_dirty:0 redis_build_id:3aa7641ec961eee0 redis_mode:standalone os:Linux 6.1.100+ x86_64 arch_bits:64 monotonic_clock:POSIX clock_gettime multiplexing_api:epoll atomicvar_api:c11-builtin gcc_version:10.2.1 process_id:1 process_supervised:no run_id:0fa8ad4efa00c5058c4c1802f41e972628a98870 tcp_port:6379 server_time_usec:1731586419805007 uptime_in_seconds:11682 uptime_in_days:0 hz:10 configured_hz:10 lru_clock:3533171 executable:/data/redis-server config_file:/etc/redis/redis.conf io_threads_active:0 listener0:name=tcp,bind=*,bind=-::*,port=6379 # Clients connected_clients:2 cluster_connections:0 maxclients:10000 client_recent_max_input_buffer:20480 client_recent_max_output_buffer:0 blocked_clients:0 tracking_clients:0 pubsub_clients:0 watching_clients:0 clients_in_timeout_table:0 total_watched_keys:0 total_blocking_keys:0 total_blocking_keys_on_nokey:0 # Memory used_memory:5378808 used_memory_human:5.13M used_memory_rss:9834496 used_memory_rss_human:9.38M used_memory_peak:5467176 used_memory_peak_human:5.21M used_memory_peak_perc:98.38% used_memory_overhead:1124640 used_memory_startup:947680 used_memory_dataset:4254168 used_memory_dataset_perc:96.01% allocator_allocated:5981712 allocator_active:6287360 allocator_resident:10076160 allocator_muzzy:0 total_system_memory:33663987712 total_system_memory_human:31.35G used_memory_lua:31744 used_memory_vm_eval:31744 used_memory_lua_human:31.00K used_memory_scripts_eval:0 number_of_cached_scripts:0 number_of_functions:0 number_of_libraries:0 used_memory_vm_functions:32768 used_memory_vm_total:64512 used_memory_vm_total_human:63.00K used_memory_functions:192 used_memory_scripts:192 used_memory_scripts_human:192B maxmemory:4294967296 maxmemory_human:4.00G maxmemory_policy:allkeys-lru allocator_frag_ratio:1.04 allocator_frag_bytes:229616 allocator_rss_ratio:1.60 allocator_rss_bytes:3788800 rss_overhead_ratio:0.98 rss_overhead_bytes:-241664 mem_fragmentation_ratio:1.83 mem_fragmentation_bytes:4457512 mem_not_counted_for_evict:0 mem_replication_backlog:0 mem_total_replication_buffers:0 mem_clients_slaves:0 mem_clients_normal:24328 mem_cluster_links:0 mem_aof_buffer:0 mem_allocator:jemalloc-5.3.0 mem_overhead_db_hashtable_rehashing:0 active_defrag_running:0 lazyfree_pending_objects:0 lazyfreed_objects:0 # Persistence loading:0 async_loading:0 current_cow_peak:0 current_cow_size:0 current_cow_size_age:0 current_fork_perc:0.00 current_save_keys_processed:0 current_save_keys_total:0 rdb_changes_since_last_save:8503 rdb_bgsave_in_progress:0 rdb_last_save_time:1731574737 rdb_last_bgsave_status:ok rdb_last_bgsave_time_sec:-1 rdb_current_bgsave_time_sec:-1 rdb_saves:0 rdb_last_cow_size:0 rdb_last_load_keys_expired:0 rdb_last_load_keys_loaded:0 aof_enabled:0 aof_rewrite_in_progress:0 aof_rewrite_scheduled:0 aof_last_rewrite_time_sec:-1 aof_current_rewrite_time_sec:-1 aof_last_bgrewrite_status:ok aof_rewrites:0 aof_rewrites_consecutive_failures:0 aof_last_write_status:ok aof_last_cow_size:0 module_fork_in_progress:0 module_fork_last_cow_size:0 # Stats total_connections_received:4675 total_commands_processed:22445 instantaneous_ops_per_sec:11 total_net_input_bytes:1337317 total_net_output_bytes:822874 total_net_repl_input_bytes:0 total_net_repl_output_bytes:0 instantaneous_input_kbps:0.72 instantaneous_output_kbps:0.07 instantaneous_input_repl_kbps:0.00 instantaneous_output_repl_kbps:0.00 rejected_connections:0 sync_full:0 sync_partial_ok:0 sync_partial_err:0 expired_subkeys:0 expired_keys:531 expired_stale_perc:0.00 expired_time_cap_reached_count:0 expire_cycle_cpu_milliseconds:511 evicted_keys:0 evicted_clients:0 evicted_scripts:0 total_eviction_exceeded_time:0 current_eviction_exceeded_time:0 keyspace_hits:5038 keyspace_misses:339 pubsub_channels:0 pubsub_patterns:0 pubsubshard_channels:0 latest_fork_usec:0 total_forks:0 migrate_cached_sockets:0 slave_expires_tracked_keys:0 active_defrag_hits:0 active_defrag_misses:0 active_defrag_key_hits:0 active_defrag_key_misses:0 total_active_defrag_time:0 current_active_defrag_time:0 tracking_total_keys:0 tracking_total_items:0 tracking_total_prefixes:0 unexpected_error_replies:0 total_error_replies:22 dump_payload_sanitizations:0 total_reads_processed:27123 total_writes_processed:22451 io_threaded_reads_processed:0 io_threaded_writes_processed:0 client_query_buffer_limit_disconnections:0 client_output_buffer_limit_disconnections:0 reply_buffer_shrinks:67 reply_buffer_expands:65 eventloop_cycles:146026 eventloop_duration_sum:31492717 eventloop_duration_cmd_sum:155735 instantaneous_eventloop_cycles_per_sec:21 instantaneous_eventloop_duration_usec:209 acl_access_denied_auth:0 acl_access_denied_cmd:4 acl_access_denied_key:0 acl_access_denied_channel:0 # Replication role:master connected_slaves:0 master_failover_state:no-failover master_replid:e8330ad95101f21d7941017736dc4ad276a8d093 master_replid2:0000000000000000000000000000000000000000 master_repl_offset:0 second_repl_offset:-1 repl_backlog_active:0 repl_backlog_size:1048576 repl_backlog_first_byte_offset:0 repl_backlog_histlen:0 # CPU used_cpu_sys:8.816386 used_cpu_user:25.958220 used_cpu_sys_children:0.005186 used_cpu_user_children:0.000857 used_cpu_sys_main_thread:8.805956 used_cpu_user_main_thread:25.950430 # Modules # Errorstats errorstat_ERR:count=17 errorstat_NOPERM:count=4 errorstat_WRONGTYPE:count=1 # Cluster cluster_enabled:0 # Keyspace db0:keys=2968,expires=11,avg_ttl=28294470386357,subexpiry=0 " </pre> <div class="prompt" style=""> <span> redis&gt; </span> <input autocomplete="off" name="prompt" spellcheck="false" type="text"/> </div> </form> <h2 id="notes"> Notes </h2> <p> Please note depending on the version of Redis some of the fields have been added or removed. A robust client application should therefore parse the result of this command by skipping unknown properties, and gracefully handle missing fields. </p> <p> Here is the description of fields for Redis &gt;= 2.4. </p> <p> Here is the meaning of all fields in the <strong> server </strong> section: </p> <ul> <li> <code> redis_version </code> : Version of the Redis server </li> <li> <code> redis_git_sha1 </code> : Git SHA1 </li> <li> <code> redis_git_dirty </code> : Git dirty flag </li> <li> <code> redis_build_id </code> : The build id </li> <li> <code> redis_mode </code> : The server's mode ("standalone", "sentinel" or "cluster") </li> <li> <code> os </code> : Operating system hosting the Redis server </li> <li> <code> arch_bits </code> : Architecture (32 or 64 bits) </li> <li> <code> multiplexing_api </code> : Event loop mechanism used by Redis </li> <li> <code> atomicvar_api </code> : Atomicvar API used by Redis </li> <li> <code> gcc_version </code> : Version of the GCC compiler used to compile the Redis server </li> <li> <code> process_id </code> : PID of the server process </li> <li> <code> process_supervised </code> : Supervised system ("upstart", "systemd", "unknown" or "no") </li> <li> <code> run_id </code> : Random value identifying the Redis server (to be used by Sentinel and Cluster) </li> <li> <code> tcp_port </code> : TCP/IP listen port </li> <li> <code> server_time_usec </code> : Epoch-based system time with microsecond precision </li> <li> <code> uptime_in_seconds </code> : Number of seconds since Redis server start </li> <li> <code> uptime_in_days </code> : Same value expressed in days </li> <li> <code> hz </code> : The server's current frequency setting </li> <li> <code> configured_hz </code> : The server's configured frequency setting </li> <li> <code> lru_clock </code> : Clock incrementing every minute, for LRU management </li> <li> <code> executable </code> : The path to the server's executable </li> <li> <code> config_file </code> : The path to the config file </li> <li> <code> io_threads_active </code> : Flag indicating if I/O threads are active </li> <li> <code> shutdown_in_milliseconds </code> : The maximum time remaining for replicas to catch up the replication before completing the shutdown sequence. This field is only present during shutdown. </li> </ul> <p> Here is the meaning of all fields in the <strong> clients </strong> section: </p> <ul> <li> <code> connected_clients </code> : Number of client connections (excluding connections from replicas) </li> <li> <code> cluster_connections </code> : An approximation of the number of sockets used by the cluster's bus </li> <li> <code> maxclients </code> : The value of the <code> maxclients </code> configuration directive. This is the upper limit for the sum of <code> connected_clients </code> , <code> connected_slaves </code> and <code> cluster_connections </code> . </li> <li> <code> client_recent_max_input_buffer </code> : Biggest input buffer among current client connections </li> <li> <code> client_recent_max_output_buffer </code> : Biggest output buffer among current client connections </li> <li> <code> blocked_clients </code> : Number of clients pending on a blocking call ( <a href="/docs/latest/commands/blpop/"> <code> BLPOP </code> </a> , <a href="/docs/latest/commands/brpop/"> <code> BRPOP </code> </a> , <a href="/docs/latest/commands/brpoplpush/"> <code> BRPOPLPUSH </code> </a> , <a href="/docs/latest/commands/blmove/"> <code> BLMOVE </code> </a> , <a href="/docs/latest/commands/bzpopmin/"> <code> BZPOPMIN </code> </a> , <a href="/docs/latest/commands/bzpopmax/"> <code> BZPOPMAX </code> </a> ) </li> <li> <code> tracking_clients </code> : Number of clients being tracked ( <a href="/docs/latest/commands/client-tracking/"> <code> CLIENT TRACKING </code> </a> ) </li> <li> <code> pubsub_clients </code> : Number of clients in pubsub mode ( <a href="/docs/latest/commands/subscribe/"> <code> SUBSCRIBE </code> </a> , <a href="/docs/latest/commands/psubscribe/"> <code> PSUBSCRIBE </code> </a> , <a href="/docs/latest/commands/ssubscribe/"> <code> SSUBSCRIBE </code> </a> ). Added in Redis 7.4 </li> <li> <code> watching_clients </code> : Number of clients in watching mode ( <a href="/docs/latest/commands/watch/"> <code> WATCH </code> </a> ). Added in Redis 7.4 </li> <li> <code> clients_in_timeout_table </code> : Number of clients in the clients timeout table </li> <li> <code> total_watched_keys </code> : Number of watched keys. Added in Redis 7.4. </li> <li> <code> total_blocking_keys </code> : Number of blocking keys. Added in Redis 7.2. </li> <li> <code> total_blocking_keys_on_nokey </code> : Number of blocking keys that one or more clients that would like to be unblocked when the key is deleted. Added in Redis 7.2. </li> </ul> <p> Here is the meaning of all fields in the <strong> memory </strong> section: </p> <ul> <li> <code> used_memory </code> : Total number of bytes allocated by Redis using its allocator (either standard <strong> libc </strong> , <strong> jemalloc </strong> , or an alternative allocator such as <a href="http://code.google.com/p/google-perftools/"> <strong> tcmalloc </strong> </a> ) </li> <li> <code> used_memory_human </code> : Human readable representation of previous value </li> <li> <code> used_memory_rss </code> : Number of bytes that Redis allocated as seen by the operating system (a.k.a resident set size). This is the number reported by tools such as <code> top(1) </code> and <code> ps(1) </code> </li> <li> <code> used_memory_rss_human </code> : Human readable representation of previous value </li> <li> <code> used_memory_peak </code> : Peak memory consumed by Redis (in bytes) </li> <li> <code> used_memory_peak_human </code> : Human readable representation of previous value </li> <li> <code> used_memory_peak_perc </code> : The percentage of <code> used_memory_peak </code> out of <code> used_memory </code> </li> <li> <code> used_memory_overhead </code> : The sum in bytes of all overheads that the server allocated for managing its internal data structures </li> <li> <code> used_memory_startup </code> : Initial amount of memory consumed by Redis at startup in bytes </li> <li> <code> used_memory_dataset </code> : The size in bytes of the dataset ( <code> used_memory_overhead </code> subtracted from <code> used_memory </code> ) </li> <li> <code> used_memory_dataset_perc </code> : The percentage of <code> used_memory_dataset </code> out of the net memory usage ( <code> used_memory </code> minus <code> used_memory_startup </code> ) </li> <li> <code> total_system_memory </code> : The total amount of memory that the Redis host has </li> <li> <code> total_system_memory_human </code> : Human readable representation of previous value </li> <li> <code> used_memory_lua </code> : Number of bytes used by the Lua engine for EVAL scripts. Deprecated in Redis 7.0, renamed to <code> used_memory_vm_eval </code> </li> <li> <code> used_memory_vm_eval </code> : Number of bytes used by the script VM engines for EVAL framework (not part of used_memory). Added in Redis 7.0 </li> <li> <code> used_memory_lua_human </code> : Human readable representation of previous value. Deprecated in Redis 7.0 </li> <li> <code> used_memory_scripts_eval </code> : Number of bytes overhead by the EVAL scripts (part of used_memory). Added in Redis 7.0 </li> <li> <code> number_of_cached_scripts </code> : The number of EVAL scripts cached by the server. Added in Redis 7.0 </li> <li> <code> number_of_functions </code> : The number of functions. Added in Redis 7.0 </li> <li> <code> number_of_libraries </code> : The number of libraries. Added in Redis 7.0 </li> <li> <code> used_memory_vm_functions </code> : Number of bytes used by the script VM engines for Functions framework (not part of used_memory). Added in Redis 7.0 </li> <li> <code> used_memory_vm_total </code> : <code> used_memory_vm_eval </code> + <code> used_memory_vm_functions </code> (not part of used_memory). Added in Redis 7.0 </li> <li> <code> used_memory_vm_total_human </code> : Human readable representation of previous value. </li> <li> <code> used_memory_functions </code> : Number of bytes overhead by Function scripts (part of used_memory). Added in Redis 7.0 </li> <li> <code> used_memory_scripts </code> : <code> used_memory_scripts_eval </code> + <code> used_memory_functions </code> (part of used_memory). Added in Redis 7.0 </li> <li> <code> used_memory_scripts_human </code> : Human readable representation of previous value </li> <li> <code> maxmemory </code> : The value of the <code> maxmemory </code> configuration directive </li> <li> <code> maxmemory_human </code> : Human readable representation of previous value </li> <li> <code> maxmemory_policy </code> : The value of the <code> maxmemory-policy </code> configuration directive </li> <li> <code> mem_fragmentation_ratio </code> : Ratio between <code> used_memory_rss </code> and <code> used_memory </code> . Note that this doesn't only includes fragmentation, but also other process overheads (see the <code> allocator_* </code> metrics), and also overheads like code, shared libraries, stack, etc. </li> <li> <code> mem_fragmentation_bytes </code> : Delta between <code> used_memory_rss </code> and <code> used_memory </code> . Note that when the total fragmentation bytes is low (few megabytes), a high ratio (e.g. 1.5 and above) is not an indication of an issue. </li> <li> <code> allocator_frag_ratio: </code> : Ratio between <code> allocator_active </code> and <code> allocator_allocated </code> . This is the true (external) fragmentation metric (not <code> mem_fragmentation_ratio </code> ). </li> <li> <code> allocator_frag_bytes </code> Delta between <code> allocator_active </code> and <code> allocator_allocated </code> . See note about <code> mem_fragmentation_bytes </code> . </li> <li> <code> allocator_rss_ratio </code> : Ratio between <code> allocator_resident </code> and <code> allocator_active </code> . This usually indicates pages that the allocator can and probably will soon release back to the OS. </li> <li> <code> allocator_rss_bytes </code> : Delta between <code> allocator_resident </code> and <code> allocator_active </code> </li> <li> <code> rss_overhead_ratio </code> : Ratio between <code> used_memory_rss </code> (the process RSS) and <code> allocator_resident </code> . This includes RSS overheads that are not allocator or heap related. </li> <li> <code> rss_overhead_bytes </code> : Delta between <code> used_memory_rss </code> (the process RSS) and <code> allocator_resident </code> </li> <li> <code> allocator_allocated </code> : Total bytes allocated form the allocator, including internal-fragmentation. Normally the same as <code> used_memory </code> . </li> <li> <code> allocator_active </code> : Total bytes in the allocator active pages, this includes external-fragmentation. </li> <li> <code> allocator_resident </code> : Total bytes resident (RSS) in the allocator, this includes pages that can be released to the OS (by <a href="/docs/latest/commands/memory-purge/"> <code> MEMORY PURGE </code> </a> , or just waiting). </li> <li> <code> allocator_muzzy </code> : Total bytes of 'muzzy' memory (RSS) in the allocator. Muzzy memory is memory that has been freed, but not yet fully returned to the operating system. It can be reused immediately when needed or reclaimed by the OS when system pressure increases. </li> <li> <code> mem_not_counted_for_evict </code> : Used memory that's not counted for key eviction. This is basically transient replica and AOF buffers. </li> <li> <code> mem_clients_slaves </code> : Memory used by replica clients - Starting Redis 7.0, replica buffers share memory with the replication backlog, so this field can show 0 when replicas don't trigger an increase of memory usage. </li> <li> <code> mem_clients_normal </code> : Memory used by normal clients </li> <li> <code> mem_cluster_links </code> : Memory used by links to peers on the cluster bus when cluster mode is enabled. </li> <li> <code> mem_aof_buffer </code> : Transient memory used for AOF and AOF rewrite buffers </li> <li> <code> mem_replication_backlog </code> : Memory used by replication backlog </li> <li> <code> mem_total_replication_buffers </code> : Total memory consumed for replication buffers - Added in Redis 7.0. </li> <li> <code> mem_allocator </code> : Memory allocator, chosen at compile time. </li> <li> <code> mem_overhead_db_hashtable_rehashing </code> : Temporary memory overhead of database dictionaries currently being rehashed - Added in 7.4. </li> <li> <code> active_defrag_running </code> : When <code> activedefrag </code> is enabled, this indicates whether defragmentation is currently active, and the CPU percentage it intends to utilize. </li> <li> <code> lazyfree_pending_objects </code> : The number of objects waiting to be freed (as a result of calling <a href="/docs/latest/commands/unlink/"> <code> UNLINK </code> </a> , or <a href="/docs/latest/commands/flushdb/"> <code> FLUSHDB </code> </a> and <a href="/docs/latest/commands/flushall/"> <code> FLUSHALL </code> </a> with the <strong> ASYNC </strong> option) </li> <li> <code> lazyfreed_objects </code> : The number of objects that have been lazy freed. </li> </ul> <p> Ideally, the <code> used_memory_rss </code> value should be only slightly higher than <code> used_memory </code> . When rss &gt;&gt; used, a large difference may mean there is (external) memory fragmentation, which can be evaluated by checking <code> allocator_frag_ratio </code> , <code> allocator_frag_bytes </code> . When used &gt;&gt; rss, it means part of Redis memory has been swapped off by the operating system: expect some significant latencies. </p> <p> Because Redis does not have control over how its allocations are mapped to memory pages, high <code> used_memory_rss </code> is often the result of a spike in memory usage. </p> <p> When Redis frees memory, the memory is given back to the allocator, and the allocator may or may not give the memory back to the system. There may be a discrepancy between the <code> used_memory </code> value and memory consumption as reported by the operating system. It may be due to the fact memory has been used and released by Redis, but not given back to the system. The <code> used_memory_peak </code> value is generally useful to check this point. </p> <p> Additional introspective information about the server's memory can be obtained by referring to the <a href="/docs/latest/commands/memory-stats/"> <code> MEMORY STATS </code> </a> command and the <a href="/docs/latest/commands/memory-doctor/"> <code> MEMORY DOCTOR </code> </a> . </p> <p> Here is the meaning of all fields in the <strong> persistence </strong> section: </p> <ul> <li> <code> loading </code> : Flag indicating if the load of a dump file is on-going </li> <li> <code> async_loading </code> : Currently loading replication data-set asynchronously while serving old data. This means <code> repl-diskless-load </code> is enabled and set to <code> swapdb </code> . Added in Redis 7.0. </li> <li> <code> current_cow_peak </code> : The peak size in bytes of copy-on-write memory while a child fork is running </li> <li> <code> current_cow_size </code> : The size in bytes of copy-on-write memory while a child fork is running </li> <li> <code> current_cow_size_age </code> : The age, in seconds, of the <code> current_cow_size </code> value. </li> <li> <code> current_fork_perc </code> : The percentage of progress of the current fork process. For AOF and RDB forks it is the percentage of <code> current_save_keys_processed </code> out of <code> current_save_keys_total </code> . </li> <li> <code> current_save_keys_processed </code> : Number of keys processed by the current save operation </li> <li> <code> current_save_keys_total </code> : Number of keys at the beginning of the current save operation </li> <li> <code> rdb_changes_since_last_save </code> : Number of changes since the last dump </li> <li> <code> rdb_bgsave_in_progress </code> : Flag indicating a RDB save is on-going </li> <li> <code> rdb_last_save_time </code> : Epoch-based timestamp of last successful RDB save </li> <li> <code> rdb_last_bgsave_status </code> : Status of the last RDB save operation </li> <li> <code> rdb_last_bgsave_time_sec </code> : Duration of the last RDB save operation in seconds </li> <li> <code> rdb_current_bgsave_time_sec </code> : Duration of the on-going RDB save operation if any </li> <li> <code> rdb_last_cow_size </code> : The size in bytes of copy-on-write memory during the last RDB save operation </li> <li> <code> rdb_last_load_keys_expired </code> : Number of volatile keys deleted during the last RDB loading. Added in Redis 7.0. </li> <li> <code> rdb_last_load_keys_loaded </code> : Number of keys loaded during the last RDB loading. Added in Redis 7.0. </li> <li> <code> aof_enabled </code> : Flag indicating AOF logging is activated </li> <li> <code> aof_rewrite_in_progress </code> : Flag indicating a AOF rewrite operation is on-going </li> <li> <code> aof_rewrite_scheduled </code> : Flag indicating an AOF rewrite operation will be scheduled once the on-going RDB save is complete. </li> <li> <code> aof_last_rewrite_time_sec </code> : Duration of the last AOF rewrite operation in seconds </li> <li> <code> aof_current_rewrite_time_sec </code> : Duration of the on-going AOF rewrite operation if any </li> <li> <code> aof_last_bgrewrite_status </code> : Status of the last AOF rewrite operation </li> <li> <code> aof_last_write_status </code> : Status of the last write operation to the AOF </li> <li> <code> aof_last_cow_size </code> : The size in bytes of copy-on-write memory during the last AOF rewrite operation </li> <li> <code> module_fork_in_progress </code> : Flag indicating a module fork is on-going </li> <li> <code> module_fork_last_cow_size </code> : The size in bytes of copy-on-write memory during the last module fork operation </li> <li> <code> aof_rewrites </code> : Number of AOF rewrites performed since startup </li> <li> <code> rdb_saves </code> : Number of RDB snapshots performed since startup </li> </ul> <p> <code> rdb_changes_since_last_save </code> refers to the number of operations that produced some kind of changes in the dataset since the last time either <a href="/docs/latest/commands/save/"> <code> SAVE </code> </a> or <a href="/docs/latest/commands/bgsave/"> <code> BGSAVE </code> </a> was called. </p> <p> If AOF is activated, these additional fields will be added: </p> <ul> <li> <code> aof_current_size </code> : AOF current file size </li> <li> <code> aof_base_size </code> : AOF file size on latest startup or rewrite </li> <li> <code> aof_pending_rewrite </code> : Flag indicating an AOF rewrite operation will be scheduled once the on-going RDB save is complete. </li> <li> <code> aof_buffer_length </code> : Size of the AOF buffer </li> <li> <code> aof_rewrite_buffer_length </code> : Size of the AOF rewrite buffer. Note this field was removed in Redis 7.0 </li> <li> <code> aof_pending_bio_fsync </code> : Number of fsync pending jobs in background I/O queue </li> <li> <code> aof_delayed_fsync </code> : Delayed fsync counter </li> </ul> <p> If a load operation is on-going, these additional fields will be added: </p> <ul> <li> <code> loading_start_time </code> : Epoch-based timestamp of the start of the load operation </li> <li> <code> loading_total_bytes </code> : Total file size </li> <li> <code> loading_rdb_used_mem </code> : The memory usage of the server that had generated the RDB file at the time of the file's creation </li> <li> <code> loading_loaded_bytes </code> : Number of bytes already loaded </li> <li> <code> loading_loaded_perc </code> : Same value expressed as a percentage </li> <li> <code> loading_eta_seconds </code> : ETA in seconds for the load to be complete </li> </ul> <p> Here is the meaning of all fields in the <strong> stats </strong> section: </p> <ul> <li> <code> total_connections_received </code> : Total number of connections accepted by the server </li> <li> <code> total_commands_processed </code> : Total number of commands processed by the server </li> <li> <code> instantaneous_ops_per_sec </code> : Number of commands processed per second </li> <li> <code> total_net_input_bytes </code> : The total number of bytes read from the network </li> <li> <code> total_net_output_bytes </code> : The total number of bytes written to the network </li> <li> <code> total_net_repl_input_bytes </code> : The total number of bytes read from the network for replication purposes </li> <li> <code> total_net_repl_output_bytes </code> : The total number of bytes written to the network for replication purposes </li> <li> <code> instantaneous_input_kbps </code> : The network's read rate per second in KB/sec </li> <li> <code> instantaneous_output_kbps </code> : The network's write rate per second in KB/sec </li> <li> <code> instantaneous_input_repl_kbps </code> : The network's read rate per second in KB/sec for replication purposes </li> <li> <code> instantaneous_output_repl_kbps </code> : The network's write rate per second in KB/sec for replication purposes </li> <li> <code> rejected_connections </code> : Number of connections rejected because of <code> maxclients </code> limit </li> <li> <code> sync_full </code> : The number of full resyncs with replicas </li> <li> <code> sync_partial_ok </code> : The number of accepted partial resync requests </li> <li> <code> sync_partial_err </code> : The number of denied partial resync requests </li> <li> <code> expired_subkeys </code> : The number of hash field expiration events </li> <li> <code> expired_keys </code> : Total number of key expiration events </li> <li> <code> expired_stale_perc </code> : The percentage of keys probably expired </li> <li> <code> expired_time_cap_reached_count </code> : The count of times that active expiry cycles have stopped early </li> <li> <code> expire_cycle_cpu_milliseconds </code> : The cumulative amount of time spent on active expiry cycles </li> <li> <code> evicted_keys </code> : Number of evicted keys due to <code> maxmemory </code> limit </li> <li> <code> evicted_clients </code> : Number of evicted clients due to <code> maxmemory-clients </code> limit. Added in Redis 7.0. </li> <li> <code> evicted_scripts </code> : Number of evicted EVAL scripts due to LRU policy, see <a href="/docs/latest/commands/eval/"> <code> EVAL </code> </a> for more details. Added in Redis 7.4. </li> <li> <code> total_eviction_exceeded_time </code> : Total time <code> used_memory </code> was greater than <code> maxmemory </code> since server startup, in milliseconds </li> <li> <code> current_eviction_exceeded_time </code> : The time passed since <code> used_memory </code> last rose above <code> maxmemory </code> , in milliseconds </li> <li> <code> keyspace_hits </code> : Number of successful lookup of keys in the main dictionary </li> <li> <code> keyspace_misses </code> : Number of failed lookup of keys in the main dictionary </li> <li> <code> pubsub_channels </code> : Global number of pub/sub channels with client subscriptions </li> <li> <code> pubsub_patterns </code> : Global number of pub/sub pattern with client subscriptions </li> <li> <code> pubsubshard_channels </code> : Global number of pub/sub shard channels with client subscriptions. Added in Redis 7.0.3 </li> <li> <code> latest_fork_usec </code> : Duration of the latest fork operation in microseconds </li> <li> <code> total_forks </code> : Total number of fork operations since the server start </li> <li> <code> migrate_cached_sockets </code> : The number of sockets open for <a href="/docs/latest/commands/migrate/"> <code> MIGRATE </code> </a> purposes </li> <li> <code> slave_expires_tracked_keys </code> : The number of keys tracked for expiry purposes (applicable only to writable replicas) </li> <li> <code> active_defrag_hits </code> : Number of value reallocations performed by active the defragmentation process </li> <li> <code> active_defrag_misses </code> : Number of aborted value reallocations started by the active defragmentation process </li> <li> <code> active_defrag_key_hits </code> : Number of keys that were actively defragmented </li> <li> <code> active_defrag_key_misses </code> : Number of keys that were skipped by the active defragmentation process </li> <li> <code> total_active_defrag_time </code> : Total time memory fragmentation was over the limit, in milliseconds </li> <li> <code> current_active_defrag_time </code> : The time passed since memory fragmentation last was over the limit, in milliseconds </li> <li> <code> tracking_total_keys </code> : Number of keys being tracked by the server </li> <li> <code> tracking_total_items </code> : Number of items, that is the sum of clients number for each key, that are being tracked </li> <li> <code> tracking_total_prefixes </code> : Number of tracked prefixes in server's prefix table (only applicable for broadcast mode) </li> <li> <code> unexpected_error_replies </code> : Number of unexpected error replies, that are types of errors from an AOF load or replication </li> <li> <code> total_error_replies </code> : Total number of issued error replies, that is the sum of rejected commands (errors prior command execution) and failed commands (errors within the command execution) </li> <li> <code> dump_payload_sanitizations </code> : Total number of dump payload deep integrity validations (see <code> sanitize-dump-payload </code> config). </li> <li> <code> total_reads_processed </code> : Total number of read events processed </li> <li> <code> total_writes_processed </code> : Total number of write events processed </li> <li> <code> io_threaded_reads_processed </code> : Number of read events processed by the main and I/O threads </li> <li> <code> io_threaded_writes_processed </code> : Number of write events processed by the main and I/O threads </li> <li> <code> client_query_buffer_limit_disconnections </code> : Total number of disconnections due to client reaching query buffer limit </li> <li> <code> client_output_buffer_limit_disconnections </code> : Total number of disconnections due to client reaching output buffer limit </li> <li> <code> reply_buffer_shrinks </code> : Total number of output buffer shrinks </li> <li> <code> reply_buffer_expands </code> : Total number of output buffer expands </li> <li> <code> eventloop_cycles </code> : Total number of eventloop cycles </li> <li> <code> eventloop_duration_sum </code> : Total time spent in the eventloop in microseconds (including I/O and command processing) </li> <li> <code> eventloop_duration_cmd_sum </code> : Total time spent on executing commands in microseconds </li> <li> <code> instantaneous_eventloop_cycles_per_sec </code> : Number of eventloop cycles per second </li> <li> <code> instantaneous_eventloop_duration_usec </code> : Average time spent in a single eventloop cycle in microseconds </li> <li> <code> acl_access_denied_auth </code> : Number of authentication failures </li> <li> <code> acl_access_denied_cmd </code> : Number of commands rejected because of access denied to the command </li> <li> <code> acl_access_denied_key </code> : Number of commands rejected because of access denied to a key </li> <li> <code> acl_access_denied_channel </code> : Number of commands rejected because of access denied to a channel </li> </ul> <p> Here is the meaning of all fields in the <strong> replication </strong> section: </p> <ul> <li> <code> role </code> : Value is "master" if the instance is replica of no one, or "slave" if the instance is a replica of some master instance. Note that a replica can be master of another replica (chained replication). </li> <li> <code> master_failover_state </code> : The state of an ongoing failover, if any. </li> <li> <code> master_replid </code> : The replication ID of the Redis server. </li> <li> <code> master_replid2 </code> : The secondary replication ID, used for PSYNC after a failover. </li> <li> <code> master_repl_offset </code> : The server's current replication offset </li> <li> <code> second_repl_offset </code> : The offset up to which replication IDs are accepted </li> <li> <code> repl_backlog_active </code> : Flag indicating replication backlog is active </li> <li> <code> repl_backlog_size </code> : Total size in bytes of the replication backlog buffer </li> <li> <code> repl_backlog_first_byte_offset </code> : The master offset of the replication backlog buffer </li> <li> <code> repl_backlog_histlen </code> : Size in bytes of the data in the replication backlog buffer </li> </ul> <p> If the instance is a replica, these additional fields are provided: </p> <ul> <li> <code> master_host </code> : Host or IP address of the master </li> <li> <code> master_port </code> : Master listening TCP port </li> <li> <code> master_link_status </code> : Status of the link (up/down) </li> <li> <code> master_last_io_seconds_ago </code> : Number of seconds since the last interaction with master </li> <li> <code> master_sync_in_progress </code> : Indicate the master is syncing to the replica </li> <li> <code> slave_read_repl_offset </code> : The read replication offset of the replica instance. </li> <li> <code> slave_repl_offset </code> : The replication offset of the replica instance </li> <li> <code> slave_priority </code> : The priority of the instance as a candidate for failover </li> <li> <code> slave_read_only </code> : Flag indicating if the replica is read-only </li> <li> <code> replica_announced </code> : Flag indicating if the replica is announced by Sentinel. </li> </ul> <p> If a SYNC operation is on-going, these additional fields are provided: </p> <ul> <li> <code> master_sync_total_bytes </code> : Total number of bytes that need to be transferred. this may be 0 when the size is unknown (for example, when the <code> repl-diskless-sync </code> configuration directive is used) </li> <li> <code> master_sync_read_bytes </code> : Number of bytes already transferred </li> <li> <code> master_sync_left_bytes </code> : Number of bytes left before syncing is complete (may be negative when <code> master_sync_total_bytes </code> is 0) </li> <li> <code> master_sync_perc </code> : The percentage <code> master_sync_read_bytes </code> from <code> master_sync_total_bytes </code> , or an approximation that uses <code> loading_rdb_used_mem </code> when <code> master_sync_total_bytes </code> is 0 </li> <li> <code> master_sync_last_io_seconds_ago </code> : Number of seconds since last transfer I/O during a SYNC operation </li> </ul> <p> If the link between master and replica is down, an additional field is provided: </p> <ul> <li> <code> master_link_down_since_seconds </code> : Number of seconds since the link is down </li> </ul> <p> The following field is always provided: </p> <ul> <li> <code> connected_slaves </code> : Number of connected replicas </li> </ul> <p> If the server is configured with the <code> min-slaves-to-write </code> (or starting with Redis 5 with the <code> min-replicas-to-write </code> ) directive, an additional field is provided: </p> <ul> <li> <code> min_slaves_good_slaves </code> : Number of replicas currently considered good </li> </ul> <p> For each replica, the following line is added: </p> <ul> <li> <code> slaveXXX </code> : id, IP address, port, state, offset, lag </li> </ul> <p> Here is the meaning of all fields in the <strong> cpu </strong> section: </p> <ul> <li> <code> used_cpu_sys </code> : System CPU consumed by the Redis server, which is the sum of system CPU consumed by all threads of the server process (main thread and background threads) </li> <li> <code> used_cpu_user </code> : User CPU consumed by the Redis server, which is the sum of user CPU consumed by all threads of the server process (main thread and background threads) </li> <li> <code> used_cpu_sys_children </code> : System CPU consumed by the background processes </li> <li> <code> used_cpu_user_children </code> : User CPU consumed by the background processes </li> <li> <code> used_cpu_sys_main_thread </code> : System CPU consumed by the Redis server main thread </li> <li> <code> used_cpu_user_main_thread </code> : User CPU consumed by the Redis server main thread </li> </ul> <p> The <strong> commandstats </strong> 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). </p> <p> For each command type, the following line is added: </p> <ul> <li> <code> cmdstat_XXX </code> : <code> calls=XXX,usec=XXX,usec_per_call=XXX,rejected_calls=XXX,failed_calls=XXX </code> </li> </ul> <p> The <strong> latencystats </strong> section provides latency percentile distribution statistics based on the command type. </p> <p> By default, the exported latency percentiles are the p50, p99, and p999. If you need to change the exported percentiles, use <code> CONFIG SET latency-tracking-info-percentiles "50.0 99.0 99.9" </code> . </p> <p> This section requires the extended latency monitoring feature to be enabled (by default it's enabled). If you need to enable it, use <code> CONFIG SET latency-tracking yes </code> . </p> <p> For each command type, the following line is added: </p> <ul> <li> <code> latency_percentiles_usec_XXX: p&lt;percentile 1&gt;=&lt;percentile 1 value&gt;,p&lt;percentile 2&gt;=&lt;percentile 2 value&gt;,... </code> </li> </ul> <p> The <strong> errorstats </strong> section enables keeping track of the different errors that occurred within Redis, based upon the reply error prefix ( The first word after the "-", up to the first space. Example: <code> ERR </code> ). </p> <p> For each error type, the following line is added: </p> <ul> <li> <code> errorstat_XXX </code> : <code> count=XXX </code> </li> </ul> <p> If the server detects that this section was flooded with an excessive number of errors, it will be disabled, show a single <code> ERRORSTATS_DISABLED </code> error, and print the errors to the server log. This can be reset by <code> CONFIG RESETSTAT </code> . </p> <p> The <strong> sentinel </strong> section is only available in Redis Sentinel instances. It consists of the following fields: </p> <ul> <li> <code> sentinel_masters </code> : Number of Redis masters monitored by this Sentinel instance </li> <li> <code> sentinel_tilt </code> : A value of 1 means this sentinel is in TILT mode </li> <li> <code> sentinel_tilt_since_seconds </code> : Duration in seconds of current TILT, or -1 if not TILTed. Added in Redis 7.0.0 </li> <li> <code> sentinel_running_scripts </code> : The number of scripts this Sentinel is currently executing </li> <li> <code> sentinel_scripts_queue_length </code> : The length of the queue of user scripts that are pending execution </li> <li> <code> sentinel_simulate_failure_flags </code> : Flags for the <code> SENTINEL SIMULATE-FAILURE </code> command </li> </ul> <p> The <strong> cluster </strong> section currently only contains a unique field: </p> <ul> <li> <code> cluster_enabled </code> : Indicate Redis cluster is enabled </li> </ul> <p> The <strong> modules </strong> section contains additional information about loaded modules if the modules provide it. The field part of properties lines in this section is always prefixed with the module's name. </p> <p> The <strong> keyspace </strong> section provides statistics on the main dictionary of each database. The statistics are the number of keys, and the number of keys with an expiration. </p> <p> For each database, the following line is added: </p> <ul> <li> <code> dbXXX </code> : <code> keys=XXX,expires=XXX,avg_ttl=XXX,subexpiry=XXX </code> </li> </ul> <p> The <strong> debug </strong> section contains experimental metrics, which might change or get removed in future versions. It won't be included when <code> INFO </code> or <code> INFO ALL </code> are called, and it is returned only when <code> INFO DEBUG </code> is used. </p> <ul> <li> <code> eventloop_duration_aof_sum </code> : Total time spent on flushing AOF in eventloop in microseconds. </li> <li> <code> eventloop_duration_cron_sum </code> : Total time consumption of cron in microseconds (including serverCron and beforeSleep, but excluding IO and AOF flushing). </li> <li> <code> eventloop_duration_max </code> : The maximal time spent in a single eventloop cycle in microseconds. </li> <li> <code> eventloop_cmd_per_cycle_max </code> : The maximal number of commands processed in a single eventloop cycle. </li> <li> <code> allocator_allocated_lua </code> : Total bytes allocated from the allocator specifically for Lua, including internal-fragmentation. </li> <li> <code> allocator_active_lua </code> : Total bytes in the allocator active pages specifically for Lua, including external-fragmentation. </li> <li> <code> allocator_resident_lua </code> : Total bytes resident (RSS) in the allocator specifically for Lua. This includes pages that can be released to the OS (by <code> MEMORY PURGE </code> , or just waiting). </li> <li> <code> allocator_frag_bytes_lua </code> : Delta between <code> allocator_active_lua </code> and <code> allocator_allocated_lua </code> . </li> </ul> <p> <strong> A note about the word slave used in this man page </strong> : Starting with Redis 5, if not for backward compatibility, the Redis project no longer uses the word slave. Unfortunately in this command the word slave is part of the protocol, so we'll be able to remove such occurrences only when this API will be naturally deprecated. </p> <p> <strong> Modules generated sections </strong> : Starting with Redis 6, modules can inject their information into the <code> INFO </code> command. These are excluded by default even when the <code> all </code> argument is provided (it will include a list of loaded modules but not their generated info fields). To get these you must use either the <code> modules </code> argument or <code> everything </code> . </p> <h2 id="redis-software-and-redis-cloud-compatibility"> Redis Software and Redis Cloud compatibility </h2> <table> <thead> <tr> <th style="text-align:left"> Redis <br/> Enterprise </th> <th style="text-align:left"> Redis <br/> Cloud </th> <th style="text-align:left"> <span style="min-width: 9em; display: table-cell"> Notes </span> </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <span title="Supported"> βœ… Standard </span> <br/> <span title="Supported"> <nobr> βœ… Active-Active </nobr> </span> </td> <td style="text-align:left"> <span title="Supported"> βœ… Standard </span> <br/> <span title="Supported"> <nobr> βœ… Active-Active </nobr> </span> </td> <td style="text-align:left"> In Redis Enterprise, <code> INFO </code> returns a different set of fields than Redis Community Edition. <br/> Not supported for <a href="/docs/latest/develop/interact/programmability/"> scripts </a> . </td> </tr> </tbody> </table> <p> Note: key memory usage is different on Redis Software or Redis Cloud active-active databases than on non-active-active databases. This is because memory usage includes some amount of CRDB overhead. </p> <p> Additionally, for JSON keys, Redis implements a β€œshared string” mechanism to save memory when the same JSON field names or field values of type string are used more than once (either inter-key or intra-key). In such cases, instead of storing the field names or values many times, Redis stores them only once. This mechanism is not in place for active-active databases. </p> <p> On non-active-active databases, <code> INFO </code> (Memory &gt; used_memory) reports that the shared memory is counted, but only once for all keys. On active-active databases, there is no shared memory, so if strings are repeated, they are stored multiple times. </p> <p> <strong> Example </strong> </p> <p> Suppose you have ten JSON keys, and each key has 5KB of unique content and 5KB of shared content. </p> <p> For non-active-active databases, <code> INFO </code> (used_memory) would report (10 keys * 5KB) + 5KB ~= 55KB. The last term, "+ 5KB", is the size of the shared content. </p> <p> For active-active databases, <code> INFO </code> (used_memory) would report 10 keys * 20KB ~= 200KB. This number includes some amount of CRDB overhead per JSON key. </p> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <p> <a href="../../develop/reference/protocol-spec#bulk-strings"> Bulk string reply </a> : a map of info fields, one field per line in the form of <code> &lt;field&gt;:&lt;value&gt; </code> where the value can be a comma separated map like <code> &lt;key&gt;=&lt;val&gt; </code> . Also contains section header lines starting with <code> # </code> and blank lines. </p> <p> Lines can contain a section name (starting with a <code> # </code> character) or a property. All the properties are in the form of <code> field:value </code> terminated by <code> \r\n </code> . </p> <br/> <h2> History </h2> <ul> <li> Starting with Redis version 7.0.0: Added support for taking multiple section arguments. </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/info/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/redisinsight/install/install-on-docker/.html
<section class="prose w-full py-12 max-w-none"> <h1> Install on Docker </h1> <p class="text-lg -mt-5 mb-10"> How to install Redis Insight on Docker </p> <p> This tutorial shows how to install Redis Insight on <a href="https://www.docker.com/"> Docker </a> so you can use Redis Insight in development. See a separate guide for installing <a href="/docs/latest/operate/redisinsight/install/install-on-aws/"> Redis Insight on AWS </a> . </p> <h2 id="install-docker"> Install Docker </h2> <p> The first step is to <a href="https://docs.docker.com/install/"> install Docker for your operating system </a> . </p> <h2 id="run-redis-insight-docker-image"> Run Redis Insight Docker image </h2> <p> You can install Redis Insight using one of the options described below. </p> <ol> <li> If you do not want to persist your Redis Insight data: </li> </ol> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">docker run -d --name redisinsight -p 5540:5540 redis/redisinsight:latest </span></span></code></pre> </div> <ol start="2"> <li> If you want to persist your Redis Insight data, first attach the Docker volume to the <code> /data </code> path and then run the following command: </li> </ol> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">docker run -d --name redisinsight -p 5540:5540 redis/redisinsight:latest -v redisinsight:/data </span></span></code></pre> </div> <p> If the previous command returns a permission error, ensure that the user with <code> ID = 1000 </code> has the necessary permissions to access the volume provided ( <code> redisinsight </code> in the command above). </p> <p> Next, point your browser to <code> http://localhost:5540 </code> . </p> <p> Redis Insight also provides a health check endpoint at <code> http://localhost:5540/api/health/ </code> to monitor the health of the running container. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/redisinsight/install/install-on-docker/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/command-count/.html
<section class="prose w-full py-12"> <h1 class="command-name"> COMMAND COUNT </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">COMMAND COUNT</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 2.8.13 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> <code> @connection </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Returns <a href="/docs/latest/develop/reference/protocol-spec/#integers"> Integer reply </a> of number of total commands in this Redis server. </p> <h2 id="examples"> Examples </h2> <div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex"> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z"> </path> </svg> </div> <form class="redis-cli overflow-y-auto max-h-80"> <pre tabindex="0">redis&gt; COMMAND COUNT (integer) 250 </pre> <div class="prompt" style=""> <span> redis&gt; </span> <input autocomplete="off" name="prompt" spellcheck="false" type="text"/> </div> </form> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : the number of commands returned by <code> COMMAND </code> . <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/command-count/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/databases/active-active/synchronization-mode/.html
<section class="prose w-full py-12 max-w-none"> <h1> Configure distributed synchronization </h1> <p class="text-lg -mt-5 mb-10"> How to configure distributed synchronization so that any available proxy endpoint can manage synchronization traffic. </p> <p> Replicated databases, such as <a href="/docs/latest/operate/rs/databases/import-export/replica-of/"> Replica Of </a> and <a href="/docs/latest/operate/rs/databases/active-active/"> Active-Active </a> databases, use proxy endpoints to synchronize database changes with the databases on other participating clusters. </p> <p> To improve the throughput and lower the latency for synchronization traffic, you can configure a replicated database to use distributed synchronization where any available proxy endpoint can manage synchronization traffic. </p> <p> Every database by default has one proxy endpoint that manages client and synchronization communication with the database shards, and that proxy endpoint is used for database synchronization. This is called centralized synchronization. </p> <p> To prepare a database to use distributed synchronization you must first make sure that the database <a href="/docs/latest/operate/rs/databases/configure/proxy-policy/"> proxy policy </a> is defined so that either each node has a proxy endpoint or each primary (master) shard has a proxy endpoint. After you have multiple proxies for the database, you can configure the database synchronization to use distributed synchronization. </p> <h2 id="configure-distributed-synchronization"> Configure distributed synchronization </h2> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> You may use the database name in place of <code> db:&lt;ID&gt; </code> in the following <code> rladmin </code> commands. </div> </div> <p> To configure distributed synchronization: </p> <ol> <li> <p> To check the proxy policy for the database, run: <code> rladmin status </code> </p> <p> The output of the status command shows the list of endpoints on the cluster and the proxy policy for the endpoint. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">ENDPOINTS: </span></span><span class="line"><span class="cl">DB:ID NAME ID NODE ROLE SSL </span></span><span class="line"><span class="cl">db:1 db endpoint:1:1 node:1 all-master-shards No </span></span></code></pre> </div> <p> If the proxy policy (also known as a <em> role </em> ) is <code> single </code> , configure the policy to <code> all-nodes </code> or <code> all-master-shards </code> according to your needs with the command: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin <span class="nb">bind</span> db db:&lt;ID&gt; endpoint &lt;endpoint id&gt; policy &lt;all-master-shards<span class="p">|</span>all-nodes&gt; </span></span></code></pre> </div> </li> <li> <p> To configure the database to use distributed synchronization, run: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune db db:&lt;ID&gt; syncer_mode distributed </span></span></code></pre> </div> <p> To change back to centralized synchronization, run: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune db db:&lt;ID&gt; syncer_mode centralized </span></span></code></pre> </div> </li> </ol> <h2 id="verify-database-synchronization"> Verify database synchronization </h2> <p> Use <code> rladmin </code> to verify a database synchronization role: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin info db db:&lt;ID&gt; </span></span></code></pre> </div> <p> The current database role is reported as the <code> syncer_mode </code> value: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin info db db:&lt;ID&gt; </span></span><span class="line"><span class="cl">db:&lt;ID&gt; <span class="o">[</span>&lt;db_name&gt;<span class="o">]</span>: </span></span><span class="line"><span class="cl"> // <span class="o">(</span>Other settings removed<span class="o">)</span> </span></span><span class="line"><span class="cl"> syncer_mode: centralized </span></span></code></pre> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/databases/active-active/synchronization-mode/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/kubernetes/release-notes/previous-releases/k8s-6-0-8-20/.html
<section class="prose w-full py-12 max-w-none"> <h1> Redis Enterprise for Kubernetes Release Notes 6.0.8-20 (December 2020) </h1> <p class="text-lg -mt-5 mb-10"> Support for RS 6.0.8, consumer namespaces, Gesher admission controller proxy, and custom resource validation via schema. </p> <p> The Redis Enterprise K8s 6.0.8-20 release is a <em> major release </em> on top of <a href="https://github.com/RedisLabs/redis-enterprise-k8s-docs/releases/tag/v6.0.8-1"> 6.0.8-1 </a> providing support for the <a href="https://docs.redislabs.com/latest/rs/release-notes/rs-6-0-8-september-2020/"> Redis Enterprise Software release 6.0.8-30 </a> and includes several enhancements and bug fixes. </p> <h2 id="overview"> Overview </h2> <p> This release of the operator provides: </p> <ul> <li> New features </li> <li> Various bug fixes </li> </ul> <p> To upgrade your deployment to this latest release, see <a href="/docs/latest/operate/kubernetes/upgrade/upgrade-redis-cluster/"> "Upgrade a Redis Enterprise cluster (REC) on Kubernetes" </a> . </p> <h2 id="images"> Images </h2> <p> This release includes the following container images: </p> <ul> <li> <strong> Redis Enterprise </strong> : redislabs/redis:6.0.8-30 or redislabs/redis:6.0.8-30.rhel7-openshift </li> <li> <strong> Operator and Bootstrapper </strong> : redislabs/operator:6.0.8-20 </li> <li> <strong> Services Rigger </strong> : redislabs/k8s-controller:6.0.8-20 or redislabs/services-manager:6.0.8-20 (Red Hat registry) </li> </ul> <h2 id="new-features"> New features </h2> <ul> <li> You can now create database custom resources (REDB CRs) in consumer namespaces that are separate from the operator and cluster namespace. You configured the operator deployment to watch specific namespaces for these REDB CRs. </li> <li> The Gesher admission control proxy is now certified by Red Hat. </li> <li> REDB CRs no longer require a Redis Enterprise cluster name. The name will default to the cluster in the context of the operator. </li> <li> REC and REDB CRs are now validated via a schema. </li> </ul> <h2 id="important-fixes"> Important fixes </h2> <ul> <li> The database controller (REDB) no longer generates the following error message:Β  β€œfailed to update database status" </li> <li> Issues with configuring replica-of through the database controller (REDB) and TLS have been fixed. (RED48285) </li> <li> A timeout issue with <code> rlutil upgrade </code> was fixed. (RED48700) </li> </ul> <h2 id="known-limitations"> Known limitations </h2> <h3 id="crashloopbackoff-causes-cluster-recovery-to-be-incomplete--red33713"> CrashLoopBackOff causes cluster recovery to be incomplete (RED33713) </h3> <p> When a pod's status is <code> CrashLoopBackOff </code> and we run the cluster recovery, the process will not complete. The workaround is to delete the crashing pods manually. The recovery process will then continue. </p> <h3 id="long-cluster-names-cause-routes-to-be-rejected--red25871"> Long cluster names cause routes to be rejected (RED25871) </h3> <p> A cluster name longer than 20 characters will result in a rejected route configuration because the host part of the domain name will exceed 63 characters. The workaround is to limit cluster name to 20 characters or fewer. </p> <h3 id="cluster-cr-rec-errors-are-not-reported-after-invalid-updates-red25542"> Cluster CR (REC) errors are not reported after invalid updates (RED25542) </h3> <p> A cluster CR specification error is not reported if two or more invalid CR resources are updated in sequence. </p> <h3 id="an-unreachable-cluster-has-status-running-red32805"> An unreachable cluster has status running (RED32805) </h3> <p> When a cluster is in an unreachable state, the state is still <code> running </code> instead of being reported as an error. </p> <h3 id="readiness-probe-incorrect-on-failures-red39300"> Readiness probe incorrect on failures (RED39300) </h3> <p> STS Readiness probe does not mark a node as "not ready" when running <code> rladmin status </code> on the node fails. </p> <h3 id="role-missing-on-replica-sets-red39002"> Role missing on replica sets (RED39002) </h3> <p> The <code> redis-enterprise-operator </code> role is missing permission on replica sets. </p> <h3 id="private-registries-are-not-supported-on-openshift-311-red38579"> Private registries are not supported on OpenShift 3.11 (RED38579) </h3> <p> Openshift 3.11 does not support DockerHub private registries. This is a known OpenShift issue. </p> <h3 id="internal-dns-and-kubernetes-dns-may-have-conflicts-red37462"> Internal DNS and Kubernetes DNS may have conflicts (RED37462) </h3> <p> DNS conflicts are possible between the cluster mdns_server and the K8s DNS. This only impacts DNS resolution from within cluster nodes for Kubernetes DNS names. </p> <h3 id="5410-negatively-impacts-546-red37233"> 5.4.10 negatively impacts 5.4.6 (RED37233) </h3> <p> Kubernetes-based 5.4.10 deployments seem to negatively impact existing 5.4.6 deployments that share a Kubernetes cluster. </p> <h3 id="node-cpu-usage-is-reported-instead-of-pod-cpu-usage-red36884"> Node CPU usage is reported instead of pod CPU usage (RED36884) </h3> <p> In Kubernetes, the node CPU usage we report on is the usage of the Kubernetes worker node hosting the REC pod. </p> <h3 id="clusters-must-be-named-rec-in-olm-based-deployments-red39825"> Clusters must be named "rec" in OLM-based deployments (RED39825) </h3> <p> In OLM-deployed operators, the deployment of the cluster will fail if the name is not "rec". When the operator is deployed via the OLM, the security context constraints (scc) is bound to a specific service account name (i.e., "rec"). The workaround is to name the cluster "rec". </p> <h3 id="master-pod-label-in-rancher-red42896"> Master pod label in Rancher (RED42896) </h3> <p> The master pod is not always labeled in Rancher. </p> <h3 id="rec-clusters-fail-to-start-on-kubernetes-clusters-with-unsynchronized-clocks-red47254"> REC clusters fail to start on Kubernetes clusters with unsynchronized clocks (RED47254) </h3> <p> When REC clusters are deployed on Kubernetes clusters with unsynchronized clocks, the REC cluster does not start correctly. The fix is to use NTP to synchronize the underlying K8s nodes. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/kubernetes/release-notes/previous-releases/k8s-6-0-8-20/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/develop/reference/client-side-caching/.html
<section class="prose w-full py-12"> <h1> Client-side caching reference </h1> <p class="text-lg -mt-5 mb-10"> Server-assisted, client-side caching in Redis </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> This document is intended as an in-depth reference for client-side caching. See <a href="/docs/latest/develop/clients/client-side-caching/"> Client-side caching introduction </a> for general usage guidelines. </div> </div> <p> Client-side caching is a technique used to create high performance services. It exploits the memory available on application servers, servers that are usually distinct computers compared to the database nodes, to store some subset of the database information directly in the application side. </p> <p> Normally when data is required, the application servers ask the database about such information, like in the following diagram: </p> <pre><code>+-------------+ +----------+ | | ------- GET user:1234 -------&gt; | | | Application | | Database | | | &lt;---- username = Alice ------- | | +-------------+ +----------+ </code></pre> <p> When client-side caching is used, the application will store the reply of popular queries directly inside the application memory, so that it can reuse such replies later, without contacting the database again: </p> <pre><code>+-------------+ +----------+ | | | | | Application | ( No chat needed ) | Database | | | | | +-------------+ +----------+ | Local cache | | | | user:1234 = | | username | | Alice | +-------------+ </code></pre> <p> While the application memory used for the local cache may not be very big, the time needed in order to access the local computer memory is orders of magnitude smaller compared to accessing a networked service like a database. Since often the same small percentage of data are accessed frequently, this pattern can greatly reduce the latency for the application to get data and, at the same time, the load in the database side. </p> <p> Moreover there are many datasets where items change very infrequently. For instance, most user posts in a social network are either immutable or rarely edited by the user. Adding to this the fact that usually a small percentage of the posts are very popular, either because a small set of users have a lot of followers and/or because recent posts have a lot more visibility, it is clear why such a pattern can be very useful. </p> <p> Usually the two key advantages of client-side caching are: </p> <ol> <li> Data is available with a very small latency. </li> <li> The database system receives less queries, allowing it to serve the same dataset with a smaller number of nodes. </li> </ol> <h2 id="there-are-two-hard-problems-in-computer-science"> There are two hard problems in computer science... </h2> <p> A problem with the above pattern is how to invalidate the information that the application is holding, in order to avoid presenting stale data to the user. For example after the application above locally cached the information for user:1234, Alice may update her username to Flora. Yet the application may continue to serve the old username for user:1234. </p> <p> Sometimes, depending on the exact application we are modeling, this isn't a big deal, so the client will just use a fixed maximum "time to live" for the cached information. Once a given amount of time has elapsed, the information will no longer be considered valid. More complex patterns, when using Redis, leverage the Pub/Sub system in order to send invalidation messages to listening clients. This can be made to work but is tricky and costly from the point of view of the bandwidth used, because often such patterns involve sending the invalidation messages to every client in the application, even if certain clients may not have any copy of the invalidated data. Moreover every application query altering the data requires to use the <a href="/docs/latest/commands/publish/"> <code> PUBLISH </code> </a> command, costing the database more CPU time to process this command. </p> <p> Regardless of what schema is used, there is a simple fact: many very large applications implement some form of client-side caching, because it is the next logical step to having a fast store or a fast cache server. For this reason Redis 6 implements direct support for client-side caching, in order to make this pattern much simpler to implement, more accessible, reliable, and efficient. </p> <h2 id="the-redis-implementation-of-client-side-caching"> The Redis implementation of client-side caching </h2> <p> The Redis client-side caching support is called <em> Tracking </em> , and has two modes: </p> <ul> <li> In the default mode, the server remembers what keys a given client accessed, and sends invalidation messages when the same keys are modified. This costs memory in the server side, but sends invalidation messages only for the set of keys that the client might have in memory. </li> <li> In the <em> broadcasting </em> mode, the server does not attempt to remember what keys a given client accessed, so this mode costs no memory at all in the server side. Instead clients subscribe to key prefixes such as <code> object: </code> or <code> user: </code> , and receive a notification message every time a key matching a subscribed prefix is touched. </li> </ul> <p> To recap, for now let's forget for a moment about the broadcasting mode, to focus on the first mode. We'll describe broadcasting in more detail later. </p> <ol> <li> Clients can enable tracking if they want. Connections start without tracking enabled. </li> <li> When tracking is enabled, the server remembers what keys each client requested during the connection lifetime (by sending read commands about such keys). </li> <li> When a key is modified by some client, or is evicted because it has an associated expire time, or evicted because of a <em> maxmemory </em> policy, all the clients with tracking enabled that may have the key cached, are notified with an <em> invalidation message </em> . </li> <li> When clients receive invalidation messages, they are required to remove the corresponding keys, in order to avoid serving stale data. </li> </ol> <p> This is an example of the protocol: </p> <ul> <li> Client 1 <code> -&gt; </code> Server: CLIENT TRACKING ON </li> <li> Client 1 <code> -&gt; </code> Server: GET foo </li> <li> (The server remembers that Client 1 may have the key "foo" cached) </li> <li> (Client 1 may remember the value of "foo" inside its local memory) </li> <li> Client 2 <code> -&gt; </code> Server: SET foo SomeOtherValue </li> <li> Server <code> -&gt; </code> Client 1: INVALIDATE "foo" </li> </ul> <p> This looks great superficially, but if you imagine 10k connected clients all asking for millions of keys over long living connection, the server ends up storing too much information. For this reason Redis uses two key ideas in order to limit the amount of memory used server-side and the CPU cost of handling the data structures implementing the feature: </p> <ul> <li> The server remembers the list of clients that may have cached a given key in a single global table. This table is called the <strong> Invalidation Table </strong> . The invalidation table can contain a maximum number of entries. If a new key is inserted, the server may evict an older entry by pretending that such key was modified (even if it was not), and sending an invalidation message to the clients. Doing so, it can reclaim the memory used for this key, even if this will force the clients having a local copy of the key to evict it. </li> <li> Inside the invalidation table we don't really need to store pointers to clients' structures, that would force a garbage collection procedure when the client disconnects: instead what we do is just store client IDs (each Redis client has a unique numerical ID). If a client disconnects, the information will be incrementally garbage collected as caching slots are invalidated. </li> <li> There is a single keys namespace, not divided by database numbers. So if a client is caching the key <code> foo </code> in database 2, and some other client changes the value of the key <code> foo </code> in database 3, an invalidation message will still be sent. This way we can ignore database numbers reducing both the memory usage and the implementation complexity. </li> </ul> <h2 id="two-connections-mode"> Two connections mode </h2> <p> Using the new version of the Redis protocol, RESP3, supported by Redis 6, it is possible to run the data queries and receive the invalidation messages in the same connection. However many client implementations may prefer to implement client-side caching using two separated connections: one for data, and one for invalidation messages. For this reason when a client enables tracking, it can specify to redirect the invalidation messages to another connection by specifying the "client ID" of a different connection. Many data connections can redirect invalidation messages to the same connection, this is useful for clients implementing connection pooling. The two connections model is the only one that is also supported for RESP2 (which lacks the ability to multiplex different kind of information in the same connection). </p> <p> Here's an example of a complete session using the Redis protocol in the old RESP2 mode involving the following steps: enabling tracking redirecting to another connection, asking for a key, and getting an invalidation message once the key gets modified. </p> <p> To start, the client opens a first connection that will be used for invalidations, requests the connection ID, and subscribes via Pub/Sub to the special channel that is used to get invalidation messages when in RESP2 modes (remember that RESP2 is the usual Redis protocol, and not the more advanced protocol that you can use, optionally, with Redis 6 using the <a href="/docs/latest/commands/hello/"> <code> HELLO </code> </a> command): </p> <pre tabindex="0"><code>(Connection 1 -- used for invalidations) CLIENT ID :4 SUBSCRIBE __redis__:invalidate *3 $9 subscribe $20 __redis__:invalidate :1 </code></pre> <p> Now we can enable tracking from the data connection: </p> <pre tabindex="0"><code>(Connection 2 -- data connection) CLIENT TRACKING on REDIRECT 4 +OK GET foo $3 bar </code></pre> <p> The client may decide to cache <code> "foo" =&gt; "bar" </code> in the local memory. </p> <p> A different client will now modify the value of the "foo" key: </p> <pre tabindex="0"><code>(Some other unrelated connection) SET foo bar +OK </code></pre> <p> As a result, the invalidations connection will receive a message that invalidates the specified key. </p> <pre tabindex="0"><code>(Connection 1 -- used for invalidations) *3 $7 message $20 __redis__:invalidate *1 $3 foo </code></pre> <p> The client will check if there are cached keys in this caching slot, and will evict the information that is no longer valid. </p> <p> Note that the third element of the Pub/Sub message is not a single key but is a Redis array with just a single element. Since we send an array, if there are groups of keys to invalidate, we can do that in a single message. In case of a flush ( <a href="/docs/latest/commands/flushall/"> <code> FLUSHALL </code> </a> or <a href="/docs/latest/commands/flushdb/"> <code> FLUSHDB </code> </a> ), a <code> null </code> message will be sent. </p> <p> A very important thing to understand about client-side caching used with RESP2 and a Pub/Sub connection in order to read the invalidation messages, is that using Pub/Sub is entirely a trick <strong> in order to reuse old client implementations </strong> , but actually the message is not really sent to a channel and received by all the clients subscribed to it. Only the connection we specified in the <code> REDIRECT </code> argument of the <a href="/docs/latest/commands/client/"> <code> CLIENT </code> </a> command will actually receive the Pub/Sub message, making the feature a lot more scalable. </p> <p> When RESP3 is used instead, invalidation messages are sent (either in the same connection, or in the secondary connection when redirection is used) as <code> push </code> messages (read the RESP3 specification for more information). </p> <h2 id="what-tracking-tracks"> What tracking tracks </h2> <p> As you can see clients do not need, by default, to tell the server what keys they are caching. Every key that is mentioned in the context of a read-only command is tracked by the server, because it <em> could be cached </em> . </p> <p> This has the obvious advantage of not requiring the client to tell the server what it is caching. Moreover in many clients implementations, this is what you want, because a good solution could be to just cache everything that is not already cached, using a first-in first-out approach: we may want to cache a fixed number of objects, every new data we retrieve, we could cache it, discarding the oldest cached object. More advanced implementations may instead drop the least used object or alike. </p> <p> Note that anyway if there is write traffic on the server, caching slots will get invalidated during the course of the time. In general when the server assumes that what we get we also cache, we are making a tradeoff: </p> <ol> <li> It is more efficient when the client tends to cache many things with a policy that welcomes new objects. </li> <li> The server will be forced to retain more data about the client keys. </li> <li> The client will receive useless invalidation messages about objects it did not cache. </li> </ol> <p> So there is an alternative described in the next section. </p> <h2 id="opt-in-and-opt-out-caching"> Opt-in and Opt-out caching </h2> <h3 id="opt-in"> Opt-in </h3> <p> Clients implementations may want to cache only selected keys, and communicate explicitly to the server what they'll cache and what they will not. This will require more bandwidth when caching new objects, but at the same time reduces the amount of data that the server has to remember and the amount of invalidation messages received by the client. </p> <p> In order to do this, tracking must be enabled using the OPTIN option: </p> <pre><code>CLIENT TRACKING ON REDIRECT 1234 OPTIN </code></pre> <p> In this mode, by default, keys mentioned in read queries <em> are not supposed to be cached </em> , instead when a client wants to cache something, it must send a special command immediately before the actual command to retrieve the data: </p> <pre><code>CLIENT CACHING YES +OK GET foo "bar" </code></pre> <p> The <code> CACHING </code> command affects the command executed immediately after it. However, in case the next command is <a href="/docs/latest/commands/multi/"> <code> MULTI </code> </a> , all the commands in the transaction will be tracked. Similarly, in case of Lua scripts, all the commands executed by the script will be tracked. </p> <h3 id="opt-out"> Opt-out </h3> <p> Opt-out caching allows clients to automatically cache keys locally without explicitly opting in for each key. This approach ensures that all keys are cached by default unless specified otherwise. Opt-out caching can simplify the implementation of client-side caching by reducing the need for explicit commands to enable caching for individual keys. </p> <p> Tracking must be enabled using the OPTOUT option to enable opt-out caching: </p> <pre><code>CLIENT TRACKING ON OPTOUT </code></pre> <p> If you want to exclude a specific key from being tracked and cached, use the CLIENT UNTRACKING command: </p> <pre><code>CLIENT UNTRACKING key </code></pre> <h2 id="broadcasting-mode"> Broadcasting mode </h2> <p> So far we described the first client-side caching model that Redis implements. There is another one, called broadcasting, that sees the problem from the point of view of a different tradeoff, does not consume any memory on the server side, but instead sends more invalidation messages to clients. In this mode we have the following main behaviors: </p> <ul> <li> Clients enable client-side caching using the <code> BCAST </code> option, specifying one or more prefixes using the <code> PREFIX </code> option. For instance: <code> CLIENT TRACKING on REDIRECT 10 BCAST PREFIX object: PREFIX user: </code> . If no prefix is specified at all, the prefix is assumed to be the empty string, so the client will receive invalidation messages for every key that gets modified. Instead if one or more prefixes are used, only keys matching one of the specified prefixes will be sent in the invalidation messages. </li> <li> The server does not store anything in the invalidation table. Instead it uses a different <strong> Prefixes Table </strong> , where each prefix is associated to a list of clients. </li> <li> No two prefixes can track overlapping parts of the keyspace. For instance, having the prefix "foo" and "foob" would not be allowed, since they would both trigger an invalidation for the key "foobar". However, just using the prefix "foo" is sufficient. </li> <li> Every time a key matching any of the prefixes is modified, all the clients subscribed to that prefix, will receive the invalidation message. </li> <li> The server will consume CPU proportional to the number of registered prefixes. If you have just a few, it is hard to see any difference. With a big number of prefixes the CPU cost can become quite large. </li> <li> In this mode the server can perform the optimization of creating a single reply for all the clients subscribed to a given prefix, and send the same reply to all. This helps to lower the CPU usage. </li> </ul> <h2 id="the-noloop-option"> The NOLOOP option </h2> <p> By default client-side tracking will send invalidation messages to the client that modified the key. Sometimes clients want this, since they implement very basic logic that does not involve automatically caching writes locally. However, more advanced clients may want to cache even the writes they are doing in the local in-memory table. In such case receiving an invalidation message immediately after the write is a problem, since it will force the client to evict the value it just cached. </p> <p> In this case it is possible to use the <code> NOLOOP </code> option: it works both in normal and broadcasting mode. Using this option, clients are able to tell the server they don't want to receive invalidation messages for keys that they modified. </p> <h2 id="avoiding-race-conditions"> Avoiding race conditions </h2> <p> When implementing client-side caching redirecting the invalidation messages to a different connection, you should be aware that there is a possible race condition. See the following example interaction, where we'll call the data connection "D" and the invalidation connection "I": </p> <pre><code>[D] client -&gt; server: GET foo [I] server -&gt; client: Invalidate foo (somebody else touched it) [D] server -&gt; client: "bar" (the reply of "GET foo") </code></pre> <p> As you can see, because the reply to the GET was slower to reach the client, we received the invalidation message before the actual data that is already no longer valid. So we'll keep serving a stale version of the foo key. To avoid this problem, it is a good idea to populate the cache when we send the command with a placeholder: </p> <pre><code>Client cache: set the local copy of "foo" to "caching-in-progress" [D] client-&gt; server: GET foo. [I] server -&gt; client: Invalidate foo (somebody else touched it) Client cache: delete "foo" from the local cache. [D] server -&gt; client: "bar" (the reply of "GET foo") Client cache: don't set "bar" since the entry for "foo" is missing. </code></pre> <p> Such a race condition is not possible when using a single connection for both data and invalidation messages, since the order of the messages is always known in that case. </p> <h2 id="what-to-do-when-losing-connection-with-the-server"> What to do when losing connection with the server </h2> <p> Similarly, if we lost the connection with the socket we use in order to get the invalidation messages, we may end with stale data. In order to avoid this problem, we need to do the following things: </p> <ol> <li> Make sure that if the connection is lost, the local cache is flushed. </li> <li> Both when using RESP2 with Pub/Sub, or RESP3, ping the invalidation channel periodically (you can send PING commands even when the connection is in Pub/Sub mode!). If the connection looks broken and we are not able to receive ping backs, after a maximum amount of time, close the connection and flush the cache. </li> </ol> <h2 id="what-to-cache"> What to cache </h2> <p> Clients may want to run internal statistics about the number of times a given cached key was actually served in a request, to understand in the future what is good to cache. In general: </p> <ul> <li> We don't want to cache many keys that change continuously. </li> <li> We don't want to cache many keys that are requested very rarely. </li> <li> We want to cache keys that are requested often and change at a reasonable rate. For an example of key not changing at a reasonable rate, think of a global counter that is continuously <a href="/docs/latest/commands/incr/"> <code> INCR </code> </a> emented. </li> </ul> <p> However simpler clients may just evict data using some random sampling just remembering the last time a given cached value was served, trying to evict keys that were not served recently. </p> <h2 id="other-hints-for-implementing-client-libraries"> Other hints for implementing client libraries </h2> <ul> <li> Handling TTLs: make sure you also request the key TTL and set the TTL in the local cache if you want to support caching keys with a TTL. </li> <li> Putting a max TTL on every key is a good idea, even if it has no TTL. This protects against bugs or connection issues that would make the client have old data in the local copy. </li> <li> Limiting the amount of memory used by clients is absolutely needed. There must be a way to evict old keys when new ones are added. </li> </ul> <h2 id="limiting-the-amount-of-memory-used-by-redis"> Limiting the amount of memory used by Redis </h2> <p> Be sure to configure a suitable value for the maximum number of keys remembered by Redis or alternatively use the BCAST mode that consumes no memory at all on the Redis side. Note that the memory consumed by Redis when BCAST is not used, is proportional both to the number of keys tracked and the number of clients requesting such keys. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/reference/client-side-caching/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/references/cli-utilities/rladmin/tune/.html
<section class="prose w-full py-12 max-w-none"> <h1> rladmin tune </h1> <p class="text-lg -mt-5 mb-10"> Configures parameters for databases, proxies, nodes, and clusters. </p> <p> Configures parameters for databases, proxies, nodes, and clusters. </p> <h2 id="tune-cluster"> <code> tune cluster </code> </h2> <p> Configures cluster parameters. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune cluster </span></span><span class="line"><span class="cl"> <span class="o">[</span> repl_diskless <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> redis_provision_node_threshold &lt;size&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> redis_migrate_node_threshold &lt;size&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> redis_provision_node_threshold_percent &lt;percent&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> redis_migrate_node_threshold_percent &lt;percent&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> max_simultaneous_backups &lt;number&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> failure_detection_sensitivity <span class="o">{</span> high <span class="p">|</span> low <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> watchdog_profile <span class="o">{</span> cloud <span class="p">|</span> local-network <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> slave_ha <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> slave_ha_grace_period &lt;seconds&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> slave_ha_cooldown_period &lt;seconds&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> slave_ha_bdb_cooldown_period &lt;seconds&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> max_saved_events_per_type &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> parallel_shards_upgrade &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> default_concurrent_restore_actions &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> show_internals <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> expose_hostnames_for_all_suffixes <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> redis_upgrade_policy <span class="o">{</span> latest <span class="p">|</span> major <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> default_redis_version &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> default_non_sharded_proxy_policy <span class="o">{</span> single <span class="p">|</span> all-master-shards <span class="p">|</span> all-nodes <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> default_sharded_proxy_policy <span class="o">{</span> single <span class="p">|</span> all-master-shards <span class="p">|</span> all-nodes <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> default_shards_placement <span class="o">{</span> dense <span class="p">|</span> sparse <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> data_internode_encryption <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> db_conns_auditing <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> acl_pubsub_default <span class="o">{</span> resetchannels <span class="p">|</span> allchannels <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> resp3_default <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> automatic_node_offload <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> default_tracking_table_max_keys_policy &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> default_oss_sharding <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">]</span> </span></span></code></pre> </div> <h3 id="parameters"> Parameters </h3> <table> <thead> <tr> <th> Parameters </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> acl_pubsub_default </td> <td> <code> resetchannels </code> <br/> <code> allchannels </code> </td> <td> Default pub/sub ACL rule for all databases in the cluster: <br/> β€’ <code> resetchannels </code> blocks access to all channels (restrictive) <br/> β€’ <code> allchannels </code> allows access to all channels (permissive) </td> </tr> <tr> <td> automatic_node_offload </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Define whether automatic node offload migration will take place </td> </tr> <tr> <td> data_internode_encryption </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Activates or deactivates <a href="/docs/latest/operate/rs/security/encryption/internode-encryption/"> internode encryption </a> for new databases </td> </tr> <tr> <td> db_conns_auditing </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Activates or deactivates <a href="/docs/latest/operate/rs/security/audit-events/"> connection auditing </a> by default for new databases of a cluster </td> </tr> <tr> <td> default_concurrent_restore_actions </td> <td> integer <br/> <code> all </code> </td> <td> Default number of concurrent actions when restoring a node from a snapshot (positive integer or "all") </td> </tr> <tr> <td> default_non_sharded_proxy_policy </td> <td> <code> single </code> <br/> <br/> <code> all-master-shards </code> <br/> <br/> <code> all-nodes </code> </td> <td> Default <a href="/docs/latest/operate/rs/databases/configure/proxy-policy/"> proxy policy </a> for newly created non-sharded databases' endpoints </td> </tr> <tr> <td> default_oss_sharding </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Default hashing policy to use for new databases. Set to <code> disabled </code> by default. This field is for future use only and should not be changed. </td> </tr> <tr> <td> default_redis_version </td> <td> version number </td> <td> The default Redis database compatibility version used to create new databases. <br/> <br/> The value parameter should be a version number in the form of "x.y" where <em> x </em> represents the major version number and <em> y </em> represents the minor version number. The final value corresponds to the desired version of Redis. <br/> <br/> You cannot set <em> default_redis_version </em> to a value higher than that supported by the current <em> redis_upgrade_policy </em> value. </td> </tr> <tr> <td> default_sharded_proxy_policy </td> <td> <code> single </code> <br/> <br/> <code> all-master-shards </code> <br/> <br/> <code> all-nodes </code> </td> <td> Default <a href="/docs/latest/operate/rs/databases/configure/proxy-policy/"> proxy policy </a> for newly created sharded databases' endpoints </td> </tr> <tr> <td> default_shards_placement </td> <td> <code> dense </code> <br/> <code> sparse </code> </td> <td> New databases place shards according to the default <a href="/docs/latest/operate/rs/databases/memory-performance/shard-placement-policy/"> shard placement policy </a> </td> </tr> <tr> <td> default_tracking_table_max_keys_policy </td> <td> integer (default: 1000000) </td> <td> Defines the default value of the client-side caching invalidation table size for new databases. 0 makes the cache unlimited. </td> </tr> <tr> <td> expose_hostnames_for_all_suffixes </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Exposes hostnames for all DNS suffixes </td> </tr> <tr> <td> failure_detection_sensitivity </td> <td> <code> high </code> <br/> <code> low </code> </td> <td> Predefined thresholds and timeouts for failure detection (previously known as <code> watchdog_profile </code> ) <br/> β€’ <code> high </code> (previously <code> local-network </code> ) – high failure detection sensitivity, lower thresholds, faster failure detection and failover <br/> β€’ <code> low </code> (previously <code> cloud </code> ) – low failure detection sensitivity, higher tolerance for latency variance (also called network jitter) </td> </tr> <tr> <td> login_lockout_counter_reset_after </td> <td> time in seconds </td> <td> Time after failed login attempt before the counter resets to 0 </td> </tr> <tr> <td> login_lockout_duration </td> <td> time in seconds </td> <td> Time a locked account remains locked ( "0" means only an admin can unlock the account) </td> </tr> <tr> <td> login_lockout_threshold </td> <td> integer </td> <td> Number of failed sign-in attempts to trigger locking a user account ("0" means never lock the account) </td> </tr> <tr> <td> max_saved_events_per_type </td> <td> integer </td> <td> Maximum number of events each type saved in CCS per object type </td> </tr> <tr> <td> max_simultaneous_backups </td> <td> integer (default: 4) </td> <td> Number of database backups allowed to run at the same time. Combines with <code> max_redis_forks </code> (set by <a href="#tune-node"> <code> tune node </code> </a> ) to determine the number of shard backups allowed to run simultaneously. </td> </tr> <tr> <td> parallel_shards_upgrade </td> <td> integer <br/> <code> all </code> </td> <td> Number of shards upgraded in parallel during DB upgrade (positive integer or "all") </td> </tr> <tr> <td> redis_migrate_node_threshold </td> <td> size in MB </td> <td> Memory (in MBs by default or can be specified) needed to migrate a database between nodes </td> </tr> <tr> <td> redis_migrate_node_threshold_percent </td> <td> percentage </td> <td> Memory (in percentage) needed to migrate a database between nodes </td> </tr> <tr> <td> redis_provision_node_threshold </td> <td> size in MB </td> <td> Memory (in MBs by default or can be specified) needed to provision a new database </td> </tr> <tr> <td> redis_provision_node_threshold_percent </td> <td> percentage </td> <td> Memory (in percentage) needed to provision a new database </td> </tr> <tr> <td> redis_upgrade_policy </td> <td> <code> latest </code> <br/> <code> major </code> </td> <td> When you upgrade or create a new Redis database, this policy determines which version of Redis database compatibility is used. <br/> <br/> Supported values are: <ul> <li> <p> <code> latest </code> , which applies the most recent Redis compatibility update ( <em> effective default prior to v6.2.4 </em> ) </p> <p> </p> </li> <li> <code> major </code> , which applies the most recent major release compatibility update ( <em> default as of v6.2.4 </em> ). </li> </ul> </td> </tr> <tr> <td> repl_diskless </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Activates or deactivates diskless replication (can be overridden per database) </td> </tr> <tr> <td> resp3_default </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Determines the default value of the <code> resp3 </code> option upon upgrading a database to version 7.2 (defaults to <code> enabled </code> ) </td> </tr> <tr> <td> show_internals </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Controls the visibility of internal databases that are only used for the cluster's management </td> </tr> <tr> <td> slave_ha </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Activates or deactivates <a href="/docs/latest/operate/rs/databases/configure/replica-ha/"> replica high availability </a> in the cluster <br/> (enabled by default; use <a href="#tune-db"> <code> rladmin tune db </code> </a> to change <code> slave_ha </code> for a specific database) <br/> <br/> Deprecated as of Redis Enterprise Software v7.2.4. </td> </tr> <tr> <td> slave_ha_bdb_cooldown_period </td> <td> time in seconds (default: 7200) </td> <td> Time (in seconds) a database must wait after its shards are relocated by <a href="/docs/latest/operate/rs/databases/configure/replica-ha/"> replica high availability </a> before it can go through another shard migration if another node fails (default is 2 hours) </td> </tr> <tr> <td> slave_ha_cooldown_period </td> <td> time in seconds (default: 3600) </td> <td> Time (in seconds) <a href="/docs/latest/operate/rs/databases/configure/replica-ha/"> replica high availability </a> must wait after relocating shards due to node failure before performing another shard migration for any database in the cluster (default is 1 hour) </td> </tr> <tr> <td> slave_ha_grace_period </td> <td> time in seconds (default: 600) </td> <td> Time (in seconds) between when a node fails and when <a href="/docs/latest/operate/rs/databases/configure/replica-ha/"> replica high availability </a> starts relocating shards to another node </td> </tr> <tr> <td> watchdog_profile </td> <td> <code> cloud </code> <br/> <code> local-network </code> </td> <td> Watchdog profiles with preconfigured thresholds and timeouts (deprecated as of Redis Enterprise Software v6.4.2-69; use <span class="break-all"> <code> failure_detection_sensitivity </code> </span> instead) <br/> β€’ <code> cloud </code> is suitable for common cloud environments and has a higher tolerance for latency variance (also called network jitter). <br/> β€’ <code> local-network </code> is suitable for dedicated LANs and has better failure detection and failover times. </td> </tr> </tbody> </table> <h3 id="returns"> Returns </h3> <p> Returns <code> Finished successfully </code> if the cluster configuration was changed. Otherwise, it returns an error. </p> <p> Use <a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/info/#info-cluster"> <code> rladmin info cluster </code> </a> to verify the cluster configuration was changed. </p> <h3 id="example"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin tune cluster slave_ha enabled </span></span><span class="line"><span class="cl">Finished successfully </span></span><span class="line"><span class="cl">$ rladmin info cluster <span class="p">|</span> grep slave_ha </span></span><span class="line"><span class="cl"> slave_ha: enabled </span></span></code></pre> </div> <h2 id="tune-db"> <code> tune db </code> </h2> <p> Configures database parameters. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune db <span class="o">{</span> db:&lt;id&gt; <span class="p">|</span> &lt;name&gt; <span class="o">}</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> slave_buffer &lt;auto <span class="p">|</span> valueMB <span class="p">|</span> hard:soft:time&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> client_buffer &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> repl_backlog &lt;valueMB <span class="p">|</span> auto&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> crdt_repl_backlog &lt;valueMB <span class="p">|</span> auto&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> repl_timeout &lt;seconds&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> repl_diskless <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="p">|</span> default <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> master_persistence <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> maxclients &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> schedpolicy <span class="o">{</span> cmp <span class="p">|</span> mru <span class="p">|</span> spread <span class="p">|</span> mnp <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> max_shard_pipeline &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> conns &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> conns_type &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> max_client_pipeline &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> max_connections &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> max_aof_file_size &lt;size&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> max_aof_load_time &lt;seconds&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> oss_cluster <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> oss_cluster_api_preferred_ip_type &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> slave_ha <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> slave_ha_priority &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> skip_import_analyze <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> mkms <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> continue_on_error <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> gradual_src_mode <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> gradual_sync_mode <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="p">|</span> auto <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> gradual_sync_max_shards_per_source &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> module_name &lt;value&gt; <span class="o">]</span> <span class="o">[</span> module_config_params &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> crdt_xadd_id_uniqueness_mode <span class="o">{</span> liberal <span class="p">|</span> semi-strict <span class="p">|</span> strict <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> metrics_export_all <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> syncer_mode <span class="o">{</span> distributed <span class="p">|</span> centralized <span class="o">}]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> syncer_monitoring <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> mtls_allow_weak_hashing <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> mtls_allow_outdated_cert <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> data_internode_encryption <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> db_conns_auditing <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> resp3 <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> tracking_table_max_keys &lt;size&gt; <span class="o">]</span> </span></span></code></pre> </div> <h3 id="parameters-1"> Parameters </h3> <table> <thead> <tr> <th> Parameter </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> db:id </td> <td> integer </td> <td> ID of the specified database </td> </tr> <tr> <td> name </td> <td> string </td> <td> Name of the specified database </td> </tr> <tr> <td> client_buffer </td> <td> value in MB hard:soft:time </td> <td> Redis client output buffer limits </td> </tr> <tr> <td> conns </td> <td> integer </td> <td> Size of internal connection pool, specified per-thread or per-shard depending on conns_type </td> </tr> <tr> <td> conns_type </td> <td> <code> per-thread </code> <br/> <code> per-shard </code> </td> <td> Specifies connection pool size as either per-thread or per-shard </td> </tr> <tr> <td> continue_on_error </td> <td> </td> <td> Flag that skips tuning shards that can't be reached </td> </tr> <tr> <td> crdt_repl_backlog </td> <td> value in MB <br/> <code> auto </code> </td> <td> Size of the Active-Active replication buffer </td> </tr> <tr> <td> crdt_xadd_id_uniqueness_mode </td> <td> <code> liberal </code> <br/> <code> semi-strict </code> <br/> <code> strict </code> </td> <td> XADD's behavior in an Active-Active database, defined as liberal, semi-strict, or strict (see descriptions below) </td> </tr> <tr> <td> data_internode_encryption </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Activates or deactivates <a href="/docs/latest/operate/rs/security/encryption/internode-encryption/"> internode encryption </a> for the database </td> </tr> <tr> <td> db_conns_auditing </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Activates or deactivates database <a href="/docs/latest/operate/rs/security/audit-events/"> connection auditing </a> for a database </td> </tr> <tr> <td> gradual_src_mode </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Activates or deactivates gradual sync of sources </td> </tr> <tr> <td> gradual_sync_max_shards_per_source </td> <td> integer </td> <td> Number of shards per sync source that can be replicated in parallel (positive integer) </td> </tr> <tr> <td> gradual_sync_mode </td> <td> <code> enabled </code> <br/> <code> disabled </code> <br/> <code> auto </code> </td> <td> Activates, deactivates, or automatically determines gradual sync of source shards </td> </tr> <tr> <td> master_persistence </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> If enabled, persists the primary shard in addition to replica shards in a replicated and persistent database. </td> </tr> <tr> <td> max_aof_file_size </td> <td> size in MB </td> <td> Maximum size (in MB, if not specified) of <a href="/docs/latest/glossary/#letter-a"> AoF </a> file (minimum value is 10 GB) </td> </tr> <tr> <td> max_aof_load_time </td> <td> time in seconds </td> <td> Time limit in seconds to load a shard from an append-only file (AOF). If exceeded, an AOF rewrite is initiated to decrease future load time. <br/> Minimum: 2700 seconds (45 minutes) <br/> Default: 3600 seconds (1 hour) </td> </tr> <tr> <td> max_client_pipeline </td> <td> integer </td> <td> Maximum commands in the proxy's pipeline per client connection (max value is 2047, default value is 200) </td> </tr> <tr> <td> max_connections </td> <td> integer </td> <td> Maximum client connections to the database's endpoint (default value is 0, which is unlimited) </td> </tr> <tr> <td> max_shard_pipeline </td> <td> integer </td> <td> Maximum commands in the proxy's pipeline per shard connection (default value is 200) </td> </tr> <tr> <td> maxclients </td> <td> integer </td> <td> Controls the maximum client connections between the proxy and shards (default value is 10000) </td> </tr> <tr> <td> metrics_export_all </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Activates the exporter to expose all shard metrics </td> </tr> <tr> <td> mkms </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Activates multi-key multi-slot commands </td> </tr> <tr> <td> module_config_params </td> <td> string </td> <td> Configures module arguments at runtime. Enclose <code> module_config_params </code> within quotation marks. </td> </tr> <tr> <td> module_name </td> <td> <code> search </code> <br/> <code> ReJSON </code> <br/> <code> graph </code> <br/> <code> timeseries </code> <br/> <code> bf </code> <br/> <code> rg </code> </td> <td> The module to configure with <code> module_config_params </code> </td> </tr> <tr> <td> mtls_allow_outdated_cert </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Activates outdated certificates in mTLS connections </td> </tr> <tr> <td> mtls_allow_weak_hashing </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Activates weak hashing (less than 2048 bits) in mTLS connections </td> </tr> <tr> <td> oss_cluster </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Activates OSS cluster API </td> </tr> <tr> <td> oss_cluster_api_preferred_ip_type </td> <td> <code> internal </code> <br/> <code> external </code> </td> <td> IP type for the endpoint and database in the OSS cluster API (default is internal) </td> </tr> <tr> <td> repl_backlog </td> <td> size in MB <br/> <code> auto </code> </td> <td> Size of the replication buffer </td> </tr> <tr> <td> repl_diskless </td> <td> <code> enabled </code> <br/> <code> disabled </code> <br/> <code> default </code> </td> <td> Activates or deactivates diskless replication (defaults to the cluster setting) </td> </tr> <tr> <td> repl_timeout </td> <td> time in seconds </td> <td> Replication timeout (in seconds) </td> </tr> <tr> <td> resp3 </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Enables or deactivates RESP3 support (defaults to <code> enabled </code> ) </td> </tr> <tr> <td> schedpolicy </td> <td> <code> cmp </code> <br/> <code> mru </code> <br/> <code> spread </code> <br/> <code> mnp </code> </td> <td> Controls how server-side connections are used when forwarding traffic to shards </td> </tr> <tr> <td> skip_import_analyze </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Skips the analyzing step when importing a database </td> </tr> <tr> <td> slave_buffer </td> <td> <code> auto </code> <br/> value in MB <br/> hard:soft:time </td> <td> Redis replica output buffer limits <br/> β€’ <code> auto </code> : dynamically adjusts the buffer limit based on the shard’s current used memory <br/> β€’ value in MB: sets the buffer limit in MB <br/> β€’ hard:soft:time: sets the hard limit (maximum buffer size in MB), soft limit in MB, and the time in seconds that the soft limit can be exceeded </td> </tr> <tr> <td> slave_ha </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Activates or deactivates replica high availability (defaults to the cluster setting) </td> </tr> <tr> <td> slave_ha_priority </td> <td> integer </td> <td> Priority of the database in the replica high-availability mechanism </td> </tr> <tr> <td> syncer_mode </td> <td> <code> distributed </code> <br/> <code> centralized </code> </td> <td> Configures syncer to run in distributed or centralized mode. For distributed syncer, the DMC policy must be all-nodes or all-master-nodes </td> </tr> <tr> <td> syncer_monitoring </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Activates syncer monitoring </td> </tr> <tr> <td> tracking_table_max_keys </td> <td> integer </td> <td> The client-side caching invalidation table size. 0 makes the cache unlimited. </td> </tr> </tbody> </table> <table> <thead> <tr> <th> XADD behavior mode </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> liberal </td> <td> XADD succeeds with any valid ID (not recommended, allows duplicate IDs) </td> </tr> <tr> <td> semi-strict </td> <td> Allows a full ID. Partial IDs are completed with the unique database instance ID (not recommended, allows duplicate IDs). </td> </tr> <tr> <td> strict </td> <td> XADD fails if a full ID is given. Partial IDs are completed using the unique database instance ID. </td> </tr> </tbody> </table> <h3 id="returns-1"> Returns </h3> <p> Returns <code> Finished successfully </code> if the database configuration was changed. Otherwise, it returns an error. </p> <p> Use <a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/info/#info-db"> <code> rladmin info db </code> </a> to verify the database configuration was changed. </p> <h3 id="example-1"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin tune db db:4 repl_timeout <span class="m">300</span> </span></span><span class="line"><span class="cl">Tuning database: o </span></span><span class="line"><span class="cl">Finished successfully </span></span><span class="line"><span class="cl">$ rladmin info db db:4 <span class="p">|</span> grep repl_timeout </span></span><span class="line"><span class="cl"> repl_timeout: <span class="m">300</span> seconds </span></span></code></pre> </div> <h2 id="tune-node"> <code> tune node </code> </h2> <p> Configures node parameters. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">tune node <span class="o">{</span> &lt;id&gt; <span class="p">|</span> all <span class="o">}</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> max_listeners &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> max_redis_forks &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> max_redis_servers &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> max_slave_full_syncs &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> quorum_only <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span></code></pre> </div> <h3 id="parameters-2"> Parameters </h3> <table> <thead> <tr> <th> Parameter </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> id </td> <td> integer </td> <td> ID of the specified node </td> </tr> <tr> <td> all </td> <td> </td> <td> Configures settings for all nodes </td> </tr> <tr> <td> max_listeners </td> <td> integer </td> <td> Maximum number of endpoints that may be bound to the node </td> </tr> <tr> <td> max_redis_forks </td> <td> integer </td> <td> Maximum number of background processes forked from shards that may exist on the node at any given time </td> </tr> <tr> <td> max_redis_servers </td> <td> integer </td> <td> Maximum number of shards allowed to reside on the node </td> </tr> <tr> <td> max_slave_full_syncs </td> <td> integer </td> <td> Maximum number of simultaneous replica full-syncs that may be running at any given time (0: Unlimited, -1: Use cluster settings) </td> </tr> <tr> <td> quorum_only </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> If activated, configures the node as a <a href="/docs/latest/glossary/#letter-p"> quorum-only node </a> </td> </tr> </tbody> </table> <h3 id="returns-2"> Returns </h3> <p> Returns <code> Finished successfully </code> if the node configuration was changed. Otherwise, it returns an error. </p> <p> Use <a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/info/#info-node"> <code> rladmin info node </code> </a> to verify the node configuration was changed. </p> <h3 id="example-2"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin tune node <span class="m">3</span> max_redis_servers <span class="m">120</span> </span></span><span class="line"><span class="cl">Finished successfully </span></span><span class="line"><span class="cl">$ rladmin info node <span class="m">3</span> <span class="p">|</span> grep <span class="s2">"max redis servers"</span> </span></span><span class="line"><span class="cl"> max redis servers: <span class="m">120</span> </span></span></code></pre> </div> <h2 id="tune-proxy"> <code> tune proxy </code> </h2> <p> Configures proxy parameters. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune proxy <span class="o">{</span> &lt;id&gt; <span class="p">|</span> all <span class="o">}</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> mode <span class="o">{</span> static <span class="p">|</span> dynamic <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> threads &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> max_threads &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> scale_threshold &lt;value&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> scale_duration &lt;seconds&gt; <span class="o">]</span> </span></span></code></pre> </div> <h3 id="parameters-3"> Parameters </h3> <table> <thead> <tr> <th> Parameter </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> id </td> <td> integer </td> <td> ID of the specified proxy </td> </tr> <tr> <td> all </td> <td> </td> <td> Configures settings for all proxies </td> </tr> <tr> <td> max_threads </td> <td> integer, (range:Β 1-255) </td> <td> Maximum number of threads allowed </td> </tr> <tr> <td> mode </td> <td> <code> static </code> <br/> <code> dynamic </code> </td> <td> Determines if the proxy automatically adjusts the number of threads based on load size </td> </tr> <tr> <td> scale_duration </td> <td> time in seconds, (range:Β 10-300) </td> <td> Time of scale_threshold CPU utilization before the automatic proxy automatically scales </td> </tr> <tr> <td> scale_threshold </td> <td> percentage, (range:Β 50-99) </td> <td> CPU utilization threshold that triggers spawning new threads </td> </tr> <tr> <td> threads </td> <td> integer, (range:Β 1-255) </td> <td> Initial number of threads created at startup </td> </tr> </tbody> </table> <h3 id="returns-3"> Returns </h3> <p> Returns <code> OK </code> if the proxy configuration was changed. Otherwise, it returns an error. </p> <p> Use <a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/info/#info-proxy"> <code> rladmin info proxy </code> </a> to verify the proxy configuration was changed. </p> <h3 id="example-3"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin tune proxy <span class="m">2</span> scale_threshold <span class="m">75</span> </span></span><span class="line"><span class="cl">Configuring proxies: </span></span><span class="line"><span class="cl"> - proxy:2: ok </span></span><span class="line"><span class="cl">$ rladmin info proxy <span class="m">2</span> <span class="p">|</span> grep scale_threshold </span></span><span class="line"><span class="cl"> scale_threshold: <span class="m">75</span> <span class="o">(</span>%<span class="o">)</span> </span></span></code></pre> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/cli-utilities/rladmin/tune/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/security/audit-events/.html
<section class="prose w-full py-12 max-w-none"> <h1> Audit connection events </h1> <p class="text-lg -mt-5 mb-10"> Describes how to audit connection events. </p> <p> Starting with version 6.2.18, Redis Enterprise Software lets you audit database connection and authentication events. This helps you track and troubleshoot connection activity. </p> <p> The following events are tracked: </p> <ul> <li> Database connection attempts </li> <li> Authentication requests, including requests for new and existing connections </li> <li> Database disconnects </li> </ul> <p> When tracked events are triggered, notifications are sent via TCP to an address and port defined when auditing is enabled. Notifications appear in near real time and are intended to be consumed by an external listener, such as a TCP listener, third-party service, or related utility. </p> <p> For development and testing environments, notifications can be saved to a local file; however, this is neither supported nor intended for production environments. </p> <p> For performance reasons, auditing is not enabled by default. In addition, auditing occurs in the background (asynchronously) and is non-blocking by design. That is, the action that triggered the notification continues without regard to the status of the notification or the listening tool. </p> <h2 id="enable-audit-notifications"> Enable audit notifications </h2> <h3 id="cluster-audits"> Cluster audits </h3> <p> To enable auditing for your cluster, use: </p> <ul> <li> <p> <code> rladmin </code> </p> <pre tabindex="0"><code>rladmin cluster config auditing db_conns \ audit_protocol &lt;TCP|local&gt; \ audit_address &lt;address&gt; \ audit_port &lt;port&gt; \ audit_reconnect_interval &lt;interval in seconds&gt; \ audit_reconnect_max_attempts &lt;number of attempts&gt; </code></pre> <p> where: </p> <ul> <li> <p> <em> audit_protocol </em> indicates the protocol used to process notifications. For production systems, <em> TCP </em> is the only value. </p> </li> <li> <p> <em> audit_address </em> defines the TCP/IP address where one can listen for notifications </p> </li> <li> <p> <em> audit_port </em> defines the port where one can listen for notifications </p> </li> <li> <p> <em> audit_reconnect_interval </em> defines the interval (in seconds) between attempts to reconnect to the listener. Default is 1 second. </p> </li> <li> <p> <em> audit_reconnect_max_attempts </em> defines the maximum number of attempts to reconnect. Default is 0. (infinite) </p> </li> </ul> <p> Development systems can set <em> audit_protocol </em> to <code> local </code> for testing and training purposes; however, this setting is <em> not </em> supported for production use. </p> <p> When <code> audit_protocol </code> is set to <code> local </code> , <code> &lt;address&gt; </code> should be set to a <a href="https://man7.org/linux/man-pages/man7/unix.7.html"> stream socket </a> defined on the machine running Redis Enterprise and <em> <code> &lt;port&gt; </code> </em> should not be specified: </p> <pre tabindex="0"><code>rladmin cluster config auditing db_conns \ audit_protocol local audit_address &lt;output-file&gt; </code></pre> <p> The output file (and path) must be accessible by the user and group running Redis Enterprise Software. </p> </li> <li> <p> the <a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/cluster/auditing-db-conns/#put-cluster-audit-db-conns"> REST API </a> </p> <pre tabindex="0"><code>PUT /v1/cluster/auditing/db_conns { "audit_address": "&lt;address&gt;", "audit_port": &lt;port&gt;, "audit_protocol": "TCP", "audit_reconnect_interval": &lt;interval&gt;, "audit_reconnect_max_attempts": &lt;max attempts&gt; } </code></pre> <p> where <code> &lt;address&gt; </code> is a string containing the TCP/IP address, <code> &lt;port&gt; </code> is a numeric value representing the port, <code> &lt;interval&gt; </code> is a numeric value representing the interval in seconds, and <code> &lt;max attempts&gt; </code> is a numeric value representing the maximum number of attempts to execute. </p> </li> </ul> <h3 id="database-audits"> Database audits </h3> <p> Once auditing is enabled for your cluster, you can audit individual databases. To do so, use: </p> <ul> <li> <p> <code> rladmin </code> </p> <pre tabindex="0"><code>rladmin tune db db:&lt;id|name&gt; db_conns_auditing enabled </code></pre> <p> where the value of the <em> db: </em> parameter is either the cluster ID of the database or the database name. </p> <p> To deactivate auditing, set <code> db_conns_auditing </code> to <code> disabled </code> . </p> <p> Use <code> rladmin info </code> to retrieve additional details: </p> <pre tabindex="0"><code>rladmin info db &lt;id|name&gt; rladmin info cluster </code></pre> </li> <li> <p> the <a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/#put-bdbs"> REST API </a> </p> <pre tabindex="0"><code>PUT /v1/bdbs/1 { "db_conns_auditing": true } </code></pre> <p> To deactivate auditing, set <code> db_conns_auditing </code> to <code> false </code> . </p> </li> </ul> <p> You must enable auditing for your cluster before auditing a database; otherwise, an error appears: </p> <blockquote> <p> <em> Error setting description: Unable to enable DB Connections Auditing before feature configurations are set. <br/> Error setting error_code: db_conns_auditing_config_missing </em> </p> </blockquote> <p> To resolve this error, enable the protocol for your cluster <em> before </em> attempting to audit a database. </p> <h3 id="policy-defaults-for-new-databases"> Policy defaults for new databases </h3> <p> To audit connections for new databases by default, use: </p> <ul> <li> <p> <code> rladmin </code> </p> <pre tabindex="0"><code>rladmin tune cluster db_conns_auditing enabled </code></pre> <p> To deactivate this policy, set <code> db_conns_auditing </code> to <code> disabled </code> . </p> </li> <li> <p> the <a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/cluster/policy/#put-cluster-policy"> REST API </a> </p> <pre tabindex="0"><code>PUT /v1/cluster/policy { "db_conns_auditing": true } </code></pre> <p> To deactivate this policy, set <code> db_conns_auditing </code> to <code> false </code> . </p> </li> </ul> <h2 id="notification-examples"> Notification examples </h2> <p> Audit event notifications are reported as JSON objects. </p> <h3 id="new-connection"> New connection </h3> <p> This example reports a new connection for a database: </p> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"ts"</span><span class="p">:</span><span class="mi">1655821384</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"new_conn"</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"id"</span><span class="p">:</span><span class="mi">2285001002</span> <span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"srcip"</span><span class="p">:</span><span class="s2">"127.0.0.1"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"srcp"</span><span class="p">:</span><span class="s2">"39338"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"trgip"</span><span class="p">:</span><span class="s2">"127.0.0.1"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"trgp"</span><span class="p">:</span><span class="s2">"12635"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"hname"</span><span class="p">:</span><span class="s2">""</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"bdb_name"</span><span class="p">:</span><span class="s2">"DB1"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"bdb_uid"</span><span class="p">:</span><span class="s2">"5"</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <h3 id="authentication-request"> Authentication request </h3> <p> Here is a sample authentication request for a database: </p> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"ts"</span><span class="p">:</span><span class="mi">1655821384</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"action"</span><span class="p">:</span><span class="s2">"auth"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"id"</span><span class="p">:</span><span class="mi">2285001002</span> <span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"srcip"</span><span class="p">:</span><span class="s2">"127.0.0.1"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"srcp"</span><span class="p">:</span><span class="s2">"39338"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"trgip"</span><span class="p">:</span><span class="s2">"127.0.0.1"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"trgp"</span><span class="p">:</span><span class="s2">"12635"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"hname"</span><span class="p">:</span><span class="s2">""</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"bdb_name"</span><span class="p">:</span><span class="s2">"DB1"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"bdb_uid"</span><span class="p">:</span><span class="s2">"5"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"status"</span><span class="p">:</span><span class="mi">2</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"username"</span><span class="p">:</span><span class="s2">"user_one"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"identity"</span><span class="p">:</span><span class="s2">"user:1"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"acl-rules"</span><span class="p">:</span><span class="s2">"~* +@all"</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <p> The <code> status </code> field reports the following: </p> <ul> <li> <p> Values of 2, 7, or 8 indicate success. </p> </li> <li> <p> Values of 3 or 5 indicate that the client authentication is in progress and should conclude later. </p> </li> <li> <p> Other values indicate failures. </p> </li> </ul> <h3 id="database-disconnect"> Database disconnect </h3> <p> Here's what's reported when a database connection is closed: </p> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"ts"</span><span class="p">:</span><span class="mi">1655821384</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"close_conn"</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"id"</span><span class="p">:</span><span class="mi">2285001002</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"srcip"</span><span class="p">:</span><span class="s2">"127.0.0.1"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"srcp"</span><span class="p">:</span><span class="s2">"39338"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"trgip"</span><span class="p">:</span><span class="s2">"127.0.0.1"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"trgp"</span><span class="p">:</span><span class="s2">"12635"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"hname"</span><span class="p">:</span><span class="s2">""</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"bdb_name"</span><span class="p">:</span><span class="s2">"DB1"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"bdb_uid"</span><span class="p">:</span><span class="s2">"5"</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <h2 id="notification-field-reference"> Notification field reference </h2> <p> The field value that appears immediately after the timestamp describes the action that triggered the notification. The following values may appear: </p> <ul> <li> <code> new_conn </code> indicates a new external connection </li> <li> <code> new_int_conn </code> indicates a new internal connection </li> <li> <code> close_conn </code> occurs when a connection is closed </li> <li> <code> "action":"auth" </code> indicates an authentication request and can refer to new authentication requests or authorization checks on existing connections </li> </ul> <p> In addition, the following fields may also appear in audit event notifications: </p> <table> <thead> <tr> <th style="text-align:center"> FieldΒ name </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td style="text-align:center"> <code> acl-rules </code> </td> <td> ACL rules associated with the connection, which includes a rule for the <code> default </code> user. </td> </tr> <tr> <td style="text-align:center"> <code> bdb_name </code> </td> <td> Destination database name - The name of the database being accessed. </td> </tr> <tr> <td style="text-align:center"> <code> bdb_uid </code> </td> <td> Destination database ID - The cluster ID of the database being accessed. </td> </tr> <tr> <td style="text-align:center"> <code> hname </code> </td> <td> Client hostname - The hostname of the client. Currently empty; reserved for future use. </td> </tr> <tr> <td style="text-align:center"> <code> id </code> </td> <td> Connection ID - Unique connection ID assigned by the proxy. </td> </tr> <tr> <td style="text-align:center"> <code> identity </code> </td> <td> Identity - A unique ID the proxy assigned to the user for the current connection. </td> </tr> <tr> <td style="text-align:center"> <code> srcip </code> </td> <td> Source IP address - Source TCP/IP address of the client accessing the Redis database. </td> </tr> <tr> <td style="text-align:center"> <code> srcp </code> </td> <td> Source port - Port associated with the source IP address accessing the Redis database. Combine the port with the address to uniquely identify the socket. </td> </tr> <tr> <td style="text-align:center"> <code> status </code> </td> <td> Status result code - An integer representing the result of an authentication request. </td> </tr> <tr> <td style="text-align:center"> <code> trgip </code> </td> <td> Target IP address - The IP address of the destination being accessed by the action. </td> </tr> <tr> <td style="text-align:center"> <code> trgp </code> </td> <td> Target port - The port of the destination being accessed by the action. Combine the port with the destination IP address to uniquely identify the database being accessed. </td> </tr> <tr> <td style="text-align:center"> <code> ts </code> </td> <td> Timestamp - The date and time of the event, in <a href="https://en.wikipedia.org/wiki/Coordinated_Universal_Time"> Coordinated Universal Time </a> (UTC). Granularity is within one second. </td> </tr> <tr> <td style="text-align:center"> <code> username </code> </td> <td> Authentication username - Username associated with the connection; can include <code> default </code> for databases that allow default access. (Passwords are <em> not </em> recorded). </td> </tr> </tbody> </table> <h2 id="status-result-codes"> Status result codes </h2> <p> The <code> status </code> field reports the results of an authentication request as an integer. Here's what different values mean: </p> <table> <thead> <tr> <th style="text-align:center"> ErrorΒ value </th> <th> Error code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td style="text-align:center"> <code> 0 </code> </td> <td> AUTHENTICATION_FAILED </td> <td> Invalid username and/or password. </td> </tr> <tr> <td style="text-align:center"> <code> 1 </code> </td> <td> AUTHENTICATION_FAILED_TOO_LONG </td> <td> Username or password are too long. </td> </tr> <tr> <td style="text-align:center"> <code> 2 </code> </td> <td> AUTHENTICATION_NOT_REQUIRED </td> <td> Client tried to authenticate, but authentication isn't necessary. </td> </tr> <tr> <td style="text-align:center"> <code> 3 </code> </td> <td> AUTHENTICATION_DIRECTORY_PENDING </td> <td> Attempting to receive authentication info from the directory in async mode. </td> </tr> <tr> <td style="text-align:center"> <code> 4 </code> </td> <td> AUTHENTICATION_DIRECTORY_ERROR </td> <td> Authentication attempt failed because there was a directory connection error. </td> </tr> <tr> <td style="text-align:center"> <code> 5 </code> </td> <td> AUTHENTICATION_SYNCER_IN_PROGRESS </td> <td> Syncer SASL handshake. Return SASL response and wait for the next request. </td> </tr> <tr> <td style="text-align:center"> <code> 6 </code> </td> <td> AUTHENTICATION_SYNCER_FAILED </td> <td> Syncer SASL handshake. Returned SASL response and closed the connection. </td> </tr> <tr> <td style="text-align:center"> <code> 7 </code> </td> <td> AUTHENTICATION_SYNCER_OK </td> <td> Syncer authenticated. Returned SASL response. </td> </tr> <tr> <td style="text-align:center"> <code> 8 </code> </td> <td> AUTHENTICATION_OK </td> <td> Client successfully authenticated. </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/security/audit-events/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/develop/connect/clients/python/redis-vl/.html
<section class="prose w-full py-12"> <h1> Redis vector library guide (Python) </h1> <p class="text-lg -mt-5 mb-10"> Connect your Python vector application to a Redis vector database </p> <p> See the <a href="/docs/latest/integrate/redisvl/"> RedisVL Guide </a> for more information. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/clients/redis-vl/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/upgrade-module/.html
<section class="prose w-full py-12 max-w-none"> <h1> Upgrade modules </h1> <p> Upgrade a module in Redis Enterprise to get the latest features and fixes. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> <ul> <li> <p> If you upgrade a single-node cluster, it does not load the new modules that are bundled with the new cluster version. </p> </li> <li> <p> Before you upgrade a database with the RediSearch module enabled to Redis 5.0, you must upgrade the RediSearch module to version 1.4.2 or later. </p> </li> </ul> </div> </div> <h2 id="prerequisites"> Prerequisites </h2> <p> Before you upgrade a module enabled in a database, <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/add-module-to-cluster/"> install the new version of the module on the cluster </a> . </p> <h2 id="upgrade-a-module-for-a-database"> Upgrade a module for a database </h2> <p> After you install an updated module on the cluster, you can upgrade databases to use the new module version. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Warning: </div> After you upgrade the module for a database, the database shards restart. This causes a short interruption in the availability of this database across the cluster. </div> </div> <p> To upgrade a module enabled for a database: </p> <ol> <li> <p> Connect to the terminal of a node in the cluster. </p> </li> <li> <p> Run <code> rladmin status </code> to list the databases on the node. </p> </li> <li> <p> Copy the name of the database that uses the module that you want to upgrade. </p> <a href="/docs/latest/images/rs/rladmin_status.png" sdata-lightbox="/images/rs/rladmin_status.png"> <img src="/docs/latest/images/rs/rladmin_status.png"/> </a> </li> <li> <p> Find the exact module name and version: </p> <ol> <li> Extract the module archive (zip) file. </li> <li> Open the JSON file. </li> <li> Find the module name and version number in the file. </li> </ol> <p> Here's an example of the JSON file for the RediSearch module: </p> <a href="/docs/latest/images/rs/module_info.png" sdata-lightbox="/images/rs/module_info.png"> <img src="/docs/latest/images/rs/module_info.png"/> </a> </li> <li> <p> To see the versions of the modules on the cluster, run either: </p> <ul> <li> <code> rladmin status modules </code> - Shows the latest modules available on the cluster and the modules used by databases. </li> <li> <code> rladmin status modules all </code> - Shows all of the modules available on the cluster and the modules used by databases. </li> </ul> </li> <li> <p> To upgrade a database to the latest version of Redis and its modules to the latest version without changing the module arguments: </p> <ul> <li> <p> For clusters with Redis Enterprise Software versions 7.8.2 or later, run: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin upgrade db &lt; database_name <span class="p">|</span> database_ID &gt; </span></span></code></pre> </div> </li> <li> <p> For clusters with versions earlier than 7.8.2, include the <code> latest_with_modules </code> option: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin upgrade db &lt; database_name <span class="p">|</span> database_ID &gt; latest_with_modules </span></span></code></pre> </div> </li> </ul> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Warning: </div> The upgrade process does not validate the module upgrade arguments, and incorrect arguments can cause unexpected downtime. Test module upgrade commands in a test environment before you upgrade modules in production. </div> </div> <ul> <li> <p> Use <code> keep_redis_version </code> to upgrade the modules without upgrading the database to the latest Redis version. </p> <p> <code> keep_redis_version </code> is deprecated as of Redis Enterprise Software version 7.8.2. To upgrade modules without upgrading the Redis database version, set <code> redis_version </code> to the current Redis database version instead. </p> </li> <li> <p> To specify the modules to upgrade, add the following for each module: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">and module module_name &lt;module_name&gt; version &lt;new_module_version_number&gt; module_args <span class="s2">"&lt;module arguments&gt;"</span> </span></span></code></pre> </div> <p> For the module arguments, use one of the following: </p> <ul> <li> <p> <code> module_args "&lt;module_arguments&gt;" </code> to replace the existing module arguments. </p> </li> <li> <p> <code> module_args "" </code> without arguments to remove the existing module arguments. </p> </li> <li> <p> <code> module_args keep_args </code> to use the existing module arguments. </p> </li> </ul> </li> </ul> </li> </ol> <h2 id="examples-for-redis-software-v782-and-later"> Examples for Redis Software v7.8.2 and later </h2> <p> The following module upgrade examples are supported for Redis Enterprise Software versions 7.8.2 and later: </p> <ul> <li> <p> Keep the current Redis database version, which is 7.2 in this example, and upgrade to the latest version of the enabled modules: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin upgrade db shopping_cart redis_version 7.2 </span></span></code></pre> </div> </li> <li> <p> Upgrade the database to use the latest version of Redis and the latest versions of the enabled modules: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin upgrade db shopping_cart </span></span></code></pre> </div> </li> </ul> <h2 id="deprecated-examples"> Deprecated examples </h2> <p> As of Redis Enterprise Software version 7.8.2, the following module upgrade examples are deprecated but still supported. </p> <ul> <li> <p> Keep the current version of Redis and upgrade to the latest version of the enabled modules: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin upgrade db shopping_cart keep_redis_version latest_with_modules </span></span></code></pre> </div> </li> <li> <p> Upgrade the database to the latest Redis version and upgrade RediSearch to 1.6.7 with the specified arguments: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin upgrade db shopping_cart and module db_name shopping_cart module_name ft version <span class="m">10607</span> module_args <span class="s2">"PARTITIONS AUTO"</span> </span></span></code></pre> </div> </li> <li> <p> Upgrade the database to the latest Redis version and upgrade RedisBloom to version 2.2.1 without arguments: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin upgrade db db:3 and module db_name shopping_cart module_name bf version <span class="m">20201</span> module_args <span class="s2">""</span> </span></span></code></pre> </div> </li> <li> <p> Upgrade RedisJSON to 1.0.4 with the existing arguments and RedisBloom to version 2.2.1 without arguments: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin upgrade module db_name MyDB module_name ReJSON version <span class="m">10004</span> module_args keep_args and module db_name MyDB module_name bf version <span class="m">20201</span> module_args <span class="s2">""</span> </span></span></code></pre> </div> </li> <li> <p> Upgrade the database to use the latest version of Redis and use the latest version of the enabled modules: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin upgrade db shopping_cart latest_with_modules </span></span></code></pre> </div> </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/upgrade-module/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/develop/interact/search-and-query/indexing/.html
<section class="prose w-full py-12 max-w-none"> <h1> Indexing </h1> <p class="text-lg -mt-5 mb-10"> How to index and search JSON documents </p> <p> In addition to indexing Redis hashes, Redis Stack can also index JSON documents. </p> <h2 id="prerequisites"> Prerequisites </h2> <p> Before you can index and search JSON documents, you need a database with either: </p> <ul> <li> <a href="/docs/latest/operate/oss_and_stack/install/install-stack/"> Redis Stack </a> , which automatically includes JSON and searching and querying features </li> <li> Redis v6.x or later with the following modules installed and enabled: <ul> <li> RediSearch v2.2 or later </li> <li> RedisJSON v2.0 or later </li> </ul> </li> </ul> <h2 id="create-index-with-json-schema"> Create index with JSON schema </h2> <p> When you create an index with the <a href="/docs/latest/commands/ft.create/"> <code> FT.CREATE </code> </a> command, include the <code> ON JSON </code> keyword to index any existing and future JSON documents stored in the database. </p> <p> To define the <code> SCHEMA </code> , you can provide <a href="/docs/latest/develop/data-types/json/path/"> JSONPath </a> expressions. The result of each JSONPath expression is indexed and associated with a logical name called an <code> attribute </code> (previously known as a <code> field </code> ). You can use these attributes in queries. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> Note: <code> attribute </code> is optional for <a href="/docs/latest/commands/ft.create/"> <code> FT.CREATE </code> </a> . </div> </div> <p> Use the following syntax to create a JSON index: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="n">FT</span><span class="p">.</span><span class="k">CREATE</span><span class="w"> </span><span class="err">{</span><span class="n">index_name</span><span class="err">}</span><span class="w"> </span><span class="k">ON</span><span class="w"> </span><span class="n">JSON</span><span class="w"> </span><span class="k">SCHEMA</span><span class="w"> </span><span class="err">{</span><span class="n">json_path</span><span class="err">}</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="err">{</span><span class="n">attribute</span><span class="err">}</span><span class="w"> </span><span class="err">{</span><span class="k">type</span><span class="err">}</span><span class="w"> </span></span></span></code></pre> </div> <p> For example, this command creates an index that indexes the name, description, price, and image vector embedding of each JSON document that represents an inventory item: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">CREATE</span><span class="w"> </span><span class="n">itemIdx</span><span class="w"> </span><span class="k">ON</span><span class="w"> </span><span class="n">JSON</span><span class="w"> </span><span class="k">PREFIX</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="n">item</span><span class="p">:</span><span class="w"> </span><span class="k">SCHEMA</span><span class="w"> </span><span class="err">$</span><span class="p">.</span><span class="n">name</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="n">name</span><span class="w"> </span><span class="nb">TEXT</span><span class="w"> </span><span class="err">$</span><span class="p">.</span><span class="n">description</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="n">description</span><span class="w"> </span><span class="nb">TEXT</span><span class="w"> </span><span class="err">$</span><span class="p">.</span><span class="n">price</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="n">price</span><span class="w"> </span><span class="nb">NUMERIC</span><span class="w"> </span><span class="err">$</span><span class="p">.</span><span class="n">embedding</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="n">embedding</span><span class="w"> </span><span class="n">VECTOR</span><span class="w"> </span><span class="n">FLAT</span><span class="w"> </span><span class="mi">6</span><span class="w"> </span><span class="n">DIM</span><span class="w"> </span><span class="mi">4</span><span class="w"> </span><span class="n">DISTANCE_METRIC</span><span class="w"> </span><span class="n">L2</span><span class="w"> </span><span class="k">TYPE</span><span class="w"> </span><span class="n">FLOAT32</span><span class="w"> </span></span></span></code></pre> </div> <p> See <a href="#index-limitations"> Index limitations </a> for more details about JSON index <code> SCHEMA </code> restrictions. </p> <h2 id="add-json-documents"> Add JSON documents </h2> <p> After you create an index, Redis Stack automatically indexes any existing, modified, or newly created JSON documents stored in the database. For existing documents, indexing runs asynchronously in the background, so it can take some time before the document is available. Modified and newly created documents are indexed synchronously, so the document will be available by the time the add or modify command finishes. </p> <p> You can use any JSON write command, such as <a href="/docs/latest/commands/json.set/"> <code> JSON.SET </code> </a> and <a href="/docs/latest/commands/json.arrappend/"> <code> JSON.ARRAPPEND </code> </a> , to create or modify JSON documents. </p> <p> The following examples use these JSON documents to represent individual inventory items. </p> <p> Item 1 JSON document: </p> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"Noise-cancelling Bluetooth headphones"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"description"</span><span class="p">:</span> <span class="s2">"Wireless Bluetooth headphones with noise-cancelling technology"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"connection"</span><span class="p">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"wireless"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"type"</span><span class="p">:</span> <span class="s2">"Bluetooth"</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="nt">"price"</span><span class="p">:</span> <span class="mf">99.98</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"stock"</span><span class="p">:</span> <span class="mi">25</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"colors"</span><span class="p">:</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"black"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"silver"</span> </span></span><span class="line"><span class="cl"> <span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="nt">"embedding"</span><span class="p">:</span> <span class="p">[</span><span class="mf">0.87</span><span class="p">,</span> <span class="mf">-0.15</span><span class="p">,</span> <span class="mf">0.55</span><span class="p">,</span> <span class="mf">0.03</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <p> Item 2 JSON document: </p> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"Wireless earbuds"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"description"</span><span class="p">:</span> <span class="s2">"Wireless Bluetooth in-ear headphones"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"connection"</span><span class="p">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"wireless"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"type"</span><span class="p">:</span> <span class="s2">"Bluetooth"</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="nt">"price"</span><span class="p">:</span> <span class="mf">64.99</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"stock"</span><span class="p">:</span> <span class="mi">17</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"colors"</span><span class="p">:</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"black"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"white"</span> </span></span><span class="line"><span class="cl"> <span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="nt">"embedding"</span><span class="p">:</span> <span class="p">[</span><span class="mf">-0.7</span><span class="p">,</span> <span class="mf">-0.51</span><span class="p">,</span> <span class="mf">0.88</span><span class="p">,</span> <span class="mf">0.14</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <p> Use <a href="/docs/latest/commands/json.set/"> <code> JSON.SET </code> </a> to store these documents in the database: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">JSON</span><span class="p">.</span><span class="k">SET</span><span class="w"> </span><span class="n">item</span><span class="p">:</span><span class="mi">1</span><span class="w"> </span><span class="err">$</span><span class="w"> </span><span class="s1">'{"name":"Noise-cancelling Bluetooth headphones","description":"Wireless Bluetooth headphones with noise-cancelling technology","connection":{"wireless":true,"type":"Bluetooth"},"price":99.98,"stock":25,"colors":["black","silver"],"embedding":[0.87,-0.15,0.55,0.03]}'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="s2">"OK"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">JSON</span><span class="p">.</span><span class="k">SET</span><span class="w"> </span><span class="n">item</span><span class="p">:</span><span class="mi">2</span><span class="w"> </span><span class="err">$</span><span class="w"> </span><span class="s1">'{"name":"Wireless earbuds","description":"Wireless Bluetooth in-ear headphones","connection":{"wireless":true,"type":"Bluetooth"},"price":64.99,"stock":17,"colors":["black","white"],"embedding":[-0.7,-0.51,0.88,0.14]}'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="s2">"OK"</span><span class="w"> </span></span></span></code></pre> </div> <p> Because indexing is synchronous in this case, the documents will be available on the index as soon as the <a href="/docs/latest/commands/json.set/"> <code> JSON.SET </code> </a> command returns. Any subsequent queries that match the indexed content will return the document. </p> <h2 id="search-the-index"> Search the index </h2> <p> To search the index for JSON documents, use the <a href="/docs/latest/commands/ft.search/"> <code> FT.SEARCH </code> </a> command. You can search any attribute defined in the <code> SCHEMA </code> . </p> <p> For example, use this query to search for items with the word "earbuds" in the name: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">SEARCH</span><span class="w"> </span><span class="n">itemIdx</span><span class="w"> </span><span class="s1">'@name:(earbuds)'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"1"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"$"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"{\"</span><span class="n">name</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">earbuds</span><span class="err">\</span><span class="s2">",\"</span><span class="n">description</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="k">in</span><span class="o">-</span><span class="n">ear</span><span class="w"> </span><span class="n">headphones</span><span class="err">\</span><span class="s2">",\"</span><span class="k">connection</span><span class="err">\</span><span class="s2">":{\"</span><span class="n">wireless</span><span class="err">\</span><span class="s2">":true,\"</span><span class="k">connection</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Bluetooth</span><span class="err">\</span><span class="s2">"},\"</span><span class="n">price</span><span class="err">\</span><span class="s2">":64.99,\"</span><span class="n">stock</span><span class="err">\</span><span class="s2">":17,\"</span><span class="n">colors</span><span class="err">\</span><span class="s2">":[\"</span><span class="n">black</span><span class="err">\</span><span class="s2">",\"</span><span class="n">white</span><span class="err">\</span><span class="s2">"],\"</span><span class="n">embedding</span><span class="err">\</span><span class="s2">":[-0.7,-0.51,0.88,0.14]}"</span><span class="w"> </span></span></span></code></pre> </div> <p> This query searches for all items that include "bluetooth" and "headphones" in the description: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">SEARCH</span><span class="w"> </span><span class="n">itemIdx</span><span class="w"> </span><span class="s1">'@description:(bluetooth headphones)'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:1"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"$"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"{\"</span><span class="n">name</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Noise</span><span class="o">-</span><span class="n">cancelling</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="n">headphones</span><span class="err">\</span><span class="s2">",\"</span><span class="n">description</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="n">headphones</span><span class="w"> </span><span class="k">with</span><span class="w"> </span><span class="n">noise</span><span class="o">-</span><span class="n">cancelling</span><span class="w"> </span><span class="n">technology</span><span class="err">\</span><span class="s2">",\"</span><span class="k">connection</span><span class="err">\</span><span class="s2">":{\"</span><span class="n">wireless</span><span class="err">\</span><span class="s2">":true,\"</span><span class="k">type</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Bluetooth</span><span class="err">\</span><span class="s2">"},\"</span><span class="n">price</span><span class="err">\</span><span class="s2">":99.98,\"</span><span class="n">stock</span><span class="err">\</span><span class="s2">":25,\"</span><span class="n">colors</span><span class="err">\</span><span class="s2">":[\"</span><span class="n">black</span><span class="err">\</span><span class="s2">",\"</span><span class="n">silver</span><span class="err">\</span><span class="s2">"], \"</span><span class="n">embedding</span><span class="err">\</span><span class="s2">":[0.87,-0.15,0.55,0.03]}"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">5</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"$"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"{\"</span><span class="n">name</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">earbuds</span><span class="err">\</span><span class="s2">",\"</span><span class="n">description</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="k">in</span><span class="o">-</span><span class="n">ear</span><span class="w"> </span><span class="n">headphones</span><span class="err">\</span><span class="s2">",\"</span><span class="k">connection</span><span class="err">\</span><span class="s2">":{\"</span><span class="n">wireless</span><span class="err">\</span><span class="s2">":true,\"</span><span class="k">connection</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Bluetooth</span><span class="err">\</span><span class="s2">"},\"</span><span class="n">price</span><span class="err">\</span><span class="s2">":64.99,\"</span><span class="n">stock</span><span class="err">\</span><span class="s2">":17,\"</span><span class="n">colors</span><span class="err">\</span><span class="s2">":[\"</span><span class="n">black</span><span class="err">\</span><span class="s2">",\"</span><span class="n">white</span><span class="err">\</span><span class="s2">"],\"</span><span class="n">embedding</span><span class="err">\</span><span class="s2">":[-0.7,-0.51,0.88,0.14]}"</span><span class="w"> </span></span></span></code></pre> </div> <p> Now search for Bluetooth headphones with a price less than 70: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">SEARCH</span><span class="w"> </span><span class="n">itemIdx</span><span class="w"> </span><span class="s1">'@description:(bluetooth headphones) @price:[0 70]'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"1"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"$"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"{\"</span><span class="n">name</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">earbuds</span><span class="err">\</span><span class="s2">",\"</span><span class="n">description</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="k">in</span><span class="o">-</span><span class="n">ear</span><span class="w"> </span><span class="n">headphones</span><span class="err">\</span><span class="s2">",\"</span><span class="k">connection</span><span class="err">\</span><span class="s2">":{\"</span><span class="n">wireless</span><span class="err">\</span><span class="s2">":true,\"</span><span class="k">connection</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Bluetooth</span><span class="err">\</span><span class="s2">"},\"</span><span class="n">price</span><span class="err">\</span><span class="s2">":64.99,\"</span><span class="n">stock</span><span class="err">\</span><span class="s2">":17,\"</span><span class="n">colors</span><span class="err">\</span><span class="s2">":[\"</span><span class="n">black</span><span class="err">\</span><span class="s2">",\"</span><span class="n">white</span><span class="err">\</span><span class="s2">"],\"</span><span class="n">embedding</span><span class="err">\</span><span class="s2">":[-0.7,-0.51,0.88,0.14]}"</span><span class="w"> </span></span></span></code></pre> </div> <p> And lastly, search for the Bluetooth headphones that are most similar to an image whose embedding is [1.0, 1.0, 1.0, 1.0]: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">SEARCH</span><span class="w"> </span><span class="n">itemIdx</span><span class="w"> </span><span class="s1">'@description:(bluetooth headphones)=&gt;[KNN 2 @embedding $blob]'</span><span class="w"> </span><span class="n">PARAMS</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span><span class="nb">blob</span><span class="w"> </span><span class="err">\</span><span class="n">x01</span><span class="err">\</span><span class="n">x01</span><span class="err">\</span><span class="n">x01</span><span class="err">\</span><span class="n">x01</span><span class="w"> </span><span class="n">DIALECT</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:1"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"__embedding_score"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"1.08280003071"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"$"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"{\"</span><span class="n">name</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Noise</span><span class="o">-</span><span class="n">cancelling</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="n">headphones</span><span class="err">\</span><span class="s2">",\"</span><span class="n">description</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="n">headphones</span><span class="w"> </span><span class="k">with</span><span class="w"> </span><span class="n">noise</span><span class="o">-</span><span class="n">cancelling</span><span class="w"> </span><span class="n">technology</span><span class="err">\</span><span class="s2">",\"</span><span class="k">connection</span><span class="err">\</span><span class="s2">":{\"</span><span class="n">wireless</span><span class="err">\</span><span class="s2">":true,\"</span><span class="k">type</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Bluetooth</span><span class="err">\</span><span class="s2">"},\"</span><span class="n">price</span><span class="err">\</span><span class="s2">":99.98,\"</span><span class="n">stock</span><span class="err">\</span><span class="s2">":25,\"</span><span class="n">colors</span><span class="err">\</span><span class="s2">":[\"</span><span class="n">black</span><span class="err">\</span><span class="s2">",\"</span><span class="n">silver</span><span class="err">\</span><span class="s2">"],\"</span><span class="n">embedding</span><span class="err">\</span><span class="s2">":[0.87,-0.15,0.55,0.03]}"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"__embedding_score"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"1.54409992695"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="s2">"$"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"{\"</span><span class="n">name</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">earbuds</span><span class="err">\</span><span class="s2">",\"</span><span class="n">description</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="k">in</span><span class="o">-</span><span class="n">ear</span><span class="w"> </span><span class="n">headphones</span><span class="err">\</span><span class="s2">",\"</span><span class="k">connection</span><span class="err">\</span><span class="s2">":{\"</span><span class="n">wireless</span><span class="err">\</span><span class="s2">":true,\"</span><span class="k">connection</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Bluetooth</span><span class="err">\</span><span class="s2">"},\"</span><span class="n">price</span><span class="err">\</span><span class="s2">":64.99,\"</span><span class="n">stock</span><span class="err">\</span><span class="s2">":17,\"</span><span class="n">colors</span><span class="err">\</span><span class="s2">":[\"</span><span class="n">black</span><span class="err">\</span><span class="s2">",\"</span><span class="n">white</span><span class="err">\</span><span class="s2">"],\"</span><span class="n">embedding</span><span class="err">\</span><span class="s2">":[-0.7,-0.51,0.88,0.14]}"</span><span class="w"> </span></span></span></code></pre> </div> <p> For more information about search queries, see <a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/query_syntax/"> Search query syntax </a> . </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> <a href="/docs/latest/commands/ft.search/"> <code> FT.SEARCH </code> </a> queries require <code> attribute </code> modifiers. Don't use JSONPath expressions in queries because the query parser doesn't fully support them. </div> </div> <h2 id="index-json-arrays-as-tag"> Index JSON arrays as TAG </h2> <p> The preferred method for indexing a JSON field with multivalued terms is using JSON arrays. Each value of the array is indexed, and those values must be scalars. If you want to index string or boolean values as TAGs within a JSON array, use the <a href="/docs/latest/develop/data-types/json/path/"> JSONPath </a> wildcard operator. </p> <p> To index an item's list of available colors, specify the JSONPath <code> $.colors.* </code> in the <code> SCHEMA </code> definition during index creation: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">CREATE</span><span class="w"> </span><span class="n">itemIdx2</span><span class="w"> </span><span class="k">ON</span><span class="w"> </span><span class="n">JSON</span><span class="w"> </span><span class="k">PREFIX</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="n">item</span><span class="p">:</span><span class="w"> </span><span class="k">SCHEMA</span><span class="w"> </span><span class="err">$</span><span class="p">.</span><span class="n">colors</span><span class="p">.</span><span class="o">*</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="n">colors</span><span class="w"> </span><span class="n">TAG</span><span class="w"> </span><span class="err">$</span><span class="p">.</span><span class="n">name</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="n">name</span><span class="w"> </span><span class="nb">TEXT</span><span class="w"> </span><span class="err">$</span><span class="p">.</span><span class="n">description</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="n">description</span><span class="w"> </span><span class="nb">TEXT</span><span class="w"> </span></span></span></code></pre> </div> <p> Now you can search for silver headphones: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">SEARCH</span><span class="w"> </span><span class="n">itemIdx2</span><span class="w"> </span><span class="s2">"@colors:{silver} (@name:(headphones)|@description:(headphones))"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"1"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:1"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"$"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"{\"</span><span class="n">name</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Noise</span><span class="o">-</span><span class="n">cancelling</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="n">headphones</span><span class="err">\</span><span class="s2">",\"</span><span class="n">description</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="n">headphones</span><span class="w"> </span><span class="k">with</span><span class="w"> </span><span class="n">noise</span><span class="o">-</span><span class="n">cancelling</span><span class="w"> </span><span class="n">technology</span><span class="err">\</span><span class="s2">",\"</span><span class="k">connection</span><span class="err">\</span><span class="s2">":{\"</span><span class="n">wireless</span><span class="err">\</span><span class="s2">":true,\"</span><span class="k">type</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Bluetooth</span><span class="err">\</span><span class="s2">"},\"</span><span class="n">price</span><span class="err">\</span><span class="s2">":99.98,\"</span><span class="n">stock</span><span class="err">\</span><span class="s2">":25,\"</span><span class="n">colors</span><span class="err">\</span><span class="s2">":[\"</span><span class="n">black</span><span class="err">\</span><span class="s2">",\"</span><span class="n">silver</span><span class="err">\</span><span class="s2">"]}"</span><span class="w"> </span></span></span></code></pre> </div> <h2 id="index-json-arrays-as-text"> Index JSON arrays as TEXT </h2> <p> Starting with RediSearch v2.6.0, full text search can be done on an array of strings or on a JSONPath leading to multiple strings. </p> <p> If you want to index multiple string values as TEXT, use either a JSONPath leading to a single array of strings, or a JSONPath leading to multiple string values, using JSONPath operators such as wildcard, filter, union, array slice, and/or recursive descent. </p> <p> To index an item's list of available colors, specify the JSONPath <code> $.colors </code> in the <code> SCHEMA </code> definition during index creation: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">CREATE</span><span class="w"> </span><span class="n">itemIdx3</span><span class="w"> </span><span class="k">ON</span><span class="w"> </span><span class="n">JSON</span><span class="w"> </span><span class="k">PREFIX</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="n">item</span><span class="p">:</span><span class="w"> </span><span class="k">SCHEMA</span><span class="w"> </span><span class="err">$</span><span class="p">.</span><span class="n">colors</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="n">colors</span><span class="w"> </span><span class="nb">TEXT</span><span class="w"> </span><span class="err">$</span><span class="p">.</span><span class="n">name</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="n">name</span><span class="w"> </span><span class="nb">TEXT</span><span class="w"> </span><span class="err">$</span><span class="p">.</span><span class="n">description</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="n">description</span><span class="w"> </span><span class="nb">TEXT</span><span class="w"> </span></span></span></code></pre> </div> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">JSON</span><span class="p">.</span><span class="k">SET</span><span class="w"> </span><span class="n">item</span><span class="p">:</span><span class="mi">3</span><span class="w"> </span><span class="err">$</span><span class="w"> </span><span class="s1">'{"name":"True Wireless earbuds","description":"True Wireless Bluetooth in-ear headphones","connection":{"wireless":true,"type":"Bluetooth"},"price":74.99,"stock":20,"colors":["red","light blue"]}'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="s2">"OK"</span><span class="w"> </span></span></span></code></pre> </div> <p> Now you can do full text search for light colored headphones: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">SEARCH</span><span class="w"> </span><span class="n">itemIdx3</span><span class="w"> </span><span class="s1">'@colors:(white|light) (@name|description:(headphones))'</span><span class="w"> </span><span class="k">RETURN</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="err">$</span><span class="p">.</span><span class="n">colors</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="p">(</span><span class="nb">integer</span><span class="p">)</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"$.colors"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"[\"</span><span class="n">black</span><span class="err">\</span><span class="s2">",\"</span><span class="n">white</span><span class="err">\</span><span class="s2">"]"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:3"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">5</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"$.colors"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"[\"</span><span class="n">red</span><span class="err">\</span><span class="s2">",\"</span><span class="n">light</span><span class="w"> </span><span class="n">blue</span><span class="err">\</span><span class="s2">"]"</span><span class="w"> </span></span></span></code></pre> </div> <h3 id="limitations"> Limitations </h3> <ul> <li> <p> When a JSONPath may lead to multiple values and not only to a single array, e.g., when a JSONPath contains wildcards, etc., specifying <code> SLOP </code> or <code> INORDER </code> in <a href="/docs/latest/commands/ft.search/"> <code> FT.SEARCH </code> </a> will return an error, since the order of the values matching the JSONPath is not well defined, leading to potentially inconsistent results. </p> <p> For example, using a JSONPath such as <code> $..b[*] </code> on a JSON value such as </p> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"a"</span><span class="p">:</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="nt">"b"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"first first"</span><span class="p">,</span> <span class="s2">"first second"</span><span class="p">]},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="nt">"c"</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="nt">"b"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"second first"</span><span class="p">,</span> <span class="s2">"second second"</span><span class="p">]}},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="nt">"b"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"third first"</span><span class="p">,</span> <span class="s2">"third second"</span><span class="p">]}</span> </span></span><span class="line"><span class="cl"> <span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <p> may match values in various orderings, depending on the specific implementation of the JSONPath library being used. </p> <p> Since <code> SLOP </code> and <code> INORDER </code> consider relative ordering among the indexed values, and results may change in future releases, an error will be returned. </p> </li> <li> <p> When JSONPath leads to multiple values: </p> <ul> <li> String values are indexed </li> <li> <code> null </code> values are skipped </li> <li> Any other value type will cause an indexing failure </li> </ul> </li> <li> <p> <code> SORTBY </code> only sorts by the first value </p> </li> <li> <p> No <code> HIGHLIGHT </code> and <code> SUMMARIZE </code> support </p> </li> <li> <p> <code> RETURN </code> of a Schema attribute, whose JSONPath leads to multiple values, returns only the first value (as a JSON String) </p> </li> <li> <p> If a JSONPath is specified by the <code> RETURN </code> , instead of a Schema attribute, all values are returned (as a JSON String) </p> </li> </ul> <h3 id="handling-phrases-in-different-array-slots"> Handling phrases in different array slots: </h3> <p> When indexing, a predefined delta is used to increase positional offsets between array slots for multiple text values. This delta controls the level of separation between phrases in different array slots (related to the <code> SLOP </code> parameter of <a href="/docs/latest/commands/ft.search/"> <code> FT.SEARCH </code> </a> ). This predefined value is set by the configuration parameter <code> MULTI_TEXT_SLOP </code> (at module load-time). The default value is 100. </p> <h2 id="index-json-arrays-as-numeric"> Index JSON arrays as NUMERIC </h2> <p> Starting with RediSearch v2.6.1, search can be done on an array of numerical values or on a JSONPath leading to multiple numerical values. </p> <p> If you want to index multiple numerical values as NUMERIC, use either a JSONPath leading to a single array of numbers, or a JSONPath leading to multiple numbers, using JSONPath operators such as wildcard, filter, union, array slice, and/or recursive descent. </p> <p> For example, add to the item's list the available <code> max_level </code> of volume (in decibels): </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">JSON</span><span class="p">.</span><span class="k">SET</span><span class="w"> </span><span class="n">item</span><span class="p">:</span><span class="mi">1</span><span class="w"> </span><span class="err">$</span><span class="w"> </span><span class="s1">'{"name":"Noise-cancelling Bluetooth headphones","description":"Wireless Bluetooth headphones with noise-cancelling technology","connection":{"wireless":true,"type":"Bluetooth"},"price":99.98,"stock":25,"colors":["black","silver"], "max_level":[60, 70, 80, 90, 100]}'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="n">OK</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">JSON</span><span class="p">.</span><span class="k">SET</span><span class="w"> </span><span class="n">item</span><span class="p">:</span><span class="mi">2</span><span class="w"> </span><span class="err">$</span><span class="w"> </span><span class="s1">'{"name":"Wireless earbuds","description":"Wireless Bluetooth in-ear headphones","connection":{"wireless":true,"type":"Bluetooth"},"price":64.99,"stock":17,"colors":["black","white"], "max_level":[80, 100, 120]}'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="n">OK</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">JSON</span><span class="p">.</span><span class="k">SET</span><span class="w"> </span><span class="n">item</span><span class="p">:</span><span class="mi">3</span><span class="w"> </span><span class="err">$</span><span class="w"> </span><span class="s1">'{"name":"True Wireless earbuds","description":"True Wireless Bluetooth in-ear headphones","connection":{"wireless":true,"type":"Bluetooth"},"price":74.99,"stock":20,"colors":["red","light blue"], "max_level":[90, 100, 110, 120]}'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="n">OK</span><span class="w"> </span></span></span></code></pre> </div> <p> To index the <code> max_level </code> array, specify the JSONPath <code> $.max_level </code> in the <code> SCHEMA </code> definition during index creation: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">CREATE</span><span class="w"> </span><span class="n">itemIdx4</span><span class="w"> </span><span class="k">ON</span><span class="w"> </span><span class="n">JSON</span><span class="w"> </span><span class="k">PREFIX</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="n">item</span><span class="p">:</span><span class="w"> </span><span class="k">SCHEMA</span><span class="w"> </span><span class="err">$</span><span class="p">.</span><span class="n">max_level</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="n">dB</span><span class="w"> </span><span class="nb">NUMERIC</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="n">OK</span><span class="w"> </span></span></span></code></pre> </div> <p> You can now search for headphones with specific max volume levels, for example, between 70 and 80 (inclusive), returning items with at least one value in their <code> max_level </code> array, which is in the requested range: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">SEARCH</span><span class="w"> </span><span class="n">itemIdx4</span><span class="w"> </span><span class="s1">'@dB:[70 80]'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="p">(</span><span class="nb">integer</span><span class="p">)</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:1"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"$"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"{\"</span><span class="n">name</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Noise</span><span class="o">-</span><span class="n">cancelling</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="n">headphones</span><span class="err">\</span><span class="s2">",\"</span><span class="n">description</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="n">headphones</span><span class="w"> </span><span class="k">with</span><span class="w"> </span><span class="n">noise</span><span class="o">-</span><span class="n">cancelling</span><span class="w"> </span><span class="n">technology</span><span class="err">\</span><span class="s2">",\"</span><span class="k">connection</span><span class="err">\</span><span class="s2">":{\"</span><span class="n">wireless</span><span class="err">\</span><span class="s2">":true,\"</span><span class="k">type</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Bluetooth</span><span class="err">\</span><span class="s2">"},\"</span><span class="n">price</span><span class="err">\</span><span class="s2">":99.98,\"</span><span class="n">stock</span><span class="err">\</span><span class="s2">":25,\"</span><span class="n">colors</span><span class="err">\</span><span class="s2">":[\"</span><span class="n">black</span><span class="err">\</span><span class="s2">",\"</span><span class="n">silver</span><span class="err">\</span><span class="s2">"],\"</span><span class="n">max_level</span><span class="err">\</span><span class="s2">":[60,70,80,90,100]}"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">5</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"$"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"{\"</span><span class="n">name</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">earbuds</span><span class="err">\</span><span class="s2">",\"</span><span class="n">description</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="k">in</span><span class="o">-</span><span class="n">ear</span><span class="w"> </span><span class="n">headphones</span><span class="err">\</span><span class="s2">",\"</span><span class="k">connection</span><span class="err">\</span><span class="s2">":{\"</span><span class="n">wireless</span><span class="err">\</span><span class="s2">":true,\"</span><span class="k">type</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Bluetooth</span><span class="err">\</span><span class="s2">"},\"</span><span class="n">price</span><span class="err">\</span><span class="s2">":64.99,\"</span><span class="n">stock</span><span class="err">\</span><span class="s2">":17,\"</span><span class="n">colors</span><span class="err">\</span><span class="s2">":[\"</span><span class="n">black</span><span class="err">\</span><span class="s2">",\"</span><span class="n">white</span><span class="err">\</span><span class="s2">"],\"</span><span class="n">max_level</span><span class="err">\</span><span class="s2">":[80,100,120]}"</span><span class="w"> </span></span></span></code></pre> </div> <p> You can also search for items with all values in a specific range. For example, all values are in the range [90, 120] (inclusive): </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">SEARCH</span><span class="w"> </span><span class="n">itemIdx4</span><span class="w"> </span><span class="s1">'-@dB:[-inf (90] -@dB:[(120 +inf]'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="p">(</span><span class="nb">integer</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:3"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"$"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"{\"</span><span class="n">name</span><span class="err">\</span><span class="s2">":\"</span><span class="k">True</span><span class="w"> </span><span class="n">Wireless</span><span class="w"> </span><span class="n">earbuds</span><span class="err">\</span><span class="s2">",\"</span><span class="n">description</span><span class="err">\</span><span class="s2">":\"</span><span class="k">True</span><span class="w"> </span><span class="n">Wireless</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="k">in</span><span class="o">-</span><span class="n">ear</span><span class="w"> </span><span class="n">headphones</span><span class="err">\</span><span class="s2">",\"</span><span class="k">connection</span><span class="err">\</span><span class="s2">":{\"</span><span class="n">wireless</span><span class="err">\</span><span class="s2">":true,\"</span><span class="k">type</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Bluetooth</span><span class="err">\</span><span class="s2">"},\"</span><span class="n">price</span><span class="err">\</span><span class="s2">":74.99,\"</span><span class="n">stock</span><span class="err">\</span><span class="s2">":20,\"</span><span class="n">colors</span><span class="err">\</span><span class="s2">":[\"</span><span class="n">red</span><span class="err">\</span><span class="s2">",\"</span><span class="n">light</span><span class="w"> </span><span class="n">blue</span><span class="err">\</span><span class="s2">"],\"</span><span class="n">max_level</span><span class="err">\</span><span class="s2">":[90,100,110,120]}"</span><span class="w"> </span></span></span></code></pre> </div> <h3 id="limitations-1"> Limitations </h3> <p> When JSONPath leads to multiple numerical values: </p> <ul> <li> Numerical values are indexed </li> <li> <code> null </code> values are skipped </li> <li> Any other value type will cause an indexing failure </li> </ul> <h2 id="index-json-arrays-as-geo"> Index JSON arrays as GEO </h2> <p> Starting with RediSearch v2.6.1, search can be done on an array of geo (geographical) values or on a JSONPath leading to multiple geo values. </p> <p> Prior to RediSearch v2.6.1, only a single geo value was supported per GEO attribute. The geo value was specified using a comma delimited string in the form "longitude,latitude". For example, "15.447083,78.238306". </p> <p> With RediSearch v2.6.1, a JSON array of such geo values is also supported. </p> <p> In order to index multiple geo values, user either a JSONPath leading to a single array of geo values, or a JSONPath leading to multiple geo values, using JSONPath operators such as wildcard, filter, union, array slice, and/or recursive descent. </p> <ul> <li> <code> null </code> values are skipped </li> <li> Other values will cause an indexing failure (bool, number, object, array, wrongly formatted GEO string, invalid coordinates) </li> </ul> <p> For example, add to the item's list the <code> vendor_id </code> , that is, where an item can be physically purchased: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">JSON</span><span class="p">.</span><span class="k">SET</span><span class="w"> </span><span class="n">item</span><span class="p">:</span><span class="mi">1</span><span class="w"> </span><span class="err">$</span><span class="w"> </span><span class="s1">'{"name":"Noise-cancelling Bluetooth headphones","description":"Wireless Bluetooth headphones with noise-cancelling technology","connection":{"wireless":true,"type":"Bluetooth"},"price":99.98,"stock":25,"colors":["black","silver"], "max_level":[60, 70, 80, 90, 100], "vendor_id": [100,300]}'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="n">OK</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">JSON</span><span class="p">.</span><span class="k">SET</span><span class="w"> </span><span class="n">item</span><span class="p">:</span><span class="mi">2</span><span class="w"> </span><span class="err">$</span><span class="w"> </span><span class="s1">'{"name":"Wireless earbuds","description":"Wireless Bluetooth in-ear headphones","connection":{"wireless":true,"type":"Bluetooth"},"price":64.99,"stock":17,"colors":["black","white"], "max_level":[80, 100, 120], "vendor_id": [100,200]}'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="n">OK</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">JSON</span><span class="p">.</span><span class="k">SET</span><span class="w"> </span><span class="n">item</span><span class="p">:</span><span class="mi">3</span><span class="w"> </span><span class="err">$</span><span class="w"> </span><span class="s1">'{"name":"True Wireless earbuds","description":"True Wireless Bluetooth in-ear headphones","connection":{"wireless":true,"type":"Bluetooth"},"price":74.99,"stock":20,"colors":["red","light blue"], "max_level":[90, 100, 110, 120], "vendor_id": [100]}'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="n">OK</span><span class="w"> </span></span></span></code></pre> </div> <p> Now add some vendors with their geographic locations: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">JSON</span><span class="p">.</span><span class="k">SET</span><span class="w"> </span><span class="n">vendor</span><span class="p">:</span><span class="mi">1</span><span class="w"> </span><span class="err">$</span><span class="w"> </span><span class="s1">'{"id":100, "name":"Kwik-E-Mart", "location":["35.213,31.785", "35.178,31.768", "35.827,31.984"]}'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="n">OK</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">JSON</span><span class="p">.</span><span class="k">SET</span><span class="w"> </span><span class="n">vendor</span><span class="p">:</span><span class="mi">2</span><span class="w"> </span><span class="err">$</span><span class="w"> </span><span class="s1">'{"id":200, "name":"Cypress Creek", "location":["34.638,31.79", "34.639,31.793"]}'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="n">OK</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">JSON</span><span class="p">.</span><span class="k">SET</span><span class="w"> </span><span class="n">vendor</span><span class="p">:</span><span class="mi">3</span><span class="w"> </span><span class="err">$</span><span class="w"> </span><span class="s1">'{"id":300, "name":"Barneys", "location":["34.648,31.817", "34.638,31.806", "34.65,31.785"]}'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="n">OK</span><span class="w"> </span></span></span></code></pre> </div> <p> To index the <code> vendor_id </code> numeric array, specify the JSONPath <code> $.vendor_id </code> in the <code> SCHEMA </code> definition during index creation: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">CREATE</span><span class="w"> </span><span class="n">itemIdx5</span><span class="w"> </span><span class="k">ON</span><span class="w"> </span><span class="n">JSON</span><span class="w"> </span><span class="k">PREFIX</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="n">item</span><span class="p">:</span><span class="w"> </span><span class="k">SCHEMA</span><span class="w"> </span><span class="err">$</span><span class="p">.</span><span class="n">vendor_id</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="n">vid</span><span class="w"> </span><span class="nb">NUMERIC</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="n">OK</span><span class="w"> </span></span></span></code></pre> </div> <p> To index the <code> location </code> geo array, specify the JSONPath <code> $.location </code> in the <code> SCHEMA </code> definition during index creation: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">CREATE</span><span class="w"> </span><span class="n">vendorIdx</span><span class="w"> </span><span class="k">ON</span><span class="w"> </span><span class="n">JSON</span><span class="w"> </span><span class="k">PREFIX</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="n">vendor</span><span class="p">:</span><span class="w"> </span><span class="k">SCHEMA</span><span class="w"> </span><span class="err">$</span><span class="p">.</span><span class="k">location</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="n">loc</span><span class="w"> </span><span class="n">GEO</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="n">OK</span><span class="w"> </span></span></span></code></pre> </div> <p> Now search for a vendor close to a specific location. For example, a customer is located at geo coordinates 34.5,31.5 and you want to get the vendors that are within the range of 40 km from our location: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">SEARCH</span><span class="w"> </span><span class="n">vendorIdx</span><span class="w"> </span><span class="s1">'@loc:[34.5 31.5 40 km]'</span><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="err">$</span><span class="p">.</span><span class="n">id</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="p">(</span><span class="nb">integer</span><span class="p">)</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"vendor:2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"$.id"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"200"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"vendor:3"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">5</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"$.id"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"300"</span><span class="w"> </span></span></span></code></pre> </div> <p> Now look for products offered by these vendors: </p> <pre tabindex="0"><code>127.0.0.1:6379&gt; FT.SEARCH itemIdx5 '@vid:[200 300]' 1) (integer) 2 2) "item:2" 3) 1) "$" 2) "{\"name\":\"Wireless earbuds\",\"description\":\"Wireless Bluetooth in-ear headphones\",\"connection\":{\"wireless\":true,\"type\":\"Bluetooth\"},\"price\":64.99,\"stock\":17,\"colors\":[\"black\",\"white\"],\"max_level\":[80,100,120],\"vendor_id\":[100,200]}" 4) "item:1" 5) 1) "$" 2) "{\"name\":\"Noise-cancelling Bluetooth headphones\",\"description\":\"Wireless Bluetooth headphones with noise-cancelling technology\",\"connection\":{\"wireless\":true,\"type\":\"Bluetooth\"},\"price\":99.98,\"stock\":25,\"colors\":[\"black\",\"silver\"],\"max_level\":[60,70,80,90,100],\"vendor_id\":[100,300]}" </code></pre> <h2 id="index-json-arrays-as-vector"> Index JSON arrays as VECTOR </h2> <p> Starting with RediSearch 2.6.0, you can index a JSONPath leading to an array of numeric values as a VECTOR type in the index schema. </p> <p> For example, assume that your JSON items include an array of vector embeddings, where each vector represents an image of a product. To index these vectors, specify the JSONPath <code> $.embedding </code> in the schema definition during index creation: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">CREATE</span><span class="w"> </span><span class="n">itemIdx5</span><span class="w"> </span><span class="k">ON</span><span class="w"> </span><span class="n">JSON</span><span class="w"> </span><span class="k">PREFIX</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="n">item</span><span class="p">:</span><span class="w"> </span><span class="k">SCHEMA</span><span class="w"> </span><span class="err">$</span><span class="p">.</span><span class="n">embedding</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="n">embedding</span><span class="w"> </span><span class="n">VECTOR</span><span class="w"> </span><span class="n">FLAT</span><span class="w"> </span><span class="mi">6</span><span class="w"> </span><span class="n">DIM</span><span class="w"> </span><span class="mi">4</span><span class="w"> </span><span class="n">DISTANCE_METRIC</span><span class="w"> </span><span class="n">L2</span><span class="w"> </span><span class="k">TYPE</span><span class="w"> </span><span class="n">FLOAT32</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="n">OK</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">JSON</span><span class="p">.</span><span class="k">SET</span><span class="w"> </span><span class="n">item</span><span class="p">:</span><span class="mi">1</span><span class="w"> </span><span class="err">$</span><span class="w"> </span><span class="s1">'{"name":"Noise-cancelling Bluetooth headphones","description":"Wireless Bluetooth headphones with noise-cancelling technology","price":99.98,"stock":25,"colors":["black","silver"],"embedding":[0.87,-0.15,0.55,0.03]}'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="n">OK</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">JSON</span><span class="p">.</span><span class="k">SET</span><span class="w"> </span><span class="n">item</span><span class="p">:</span><span class="mi">2</span><span class="w"> </span><span class="err">$</span><span class="w"> </span><span class="s1">'{"name":"Wireless earbuds","description":"Wireless Bluetooth in-ear headphones","price":64.99,"stock":17,"colors":["black","white"],"embedding":[-0.7,-0.51,0.88,0.14]}'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="n">OK</span><span class="w"> </span></span></span></code></pre> </div> <p> Now you can search for the two headphones that are most similar to the image embedding by using vector search KNN query. (Note that the vector queries are supported as of dialect 2.) For example: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">SEARCH</span><span class="w"> </span><span class="n">itemIdx5</span><span class="w"> </span><span class="s1">'*=&gt;[KNN 2 @embedding $blob AS dist]'</span><span class="w"> </span><span class="n">SORTBY</span><span class="w"> </span><span class="n">dist</span><span class="w"> </span><span class="n">PARAMS</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span><span class="nb">blob</span><span class="w"> </span><span class="err">\</span><span class="n">x01</span><span class="err">\</span><span class="n">x01</span><span class="err">\</span><span class="n">x01</span><span class="err">\</span><span class="n">x01</span><span class="w"> </span><span class="n">DIALECT</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="p">(</span><span class="nb">integer</span><span class="p">)</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:1"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"dist"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"1.08280003071"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="s2">"$"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"{\"</span><span class="n">name</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Noise</span><span class="o">-</span><span class="n">cancelling</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="n">headphones</span><span class="err">\</span><span class="s2">",\"</span><span class="n">description</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="n">headphones</span><span class="w"> </span><span class="k">with</span><span class="w"> </span><span class="n">noise</span><span class="o">-</span><span class="n">cancelling</span><span class="w"> </span><span class="n">technology</span><span class="err">\</span><span class="s2">",\"</span><span class="n">price</span><span class="err">\</span><span class="s2">":99.98,\"</span><span class="n">stock</span><span class="err">\</span><span class="s2">":25,\"</span><span class="n">colors</span><span class="err">\</span><span class="s2">":[\"</span><span class="n">black</span><span class="err">\</span><span class="s2">",\"</span><span class="n">silver</span><span class="err">\</span><span class="s2">"],\"</span><span class="n">embedding</span><span class="err">\</span><span class="s2">":[0.87,-0.15,0.55,0.03]}"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">5</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"dist"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"1.54409992695"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="s2">"$"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"{\"</span><span class="n">name</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">earbuds</span><span class="err">\</span><span class="s2">",\"</span><span class="n">description</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="k">in</span><span class="o">-</span><span class="n">ear</span><span class="w"> </span><span class="n">headphones</span><span class="err">\</span><span class="s2">",\"</span><span class="n">price</span><span class="err">\</span><span class="s2">":64.99,\"</span><span class="n">stock</span><span class="err">\</span><span class="s2">":17,\"</span><span class="n">colors</span><span class="err">\</span><span class="s2">":[\"</span><span class="n">black</span><span class="err">\</span><span class="s2">",\"</span><span class="n">white</span><span class="err">\</span><span class="s2">"],\"</span><span class="n">embedding</span><span class="err">\</span><span class="s2">":[-0.7,-0.51,0.88,0.14]}"</span><span class="w"> </span></span></span></code></pre> </div> <p> If you want to index multiple numeric arrays as VECTOR, use a <a href="/docs/latest/develop/data-types/json/path/"> JSONPath </a> leading to multiple numeric arrays using JSONPath operators such as wildcard, filter, union, array slice, and/or recursive descent. </p> <p> For example, assume that your JSON items include an array of vector embeddings, where each vector represents a different image of the same product. To index these vectors, specify the JSONPath <code> $.embeddings[*] </code> in the schema definition during index creation: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">CREATE</span><span class="w"> </span><span class="n">itemIdx5</span><span class="w"> </span><span class="k">ON</span><span class="w"> </span><span class="n">JSON</span><span class="w"> </span><span class="k">PREFIX</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="n">item</span><span class="p">:</span><span class="w"> </span><span class="k">SCHEMA</span><span class="w"> </span><span class="err">$</span><span class="p">.</span><span class="n">embeddings</span><span class="p">[</span><span class="o">*</span><span class="p">]</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="n">embeddings</span><span class="w"> </span><span class="n">VECTOR</span><span class="w"> </span><span class="n">FLAT</span><span class="w"> </span><span class="mi">6</span><span class="w"> </span><span class="n">DIM</span><span class="w"> </span><span class="mi">4</span><span class="w"> </span><span class="n">DISTANCE_METRIC</span><span class="w"> </span><span class="n">L2</span><span class="w"> </span><span class="k">TYPE</span><span class="w"> </span><span class="n">FLOAT32</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="n">OK</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">JSON</span><span class="p">.</span><span class="k">SET</span><span class="w"> </span><span class="n">item</span><span class="p">:</span><span class="mi">1</span><span class="w"> </span><span class="err">$</span><span class="w"> </span><span class="s1">'{"name":"Noise-cancelling Bluetooth headphones","description":"Wireless Bluetooth headphones with noise-cancelling technology","price":99.98,"stock":25,"colors":["black","silver"],"embeddings":[[0.87,-0.15,0.55,0.03]]}'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="n">OK</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">JSON</span><span class="p">.</span><span class="k">SET</span><span class="w"> </span><span class="n">item</span><span class="p">:</span><span class="mi">2</span><span class="w"> </span><span class="err">$</span><span class="w"> </span><span class="s1">'{"name":"Wireless earbuds","description":"Wireless Bluetooth in-ear headphones","price":64.99,"stock":17,"colors":["black","white"],"embeddings":[[-0.7,-0.51,0.88,0.14],[-0.8,-0.15,0.33,-0.01]]}'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="n">OK</span><span class="w"> </span></span></span></code></pre> </div> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Important note: </div> Unlike the case with the NUMERIC type, setting a static path such as <code> $.embedding </code> in the schema for the VECTOR type does not allow you to index multiple vectors stored under that field. Hence, if you set <code> $.embedding </code> as the path to the index schema, specifying an array of vectors in the <code> embedding </code> field in your JSON will cause an indexing failure. </div> </div> <p> Now you can search for the two headphones that are most similar to an image embedding by using vector search KNN query. (Note that the vector queries are supported as of dialect 2.) The distance between a document to the query vector is defined as the minimum distance between the query vector to a vector that matches the JSONPath specified in the schema. For example: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">SEARCH</span><span class="w"> </span><span class="n">itemIdx5</span><span class="w"> </span><span class="s1">'*=&gt;[KNN 2 @embeddings $blob AS dist]'</span><span class="w"> </span><span class="n">SORTBY</span><span class="w"> </span><span class="n">dist</span><span class="w"> </span><span class="n">PARAMS</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span><span class="nb">blob</span><span class="w"> </span><span class="err">\</span><span class="n">x01</span><span class="err">\</span><span class="n">x01</span><span class="err">\</span><span class="n">x01</span><span class="err">\</span><span class="n">x01</span><span class="w"> </span><span class="n">DIALECT</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="p">(</span><span class="nb">integer</span><span class="p">)</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"dist"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"0.771500051022"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="s2">"$"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"{\"</span><span class="n">name</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">earbuds</span><span class="err">\</span><span class="s2">",\"</span><span class="n">description</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="k">in</span><span class="o">-</span><span class="n">ear</span><span class="w"> </span><span class="n">headphones</span><span class="err">\</span><span class="s2">",\"</span><span class="n">price</span><span class="err">\</span><span class="s2">":64.99,\"</span><span class="n">stock</span><span class="err">\</span><span class="s2">":17,\"</span><span class="n">colors</span><span class="err">\</span><span class="s2">":[\"</span><span class="n">black</span><span class="err">\</span><span class="s2">",\"</span><span class="n">white</span><span class="err">\</span><span class="s2">"],\"</span><span class="n">embeddings</span><span class="err">\</span><span class="s2">":[[-0.7,-0.51,0.88,0.14],[-0.8,-0.15,0.33,-0.01]]}"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:1"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">5</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"dist"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"1.08280003071"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="s2">"$"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"{\"</span><span class="n">name</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Noise</span><span class="o">-</span><span class="n">cancelling</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="n">headphones</span><span class="err">\</span><span class="s2">",\"</span><span class="n">description</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="n">headphones</span><span class="w"> </span><span class="k">with</span><span class="w"> </span><span class="n">noise</span><span class="o">-</span><span class="n">cancelling</span><span class="w"> </span><span class="n">technology</span><span class="err">\</span><span class="s2">",\"</span><span class="n">price</span><span class="err">\</span><span class="s2">":99.98,\"</span><span class="n">stock</span><span class="err">\</span><span class="s2">":25,\"</span><span class="n">colors</span><span class="err">\</span><span class="s2">":[\"</span><span class="n">black</span><span class="err">\</span><span class="s2">",\"</span><span class="n">silver</span><span class="err">\</span><span class="s2">"],\"</span><span class="n">embeddings</span><span class="err">\</span><span class="s2">":[[0.87,-0.15,0.55,0.03]]}"</span><span class="w"> </span></span></span></code></pre> </div> <p> Note that <code> 0.771500051022 </code> is the L2 distance between the query vector and <code> [-0.8,-0.15,0.33,-0.01] </code> , which is the second element in the embedding array, and it is lower than the L2 distance between the query vector and <code> [-0.7,-0.51,0.88,0.14] </code> , which is the first element in the embedding array. </p> <p> For more information on vector similarity syntax, see <a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/vectors/"> Vector fields </a> . </p> <h2 id="index-json-objects"> Index JSON objects </h2> <p> You cannot index JSON objects. If the JSONPath expression returns an object, it will be ignored. </p> <p> To index the contents of a JSON object, you need to index the individual elements within the object in separate attributes. </p> <p> For example, to index the <code> connection </code> JSON object, define the <code> $.connection.wireless </code> and <code> $.connection.type </code> fields as separate attributes when you create the index: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">CREATE</span><span class="w"> </span><span class="n">itemIdx3</span><span class="w"> </span><span class="k">ON</span><span class="w"> </span><span class="n">JSON</span><span class="w"> </span><span class="k">SCHEMA</span><span class="w"> </span><span class="err">$</span><span class="p">.</span><span class="k">connection</span><span class="p">.</span><span class="n">wireless</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="n">wireless</span><span class="w"> </span><span class="n">TAG</span><span class="w"> </span><span class="err">$</span><span class="p">.</span><span class="k">connection</span><span class="p">.</span><span class="k">type</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="n">connectionType</span><span class="w"> </span><span class="nb">TEXT</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="s2">"OK"</span><span class="w"> </span></span></span></code></pre> </div> <p> After you create the new index, you can search for items with the wireless TAG set to <code> true </code> : </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">SEARCH</span><span class="w"> </span><span class="n">itemIdx3</span><span class="w"> </span><span class="s1">'@wireless:{true}'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"$"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"{\"</span><span class="n">name</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">earbuds</span><span class="err">\</span><span class="s2">",\"</span><span class="n">description</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="k">in</span><span class="o">-</span><span class="n">ear</span><span class="w"> </span><span class="n">headphones</span><span class="err">\</span><span class="s2">",\"</span><span class="k">connection</span><span class="err">\</span><span class="s2">":{\"</span><span class="n">wireless</span><span class="err">\</span><span class="s2">":true,\"</span><span class="k">connection</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Bluetooth</span><span class="err">\</span><span class="s2">"},\"</span><span class="n">price</span><span class="err">\</span><span class="s2">":64.99,\"</span><span class="n">stock</span><span class="err">\</span><span class="s2">":17,\"</span><span class="n">colors</span><span class="err">\</span><span class="s2">":[\"</span><span class="n">black</span><span class="err">\</span><span class="s2">",\"</span><span class="n">white</span><span class="err">\</span><span class="s2">"]}"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:1"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">5</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"$"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"{\"</span><span class="n">name</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Noise</span><span class="o">-</span><span class="n">cancelling</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="n">headphones</span><span class="err">\</span><span class="s2">",\"</span><span class="n">description</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="n">headphones</span><span class="w"> </span><span class="k">with</span><span class="w"> </span><span class="n">noise</span><span class="o">-</span><span class="n">cancelling</span><span class="w"> </span><span class="n">technology</span><span class="err">\</span><span class="s2">",\"</span><span class="k">connection</span><span class="err">\</span><span class="s2">":{\"</span><span class="n">wireless</span><span class="err">\</span><span class="s2">":true,\"</span><span class="k">type</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Bluetooth</span><span class="err">\</span><span class="s2">"},\"</span><span class="n">price</span><span class="err">\</span><span class="s2">":99.98,\"</span><span class="n">stock</span><span class="err">\</span><span class="s2">":25,\"</span><span class="n">colors</span><span class="err">\</span><span class="s2">":[\"</span><span class="n">black</span><span class="err">\</span><span class="s2">",\"</span><span class="n">silver</span><span class="err">\</span><span class="s2">"]}"</span><span class="w"> </span></span></span></code></pre> </div> <p> You can also search for items with a Bluetooth connection type: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">SEARCH</span><span class="w"> </span><span class="n">itemIdx3</span><span class="w"> </span><span class="s1">'@connectionType:(bluetooth)'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:1"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"$"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"{\"</span><span class="n">name</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Noise</span><span class="o">-</span><span class="n">cancelling</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="n">headphones</span><span class="err">\</span><span class="s2">",\"</span><span class="n">description</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="n">headphones</span><span class="w"> </span><span class="k">with</span><span class="w"> </span><span class="n">noise</span><span class="o">-</span><span class="n">cancelling</span><span class="w"> </span><span class="n">technology</span><span class="err">\</span><span class="s2">",\"</span><span class="k">connection</span><span class="err">\</span><span class="s2">":{\"</span><span class="n">wireless</span><span class="err">\</span><span class="s2">":true,\"</span><span class="k">type</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Bluetooth</span><span class="err">\</span><span class="s2">"},\"</span><span class="n">price</span><span class="err">\</span><span class="s2">":99.98,\"</span><span class="n">stock</span><span class="err">\</span><span class="s2">":25,\"</span><span class="n">colors</span><span class="err">\</span><span class="s2">":[\"</span><span class="n">black</span><span class="err">\</span><span class="s2">",\"</span><span class="n">silver</span><span class="err">\</span><span class="s2">"]}"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">5</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"$"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"{\"</span><span class="n">name</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">earbuds</span><span class="err">\</span><span class="s2">",\"</span><span class="n">description</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Wireless</span><span class="w"> </span><span class="n">Bluetooth</span><span class="w"> </span><span class="k">in</span><span class="o">-</span><span class="n">ear</span><span class="w"> </span><span class="n">headphones</span><span class="err">\</span><span class="s2">",\"</span><span class="k">connection</span><span class="err">\</span><span class="s2">":{\"</span><span class="n">wireless</span><span class="err">\</span><span class="s2">":true,\"</span><span class="k">type</span><span class="err">\</span><span class="s2">":\"</span><span class="n">Bluetooth</span><span class="err">\</span><span class="s2">"},\"</span><span class="n">price</span><span class="err">\</span><span class="s2">":64.99,\"</span><span class="n">stock</span><span class="err">\</span><span class="s2">":17,\"</span><span class="n">colors</span><span class="err">\</span><span class="s2">":[\"</span><span class="n">black</span><span class="err">\</span><span class="s2">",\"</span><span class="n">white</span><span class="err">\</span><span class="s2">"]}"</span><span class="w"> </span></span></span></code></pre> </div> <h2 id="field-projection"> Field projection </h2> <p> <a href="/docs/latest/commands/ft.search/"> <code> FT.SEARCH </code> </a> returns the entire JSON document by default. If you want to limit the returned search results to specific attributes, you can use field projection. </p> <h3 id="return-specific-attributes"> Return specific attributes </h3> <p> When you run a search query, you can use the <code> RETURN </code> keyword to specify which attributes you want to include in the search results. You also need to specify the number of fields to return. </p> <p> For example, this query only returns the <code> name </code> and <code> price </code> of each set of headphones: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">SEARCH</span><span class="w"> </span><span class="n">itemIdx</span><span class="w"> </span><span class="s1">'@description:(headphones)'</span><span class="w"> </span><span class="k">RETURN</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span><span class="n">name</span><span class="w"> </span><span class="n">price</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:1"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"name"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"Noise-cancelling Bluetooth headphones"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="s2">"price"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"99.98"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">5</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"name"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"Wireless earbuds"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="s2">"price"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"64.99"</span><span class="w"> </span></span></span></code></pre> </div> <h3 id="project-with-jsonpath"> Project with JSONPath </h3> <p> You can use <a href="/docs/latest/develop/data-types/json/path/"> JSONPath </a> expressions in a <code> RETURN </code> statement to extract any part of the JSON document, even fields that were not defined in the index <code> SCHEMA </code> . </p> <p> For example, the following query uses the JSONPath expression <code> $.stock </code> to return each item's stock in addition to the name and price attributes. </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">SEARCH</span><span class="w"> </span><span class="n">itemIdx</span><span class="w"> </span><span class="s1">'@description:(headphones)'</span><span class="w"> </span><span class="k">RETURN</span><span class="w"> </span><span class="mi">3</span><span class="w"> </span><span class="n">name</span><span class="w"> </span><span class="n">price</span><span class="w"> </span><span class="err">$</span><span class="p">.</span><span class="n">stock</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:1"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"name"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"Noise-cancelling Bluetooth headphones"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="s2">"price"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"99.98"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">5</span><span class="p">)</span><span class="w"> </span><span class="s2">"$.stock"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">6</span><span class="p">)</span><span class="w"> </span><span class="s2">"25"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">5</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"name"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"Wireless earbuds"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="s2">"price"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"64.99"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">5</span><span class="p">)</span><span class="w"> </span><span class="s2">"$.stock"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">6</span><span class="p">)</span><span class="w"> </span><span class="s2">"17"</span><span class="w"> </span></span></span></code></pre> </div> <p> Note that the returned property name is the JSONPath expression itself: <code> "$.stock" </code> . </p> <p> You can use the <code> AS </code> option to specify an alias for the returned property: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">SEARCH</span><span class="w"> </span><span class="n">itemIdx</span><span class="w"> </span><span class="s1">'@description:(headphones)'</span><span class="w"> </span><span class="k">RETURN</span><span class="w"> </span><span class="mi">5</span><span class="w"> </span><span class="n">name</span><span class="w"> </span><span class="n">price</span><span class="w"> </span><span class="err">$</span><span class="p">.</span><span class="n">stock</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="n">stock</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:1"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"name"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"Noise-cancelling Bluetooth headphones"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="s2">"price"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"99.98"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">5</span><span class="p">)</span><span class="w"> </span><span class="s2">"stock"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">6</span><span class="p">)</span><span class="w"> </span><span class="s2">"25"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">5</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"name"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"Wireless earbuds"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="s2">"price"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"64.99"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">5</span><span class="p">)</span><span class="w"> </span><span class="s2">"stock"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">6</span><span class="p">)</span><span class="w"> </span><span class="s2">"17"</span><span class="w"> </span></span></span></code></pre> </div> <p> This query returns the field as the alias <code> "stock" </code> instead of the JSONPath expression <code> "$.stock" </code> . </p> <h3 id="highlight-search-terms"> Highlight search terms </h3> <p> You can <a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/highlight/"> highlight </a> relevant search terms in any indexed <code> TEXT </code> attribute. </p> <p> For <a href="/docs/latest/commands/ft.search/"> <code> FT.SEARCH </code> </a> , you have to explicitly set which attributes you want highlighted after the <code> RETURN </code> and <code> HIGHLIGHT </code> parameters. </p> <p> Use the optional <code> TAGS </code> keyword to specify the strings that will surround (or highlight) the matching search terms. </p> <p> For example, highlight the word "bluetooth" with bold HTML tags in item names and descriptions: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">SEARCH</span><span class="w"> </span><span class="n">itemIdx</span><span class="w"> </span><span class="s1">'(@name:(bluetooth))|(@description:(bluetooth))'</span><span class="w"> </span><span class="k">RETURN</span><span class="w"> </span><span class="mi">3</span><span class="w"> </span><span class="n">name</span><span class="w"> </span><span class="n">description</span><span class="w"> </span><span class="n">price</span><span class="w"> </span><span class="n">HIGHLIGHT</span><span class="w"> </span><span class="n">FIELDS</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span><span class="n">name</span><span class="w"> </span><span class="n">description</span><span class="w"> </span><span class="n">TAGS</span><span class="w"> </span><span class="s1">'&lt;b&gt;'</span><span class="w"> </span><span class="s1">'&lt;/b&gt;'</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:1"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"name"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"Noise-cancelling &lt;b&gt;Bluetooth&lt;/b&gt; headphones"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="s2">"description"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"Wireless &lt;b&gt;Bluetooth&lt;/b&gt; headphones with noise-cancelling technology"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">5</span><span class="p">)</span><span class="w"> </span><span class="s2">"price"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">6</span><span class="p">)</span><span class="w"> </span><span class="s2">"99.98"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"item:2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">5</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"name"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"Wireless earbuds"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="s2">"description"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"Wireless &lt;b&gt;Bluetooth&lt;/b&gt; in-ear headphones"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">5</span><span class="p">)</span><span class="w"> </span><span class="s2">"price"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">6</span><span class="p">)</span><span class="w"> </span><span class="s2">"64.99"</span><span class="w"> </span></span></span></code></pre> </div> <h2 id="aggregate-with-jsonpath"> Aggregate with JSONPath </h2> <p> You can use <a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/aggregations/"> aggregation </a> to generate statistics or build facet queries. </p> <p> The <code> LOAD </code> option accepts <a href="/docs/latest/develop/data-types/json/path/"> JSONPath </a> expressions. You can use any value in the pipeline, even if the value is not indexed. </p> <p> This example uses aggregation to calculate a 10% price discount for each item and sorts the items from least expensive to most expensive: </p> <div class="highlight"> <pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="mi">127</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">.</span><span class="mi">1</span><span class="p">:</span><span class="mi">6379</span><span class="o">&gt;</span><span class="w"> </span><span class="n">FT</span><span class="p">.</span><span class="k">AGGREGATE</span><span class="w"> </span><span class="n">itemIdx</span><span class="w"> </span><span class="s1">'*'</span><span class="w"> </span><span class="k">LOAD</span><span class="w"> </span><span class="mi">4</span><span class="w"> </span><span class="n">name</span><span class="w"> </span><span class="err">$</span><span class="p">.</span><span class="n">price</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="n">originalPrice</span><span class="w"> </span><span class="n">APPLY</span><span class="w"> </span><span class="s1">'@originalPrice - (@originalPrice * 0.10)'</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="n">salePrice</span><span class="w"> </span><span class="n">SORTBY</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span><span class="o">@</span><span class="n">salePrice</span><span class="w"> </span><span class="k">ASC</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"2"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"name"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"Wireless earbuds"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="s2">"originalPrice"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"64.99"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">5</span><span class="p">)</span><span class="w"> </span><span class="s2">"salePrice"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">6</span><span class="p">)</span><span class="w"> </span><span class="s2">"58.491"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="s2">"name"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="s2">"Noise-cancelling Bluetooth headphones"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="s2">"originalPrice"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="s2">"99.98"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">5</span><span class="p">)</span><span class="w"> </span><span class="s2">"salePrice"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="mi">6</span><span class="p">)</span><span class="w"> </span><span class="s2">"89.982"</span><span class="w"> </span></span></span></code></pre> </div> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> <a href="/docs/latest/commands/ft.aggregate/"> <code> FT.AGGREGATE </code> </a> queries require <code> attribute </code> modifiers. Don't use JSONPath expressions in queries, except with the <code> LOAD </code> option, because the query parser doesn't fully support them. </div> </div> <h2 id="index-missing-or-empty-values"> Index missing or empty values </h2> <p> As of v2.10, you can search for missing properties, that is, properties that do not exist in a given document, using the <code> INDEXMISSING </code> option to <code> FT.CREATE </code> in conjunction with the <code> ismissing </code> query function with <code> FT.SEARCH </code> . You can also search for existing properties with no value (i.e., empty) using the <code> INDEXEMPTY </code> option with <code> FT.CREATE </code> . Both query types require DIALECT 2. Examples below: </p> <pre tabindex="0"><code>JSON.SET key:1 $ '{"propA": "foo"}' JSON.SET key:2 $ '{"propA": "bar", "propB":"abc"}' FT.CREATE idx ON JSON PREFIX 1 key: SCHEMA $.propA AS propA TAG $.propB AS propB TAG INDEXMISSING &gt; FT.SEARCH idx 'ismissing(@propB)' DIALECT 2 1) "1" 2) "key:1" 3) 1) "$" 2) "{\"propA\":\"foo\"}" </code></pre> <pre tabindex="0"><code>JSON.SET key:1 $ '{"propA": "foo", "propB":""}' JSON.SET key:2 $ '{"propA": "bar", "propB":"abc"}' FT.CREATE idx ON JSON PREFIX 1 key: SCHEMA $.propA AS propA TAG $.propB AS propB TAG INDEXEMPTY &gt; FT.SEARCH idx '@propB:{""}' DIALECT 2 1) "1" 2) "key:1" 3) 1) "$" 2) "{\"propA\":\"foo\",\"propB\":\"\"}" </code></pre> <h2 id="index-limitations"> Index limitations </h2> <h3 id="schema-mapping"> Schema mapping </h3> <p> During index creation, you need to map the JSON elements to <code> SCHEMA </code> fields as follows: </p> <ul> <li> Strings as <code> TEXT </code> , <code> TAG </code> , or <code> GEO </code> . </li> <li> Numbers as <code> NUMERIC </code> . </li> <li> Booleans as <code> TAG </code> . </li> <li> JSON array <ul> <li> Array of strings as <code> TAG </code> or <code> TEXT </code> . </li> <li> Array of numbers as <code> NUMERIC </code> or <code> VECTOR </code> . </li> <li> Array of geo coordinates as <code> GEO </code> . </li> <li> <code> null </code> values in such arrays are ignored. </li> </ul> </li> <li> You cannot index JSON objects. Index the individual elements as separate attributes instead. </li> <li> <code> null </code> values are ignored. </li> </ul> <h3 id="sortable-tags"> Sortable tags </h3> <p> If you create an index for JSON documents with a JSONPath leading to an array or to multiple values, only the first value is considered by the sort. </p> <nav> </nav> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/interact/search-and-query/indexing/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/crdb-cli/crdb/add-instance/.html
<section class="prose w-full py-12 max-w-none"> <h1> crdb-cli crdb add-instance </h1> <p class="text-lg -mt-5 mb-10"> Adds a peer replica to an Active-Active database. </p> <p> Adds a peer replica to an existing Active-Active database in order to host the database on another cluster. This creates an additional active instance of the database on the specified cluster. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">crdb-cli crdb add-instance --crdb-guid &lt;guid&gt; </span></span><span class="line"><span class="cl"> --instance <span class="nv">fqdn</span><span class="o">=</span>&lt;cluster_fqdn&gt;,username<span class="o">=</span>&lt;username&gt;,password<span class="o">=</span>&lt;password&gt;<span class="o">[</span>,url<span class="o">=</span>&lt;url&gt;,replication_endpoint<span class="o">=</span>&lt;endpoint&gt;<span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> --compression &lt;0-6&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> --no-wait <span class="o">]</span> </span></span></code></pre> </div> <h3 id="parameters"> Parameters </h3> <table> <thead> <tr> <th> Parameter </th> <th> Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> crdb-guid </td> <td> string </td> <td> The GUID of the database (required) </td> </tr> <tr> <td> instance </td> <td> strings </td> <td> The connection information for the new participating cluster (required) </td> </tr> <tr> <td> compression </td> <td> 0-6 </td> <td> The level of data compression: 0=Compression disabled <br/> <br/> 6=High compression and resource load (Default: 3) </td> </tr> <tr> <td> no-wait </td> <td> </td> <td> Does not wait for the task to complete </td> </tr> </tbody> </table> <h3 id="returns"> Returns </h3> <p> Returns the task ID of the task that is adding the new instance. </p> <p> If <code> --no-wait </code> is specified, the command exits. Otherwise, it will wait for the instance to be added and return <code> finished </code> . </p> <h3 id="example"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ crdb-cli crdb add-instance --crdb-guid db6365b5-8aca-4055-95d8-7eb0105c0b35 <span class="se">\ </span></span></span><span class="line"><span class="cl"><span class="se"></span> --instance <span class="nv">fqdn</span><span class="o">=</span>cluster2.redis.local,username<span class="o">=</span>[email protected],password<span class="o">=</span>admin-password </span></span><span class="line"><span class="cl">Task f809fae7-8e26-4c8f-9955-b74dbbd47949 created </span></span><span class="line"><span class="cl"> ---&gt; Status changed: queued -&gt; started </span></span><span class="line"><span class="cl"> ---&gt; Status changed: started -&gt; finished </span></span></code></pre> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/crdb-cli/crdb/add-instance/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/security/access-control/manage-passwords/password-expiration/.html
<section class="prose w-full py-12 max-w-none"> <h1> Configure password expiration </h1> <p class="text-lg -mt-5 mb-10"> Configure password expiration to enforce expiration of a user's password after a specified number of days. </p> <h2 id="enable-password-expiration"> Enable password expiration </h2> <p> To enforce an expiration of a user's password after a specified number of days: </p> <ul> <li> <p> Use the Cluster Manager UI: </p> <ol> <li> <p> Go to <strong> Cluster &gt; Security &gt; Preferences </strong> , then select <strong> Edit </strong> . </p> </li> <li> <p> In the <strong> Password </strong> section, turn on <strong> Expiration </strong> . </p> </li> <li> <p> Enter the number of days before passwords expire. </p> </li> <li> <p> Select <strong> Save </strong> . </p> </li> </ol> </li> <li> <p> Use the <code> cluster </code> endpoint of the REST API </p> <div class="highlight"> <pre class="chroma"><code class="language-REST" data-lang="REST"><span class="line"><span class="cl">PUT https://[host][:port]/v1/cluster<span class="err"> </span></span></span><span class="line"><span class="cl"><span class="err"></span>{"password_expiration_duration":<span class="nt">&lt;number_of_days&gt;</span>}<span class="err"> </span></span></span></code></pre> </div> </li> </ul> <h2 id="deactivate-password-expiration"> Deactivate password expiration </h2> <p> To deactivate password expiration: </p> <ul> <li> <p> Use the Cluster Manager UI: </p> <ol> <li> <p> Go to <strong> Cluster &gt; Security &gt; Preferences </strong> , then select <strong> Edit </strong> . </p> </li> <li> <p> In the <strong> Password </strong> section, turn off <strong> Expiration </strong> . </p> </li> <li> <p> Select <strong> Save </strong> . </p> </li> </ol> </li> <li> <p> Use the <code> cluster </code> REST API endpoint to set <code> password_expiration_duration </code> to <code> 0 </code> (zero). </p> </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/security/access-control/manage-passwords/password-expiration/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/scard/.html
<section class="prose w-full py-12"> <h1 class="command-name"> SCARD </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">SCARD key</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 1.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @read </code> <span class="mr-1 last:hidden"> , </span> <code> @set </code> <span class="mr-1 last:hidden"> , </span> <code> @fast </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Returns the set cardinality (number of elements) of the set stored at <code> key </code> . </p> <h2 id="examples"> Examples </h2> <div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex"> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z"> </path> </svg> </div> <form class="redis-cli overflow-y-auto max-h-80"> <pre tabindex="0">redis&gt; SADD myset "Hello" (integer) 1 redis&gt; SADD myset "World" (integer) 1 redis&gt; SCARD myset (integer) 2 </pre> <div class="prompt" style=""> <span> redis&gt; </span> <input autocomplete="off" name="prompt" spellcheck="false" type="text"/> </div> </form> <h2 id="resp2-reply"> RESP2 Reply </h2> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : the cardinality (number of elements) of the set, or <code> 0 </code> if the key does not exist. <h2 id="resp3-reply"> RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : The cardinality (number of elements) of the set, or 0 if the key does not exist. <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/scard/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/develop/tools/.html
<section class="prose w-full py-12 max-w-none"> <h1> Client tools </h1> <p class="text-lg -mt-5 mb-10"> Tools to interact with a Redis server </p> <p> You can use several tools to connect to a Redis server, to manage it and interact with the data: </p> <ul> <li> The <a href="#redis-command-line-interface-cli"> <code> redis-cli </code> </a> command line tool </li> <li> <a href="#redis-insight"> Redis Insight </a> (a graphical user interface tool) </li> <li> The Redis <a href="#redis-vscode-extension"> VSCode extension </a> </li> </ul> <h2 id="redis-command-line-interface-cli"> Redis command line interface (CLI) </h2> <p> The <a href="/docs/latest/develop/tools/cli/"> Redis command line interface </a> (also known as <code> redis-cli </code> ) is a terminal program that sends commands to and reads replies from the Redis server. It has the following two main modes: </p> <ol> <li> An interactive Read Eval Print Loop (REPL) mode where the user types Redis commands and receives replies. </li> <li> A command mode where <code> redis-cli </code> is executed with additional arguments, and the reply is printed to the standard output. </li> </ol> <h2 id="redis-insight"> Redis Insight </h2> <p> <a href="/docs/latest/develop/tools/insight/"> Redis Insight </a> combines a graphical user interface with Redis CLI to let you work with any Redis deployment. You can visually browse and interact with data, take advantage of diagnostic tools, learn by example, and much more. Best of all, Redis Insight is free. </p> <h2 id="redis-vscode-extension"> Redis VSCode extension </h2> <p> <a href="/docs/latest/develop/tools/redis-for-vscode/"> Redis for VS Code </a> is an extension that allows you to connect to your Redis databases from within Microsoft Visual Studio Code. After connecting to a database, you can view, add, modify, and delete keys, and interact with your Redis databases using a Redis Insight like UI and also a built-in CLI interface. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/tools/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/integrate/redis-data-integration/data-pipelines/transform-examples/redis-opcode-example/.html
<section class="prose w-full py-12 max-w-none"> <h1> Add the opcode to the Redis output </h1> <p> In the example below, the data is captured from the source table named <code> employee </code> and is written to the Redis database as a JSON document. When you specify the <code> data_type </code> parameter for the job, it overrides the system-wide setting <code> target_data_type </code> defined in <code> config.yaml </code> . </p> <p> Here, the result will be Redis JSON documents with fields captured from the source table ( <code> employeeid </code> , <code> firstname </code> , <code> lastname </code> ) and also with an extra field <code> my_opcode </code> added using the <code> merge </code> update strategy (see the <a href="/docs/latest/integrate/redis-data-integration/data-pipelines/transform-examples/redis-json-example/"> JSON job example </a> for more information). The <code> opcode </code> expression refers to the operation code captured from the source. This is a database-specific value that indicates which type of operation generated the change (insert, update, etc). </p> <div class="highlight"> <pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">source</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">schema</span><span class="p">:</span><span class="w"> </span><span class="l">public</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">table</span><span class="p">:</span><span class="w"> </span><span class="l">employee</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">row_format</span><span class="p">:</span><span class="w"> </span><span class="l">full</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">transform</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="nt">uses</span><span class="p">:</span><span class="w"> </span><span class="l">add_field</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">with</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">field</span><span class="p">:</span><span class="w"> </span><span class="l">after.my_opcode</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">expression</span><span class="p">:</span><span class="w"> </span><span class="l">opcode</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">language</span><span class="p">:</span><span class="w"> </span><span class="l">jmespath</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">output</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="nt">uses</span><span class="p">:</span><span class="w"> </span><span class="l">redis.write</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">with</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">data_type</span><span class="p">:</span><span class="w"> </span><span class="l">json</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">mapping</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="l">employeeid</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="l">firstname</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="l">lastname</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="l">my_opcode</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">connection</span><span class="p">:</span><span class="w"> </span><span class="l">target</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">on_update</span><span class="p">:</span><span class="w"> </span><span class="l">merge</span><span class="w"> </span></span></span></code></pre> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/integrate/redis-data-integration/data-pipelines/transform-examples/redis-opcode-example/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/kubernetes/recommendations/sizing-on-kubernetes/.html
<section class="prose w-full py-12 max-w-none"> <h1> Size and scale a Redis Enterprise cluster deployment on Kubernetes </h1> <p class="text-lg -mt-5 mb-10"> This section provides information about sizing and scaling Redis Enterprise in a Kubernetes deployment. </p> <p> The following article reviews the mechanism and methods available for sizing and scaling a Redis Enterprise cluster deployment. </p> <p> For minimum and recommended sizing, always follow the sizing guidelines detailed in the <a href="/docs/latest/operate/rs/installing-upgrading/install/plan-deployment/hardware-requirements/"> Redis Enterprise hardware requirements </a> . </p> <h2 id="sizing-and-scaling-cluster-nodes"> Sizing and scaling cluster nodes </h2> <h3 id="setting-the-number-of-cluster-nodes"> Setting the number of cluster nodes </h3> <p> Define the number of cluster nodes in redis-enterprise-cluster.yaml file. </p> <pre><code>spec: nodes: 3 </code></pre> <p> The number of nodes in the cluster must be an uneven number equal to or greater than 3. Refer to the article <a href="https://redislabs.com/redis-enterprise/technology/highly-available-redis/"> Highly Available Redis </a> for a detailed explanation on this topic. </p> <p> Set the number of cluster nodes during deployment by editing the redis-enterprise-cluster.yaml file and applying the file by running: </p> <pre><code>kubectl apply -f redis-enterprise-cluster.yaml </code></pre> <h3 id="scaling-out"> Scaling out </h3> <p> To scale out a Redis Enterprise Cluster deployment, increase the number of nodes in the spec. For example, to scale the cluster out from 3 nodes to 5 nodes, edit the redis-enterprise-cluster.yaml file with the following: </p> <pre><code>spec: nodes: 5 </code></pre> <p> To apply the new cluster configuration run: </p> <pre><code>kubectl apply -f redis-enterprise-cluster.yaml </code></pre> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Warning: </div> Decreasing the number of nodes is not supported. </div> </div> <h3 id="sizing-compute-resources"> Sizing compute resources </h3> <p> To set the compute resources required for each node, use the redisEnterpriseNodeResources spec field. </p> <p> Under redisEnterpriseNodeResources spec, set the following fields according to the provided guidelines. </p> <ul> <li> limits – specifies the maximum compute resources for a Redis node </li> <li> requests – specifies the minimum compute resources for a Redis node </li> </ul> <p> For example: </p> <pre><code>redisEnterpriseNodeResources: limits: cpu: β€œ2000m” memory: 4Gi requests: cpu: β€œ2000m” memory: 4Gi </code></pre> <p> The default values, if unspecified, are 2 cores (2000m) and 4GB (4Gi). </p> <p> Set the compute resources for cluster nodes during deployment by editing the redis-enterprise-cluster.yaml file and applying the file by running: </p> <pre><code>kubectl apply -f redis-enterprise-cluster.yaml </code></pre> <h3 id="scaling-up-node-compute-resources"> Scaling up node compute resources </h3> <p> To scale up nodes in an existing Redis Enterprise Cluster deployment, adjust the cpu and memory parameters in the spec. For example, to scale nodes up to the recommended amount of compute resources, edit the redis-enterprise-cluster.yaml file with the following: </p> <p> redisEnterpriseNodeResources: </p> <pre><code>limits: cpu: β€œ8000m” memory: 30Gi requests cpu: β€œ8000m” memory: 30Gi </code></pre> <p> Then, apply the file by running: </p> <pre><code>kubectl apply -f redis-enterprise-cluster.yaml </code></pre> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Warning: </div> <p> When adjusting compute resources, make sure the ratio of persistent volume size and the new memory size are in accordance to the <a href="/docs/latest/operate/rs/installing-upgrading/install/plan-deployment/hardware-requirements/"> Hardware requirements </a> . </p> <p> Persistent volume claims can be expanded, but not reduced after creation. See <a href="/docs/latest/operate/kubernetes/re-clusters/expand-pvc/"> Expand PersistentVolumeClaim (PVC) </a> for details. </p> </div> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/kubernetes/recommendations/sizing-on-kubernetes/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsbuilder/repartition/.html
<section class="prose w-full py-12 max-w-none"> <h1> Repartition </h1> <p class="text-lg -mt-5 mb-10"> Moves records between shards according to the extracted data. </p> <div class="highlight"> <pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="kd">public</span> <span class="n">GearsBuilder</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span> <span class="n">repartition</span><span class="err">​</span><span class="o">(</span> </span></span><span class="line"><span class="cl"> <span class="n">gears</span><span class="o">.</span><span class="na">operations</span><span class="o">.</span><span class="na">ExtractorOperation</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span> <span class="n">extractor</span><span class="o">)</span> </span></span></code></pre> </div> <p> Moves records between the shards. The extracted data determines the new shard location for each record. </p> <h2 id="parameters"> Parameters </h2> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> extractor </td> <td> <nobr> ExtractorOperation <t> </t> </nobr> </td> <td> Extracts a specific value from each record </td> </tr> </tbody> </table> <h2 id="returns"> Returns </h2> <p> Returns a GearsBuilder object with a new template type. </p> <h2 id="example"> Example </h2> <p> Repartition by value: </p> <div class="highlight"> <pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="n">GearsBuilder</span><span class="o">.</span><span class="na">CreateGearsBuilder</span><span class="o">(</span><span class="n">reader</span><span class="o">).</span> </span></span><span class="line"><span class="cl"> <span class="n">repartition</span><span class="o">(</span><span class="n">r</span><span class="o">-&gt;{</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">r</span><span class="o">.</span><span class="na">getStringVal</span><span class="o">();</span> </span></span><span class="line"><span class="cl"><span class="o">});</span> </span></span></code></pre> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsbuilder/repartition/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/sdiffstore/.html
<section class="prose w-full py-12"> <h1 class="command-name"> SDIFFSTORE </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">SDIFFSTORE destination key [key ...]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 1.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(N) where N is the total number of elements in all given sets. </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @write </code> <span class="mr-1 last:hidden"> , </span> <code> @set </code> <span class="mr-1 last:hidden"> , </span> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> This command is equal to <a href="/docs/latest/commands/sdiff/"> <code> SDIFF </code> </a> , but instead of returning the resulting set, it is stored in <code> destination </code> . </p> <p> If <code> destination </code> already exists, it is overwritten. </p> <h2 id="examples"> Examples </h2> <div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex"> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z"> </path> </svg> </div> <form class="redis-cli overflow-y-auto max-h-80"> <pre tabindex="0">redis&gt; SADD key1 "a" (integer) 1 redis&gt; SADD key1 "b" (integer) 1 redis&gt; SADD key1 "c" (integer) 1 redis&gt; SADD key2 "c" (integer) 1 redis&gt; SADD key2 "d" (integer) 1 redis&gt; SADD key2 "e" (integer) 1 redis&gt; SDIFFSTORE key key1 key2 (integer) 2 redis&gt; SMEMBERS key 1) "a" 2) "b" </pre> <div class="prompt" style=""> <span> redis&gt; </span> <input autocomplete="off" name="prompt" spellcheck="false" type="text"/> </div> </form> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : the number of elements in the resulting set. <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/sdiffstore/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/develop/reference/modules/modules-native-types/.html
<section class="prose w-full py-12"> <h1> Modules API for native types </h1> <p class="text-lg -mt-5 mb-10"> How to use native types in a Redis module </p> <p> Redis modules can access Redis built-in data structures both at high level, by calling Redis commands, and at low level, by manipulating the data structures directly. </p> <p> By using these capabilities in order to build new abstractions on top of existing Redis data structures, or by using strings DMA in order to encode modules data structures into Redis strings, it is possible to create modules that <em> feel like </em> they are exporting new data types. However, for more complex problems, this is not enough, and the implementation of new data structures inside the module is needed. </p> <p> We call the ability of Redis modules to implement new data structures that feel like native Redis ones <strong> native types support </strong> . This document describes the API exported by the Redis modules system in order to create new data structures and handle the serialization in RDB files, the rewriting process in AOF, the type reporting via the <a href="/docs/latest/commands/type/"> <code> TYPE </code> </a> command, and so forth. </p> <h2 id="overview-of-native-types"> Overview of native types </h2> <p> A module exporting a native type is composed of the following main parts: </p> <ul> <li> The implementation of some kind of new data structure and of commands operating on the new data structure. </li> <li> A set of callbacks that handle: RDB saving, RDB loading, AOF rewriting, releasing of a value associated with a key, calculation of a value digest (hash) to be used with the <code> DEBUG DIGEST </code> command. </li> <li> A 9 characters name that is unique to each module native data type. </li> <li> An encoding version, used to persist into RDB files a module-specific data version, so that a module will be able to load older representations from RDB files. </li> </ul> <p> While to handle RDB loading, saving and AOF rewriting may look complex as a first glance, the modules API provide very high level function for handling all this, without requiring the user to handle read/write errors, so in practical terms, writing a new data structure for Redis is a simple task. </p> <p> A <strong> very easy </strong> to understand but complete example of native type implementation is available inside the Redis distribution in the <code> /modules/hellotype.c </code> file. The reader is encouraged to read the documentation by looking at this example implementation to see how things are applied in the practice. </p> <h2 id="register-a-new-data-type"> Register a new data type </h2> <p> In order to register a new native type into the Redis core, the module needs to declare a global variable that will hold a reference to the data type. The API to register the data type will return a data type reference that will be stored in the global variable. </p> <pre><code>static RedisModuleType *MyType; #define MYTYPE_ENCODING_VERSION 0 int RedisModule_OnLoad(RedisModuleCtx *ctx) { RedisModuleTypeMethods tm = { .version = REDISMODULE_TYPE_METHOD_VERSION, .rdb_load = MyTypeRDBLoad, .rdb_save = MyTypeRDBSave, .aof_rewrite = MyTypeAOFRewrite, .free = MyTypeFree }; MyType = RedisModule_CreateDataType(ctx, "MyType-AZ", MYTYPE_ENCODING_VERSION, &amp;tm); if (MyType == NULL) return REDISMODULE_ERR; } </code></pre> <p> As you can see from the example above, a single API call is needed in order to register the new type. However a number of function pointers are passed as arguments. Certain are optionals while some are mandatory. The above set of methods <em> must </em> be passed, while <code> .digest </code> and <code> .mem_usage </code> are optional and are currently not actually supported by the modules internals, so for now you can just ignore them. </p> <p> The <code> ctx </code> argument is the context that we receive in the <code> OnLoad </code> function. The type <code> name </code> is a 9 character name in the character set that includes from <code> A-Z </code> , <code> a-z </code> , <code> 0-9 </code> , plus the underscore <code> _ </code> and minus <code> - </code> characters. </p> <p> Note that <strong> this name must be unique </strong> for each data type in the Redis ecosystem, so be creative, use both lower-case and upper case if it makes sense, and try to use the convention of mixing the type name with the name of the author of the module, to create a 9 character unique name. </p> <p> <strong> NOTE: </strong> It is very important that the name is exactly 9 chars or the registration of the type will fail. Read more to understand why. </p> <p> For example if I'm building a <em> b-tree </em> data structure and my name is <em> antirez </em> I'll call my type <strong> btree1-az </strong> . The name, converted to a 64 bit integer, is stored inside the RDB file when saving the type, and will be used when the RDB data is loaded in order to resolve what module can load the data. If Redis finds no matching module, the integer is converted back to a name in order to provide some clue to the user about what module is missing in order to load the data. </p> <p> The type name is also used as a reply for the <a href="/docs/latest/commands/type/"> <code> TYPE </code> </a> command when called with a key holding the registered type. </p> <p> The <code> encver </code> argument is the encoding version used by the module to store data inside the RDB file. For example I can start with an encoding version of 0, but later when I release version 2.0 of my module, I can switch encoding to something better. The new module will register with an encoding version of 1, so when it saves new RDB files, the new version will be stored on disk. However when loading RDB files, the module <code> rdb_load </code> method will be called even if there is data found for a different encoding version (and the encoding version is passed as argument to <code> rdb_load </code> ), so that the module can still load old RDB files. </p> <p> The last argument is a structure used in order to pass the type methods to the registration function: <code> rdb_load </code> , <code> rdb_save </code> , <code> aof_rewrite </code> , <code> digest </code> and <code> free </code> and <code> mem_usage </code> are all callbacks with the following prototypes and uses: </p> <pre><code>typedef void *(*RedisModuleTypeLoadFunc)(RedisModuleIO *rdb, int encver); typedef void (*RedisModuleTypeSaveFunc)(RedisModuleIO *rdb, void *value); typedef void (*RedisModuleTypeRewriteFunc)(RedisModuleIO *aof, RedisModuleString *key, void *value); typedef size_t (*RedisModuleTypeMemUsageFunc)(void *value); typedef void (*RedisModuleTypeDigestFunc)(RedisModuleDigest *digest, void *value); typedef void (*RedisModuleTypeFreeFunc)(void *value); </code></pre> <ul> <li> <code> rdb_load </code> is called when loading data from the RDB file. It loads data in the same format as <code> rdb_save </code> produces. </li> <li> <code> rdb_save </code> is called when saving data to the RDB file. </li> <li> <code> aof_rewrite </code> is called when the AOF is being rewritten, and the module needs to tell Redis what is the sequence of commands to recreate the content of a given key. </li> <li> <code> digest </code> is called when <code> DEBUG DIGEST </code> is executed and a key holding this module type is found. Currently this is not yet implemented so the function ca be left empty. </li> <li> <code> mem_usage </code> is called when the <a href="/docs/latest/commands/memory/"> <code> MEMORY </code> </a> command asks for the total memory consumed by a specific key, and is used in order to get the amount of bytes used by the module value. </li> <li> <code> free </code> is called when a key with the module native type is deleted via <a href="/docs/latest/commands/del/"> <code> DEL </code> </a> or in any other mean, in order to let the module reclaim the memory associated with such a value. </li> </ul> <h3 id="why-module-types-require-nine-character-names"> Why module types require nine character names </h3> <p> When Redis persists to RDB files, modules specific data types require to be persisted as well. Now RDB files are sequences of key-value pairs like the following: </p> <pre><code>[1 byte type] [key] [a type specific value] </code></pre> <p> The 1 byte type identifies strings, lists, sets, and so forth. In the case of modules data, it is set to a special value of <code> module data </code> , but of course this is not enough, we need the information needed to link a specific value with a specific module type that is able to load and handle it. </p> <p> So when we save a <code> type specific value </code> about a module, we prefix it with a 64 bit integer. 64 bits is large enough to store the information needed in order to lookup the module that can handle that specific type, but is short enough that we can prefix each module value we store inside the RDB without making the final RDB file too big. At the same time, this solution of prefixing the value with a 64 bit <em> signature </em> does not require to do strange things like defining in the RDB header a list of modules specific types. Everything is pretty simple. </p> <p> So, what you can store in 64 bits in order to identify a given module in a reliable way? Well if you build a character set of 64 symbols, you can easily store 9 characters of 6 bits, and you are left with 10 bits, that are used in order to store the <em> encoding version </em> of the type, so that the same type can evolve in the future and provide a different and more efficient or updated serialization format for RDB files. </p> <p> So the 64 bit prefix stored before each module value is like the following: </p> <pre><code>6|6|6|6|6|6|6|6|6|10 </code></pre> <p> The first 9 elements are 6-bits characters, the final 10 bits is the encoding version. </p> <p> When the RDB file is loaded back, it reads the 64 bit value, masks the final 10 bits, and searches for a matching module in the modules types cache. When a matching one is found, the method to load the RDB file value is called with the 10 bits encoding version as argument, so that the module knows what version of the data layout to load, if it can support multiple versions. </p> <p> Now the interesting thing about all this is that, if instead the module type cannot be resolved, since there is no loaded module having this signature, we can convert back the 64 bit value into a 9 characters name, and print an error to the user that includes the module type name! So that she or he immediately realizes what's wrong. </p> <h3 id="set-and-get-keys"> Set and get keys </h3> <p> After registering our new data type in the <code> RedisModule_OnLoad() </code> function, we also need to be able to set Redis keys having as value our native type. </p> <p> This normally happens in the context of commands that write data to a key. The native types API allow to set and get keys to module native data types, and to test if a given key is already associated to a value of a specific data type. </p> <p> The API uses the normal modules <code> RedisModule_OpenKey() </code> low level key access interface in order to deal with this. This is an example of setting a native type private data structure to a Redis key: </p> <pre><code>RedisModuleKey *key = RedisModule_OpenKey(ctx,keyname,REDISMODULE_WRITE); struct some_private_struct *data = createMyDataStructure(); RedisModule_ModuleTypeSetValue(key,MyType,data); </code></pre> <p> The function <code> RedisModule_ModuleTypeSetValue() </code> is used with a key handle open for writing, and gets three arguments: the key handle, the reference to the native type, as obtained during the type registration, and finally a <code> void* </code> pointer that contains the private data implementing the module native type. </p> <p> Note that Redis has no clues at all about what your data contains. It will just call the callbacks you provided during the method registration in order to perform operations on the type. </p> <p> Similarly we can retrieve the private data from a key using this function: </p> <pre><code>struct some_private_struct *data; data = RedisModule_ModuleTypeGetValue(key); </code></pre> <p> We can also test for a key to have our native type as value: </p> <pre><code>if (RedisModule_ModuleTypeGetType(key) == MyType) { /* ... do something ... */ } </code></pre> <p> However for the calls to do the right thing, we need to check if the key is empty, if it contains a value of the right kind, and so forth. So the idiomatic code to implement a command writing to our native type is along these lines: </p> <pre><code>RedisModuleKey *key = RedisModule_OpenKey(ctx,argv[1], REDISMODULE_READ|REDISMODULE_WRITE); int type = RedisModule_KeyType(key); if (type != REDISMODULE_KEYTYPE_EMPTY &amp;&amp; RedisModule_ModuleTypeGetType(key) != MyType) { return RedisModule_ReplyWithError(ctx,REDISMODULE_ERRORMSG_WRONGTYPE); } </code></pre> <p> Then if we successfully verified the key is not of the wrong type, and we are going to write to it, we usually want to create a new data structure if the key is empty, or retrieve the reference to the value associated to the key if there is already one: </p> <pre><code>/* Create an empty value object if the key is currently empty. */ struct some_private_struct *data; if (type == REDISMODULE_KEYTYPE_EMPTY) { data = createMyDataStructure(); RedisModule_ModuleTypeSetValue(key,MyTyke,data); } else { data = RedisModule_ModuleTypeGetValue(key); } /* Do something with 'data'... */ </code></pre> <h3 id="free-method"> Free method </h3> <p> As already mentioned, when Redis needs to free a key holding a native type value, it needs help from the module in order to release the memory. This is the reason why we pass a <code> free </code> callback during the type registration: </p> <pre><code>typedef void (*RedisModuleTypeFreeFunc)(void *value); </code></pre> <p> A trivial implementation of the free method can be something like this, assuming our data structure is composed of a single allocation: </p> <pre><code>void MyTypeFreeCallback(void *value) { RedisModule_Free(value); } </code></pre> <p> However a more real world one will call some function that performs a more complex memory reclaiming, by casting the void pointer to some structure and freeing all the resources composing the value. </p> <h3 id="rdb-load-and-save-methods"> RDB load and save methods </h3> <p> The RDB saving and loading callbacks need to create (and load back) a representation of the data type on disk. Redis offers a high level API that can automatically store inside the RDB file the following types: </p> <ul> <li> Unsigned 64 bit integers. </li> <li> Signed 64 bit integers. </li> <li> Doubles. </li> <li> Strings. </li> </ul> <p> It is up to the module to find a viable representation using the above base types. However note that while the integer and double values are stored and loaded in an architecture and <em> endianness </em> agnostic way, if you use the raw string saving API to, for example, save a structure on disk, you have to care those details yourself. </p> <p> This is the list of functions performing RDB saving and loading: </p> <pre><code>void RedisModule_SaveUnsigned(RedisModuleIO *io, uint64_t value); uint64_t RedisModule_LoadUnsigned(RedisModuleIO *io); void RedisModule_SaveSigned(RedisModuleIO *io, int64_t value); int64_t RedisModule_LoadSigned(RedisModuleIO *io); void RedisModule_SaveString(RedisModuleIO *io, RedisModuleString *s); void RedisModule_SaveStringBuffer(RedisModuleIO *io, const char *str, size_t len); RedisModuleString *RedisModule_LoadString(RedisModuleIO *io); char *RedisModule_LoadStringBuffer(RedisModuleIO *io, size_t *lenptr); void RedisModule_SaveDouble(RedisModuleIO *io, double value); double RedisModule_LoadDouble(RedisModuleIO *io); </code></pre> <p> The functions don't require any error checking from the module, that can always assume calls succeed. </p> <p> As an example, imagine I've a native type that implements an array of double values, with the following structure: </p> <pre><code>struct double_array { size_t count; double *values; }; </code></pre> <p> My <code> rdb_save </code> method may look like the following: </p> <pre><code>void DoubleArrayRDBSave(RedisModuleIO *io, void *ptr) { struct dobule_array *da = ptr; RedisModule_SaveUnsigned(io,da-&gt;count); for (size_t j = 0; j &lt; da-&gt;count; j++) RedisModule_SaveDouble(io,da-&gt;values[j]); } </code></pre> <p> What we did was to store the number of elements followed by each double value. So when later we'll have to load the structure in the <code> rdb_load </code> method we'll do something like this: </p> <pre><code>void *DoubleArrayRDBLoad(RedisModuleIO *io, int encver) { if (encver != DOUBLE_ARRAY_ENC_VER) { /* We should actually log an error here, or try to implement the ability to load older versions of our data structure. */ return NULL; } struct double_array *da; da = RedisModule_Alloc(sizeof(*da)); da-&gt;count = RedisModule_LoadUnsigned(io); da-&gt;values = RedisModule_Alloc(da-&gt;count * sizeof(double)); for (size_t j = 0; j &lt; da-&gt;count; j++) da-&gt;values[j] = RedisModule_LoadDouble(io); return da; } </code></pre> <p> The load callback just reconstruct back the data structure from the data we stored in the RDB file. </p> <p> Note that while there is no error handling on the API that writes and reads from disk, still the load callback can return NULL on errors in case what it reads does not look correct. Redis will just panic in that case. </p> <h3 id="aof-rewriting"> AOF rewriting </h3> <pre><code>void RedisModule_EmitAOF(RedisModuleIO *io, const char *cmdname, const char *fmt, ...); </code></pre> <h3 id="allocate-memory"> Allocate memory </h3> <p> Modules data types should try to use <code> RedisModule_Alloc() </code> functions family in order to allocate, reallocate and release heap memory used to implement the native data structures (see the other Redis Modules documentation for detailed information). </p> <p> This is not just useful in order for Redis to be able to account for the memory used by the module, but there are also more advantages: </p> <ul> <li> Redis uses the <code> jemalloc </code> allocator, that often prevents fragmentation problems that could be caused by using the libc allocator. </li> <li> When loading strings from the RDB file, the native types API is able to return strings allocated directly with <code> RedisModule_Alloc() </code> , so that the module can directly link this memory into the data structure representation, avoiding a useless copy of the data. </li> </ul> <p> Even if you are using external libraries implementing your data structures, the allocation functions provided by the module API is exactly compatible with <code> malloc() </code> , <code> realloc() </code> , <code> free() </code> and <code> strdup() </code> , so converting the libraries in order to use these functions should be trivial. </p> <p> In case you have an external library that uses libc <code> malloc() </code> , and you want to avoid replacing manually all the calls with the Redis Modules API calls, an approach could be to use simple macros in order to replace the libc calls with the Redis API calls. Something like this could work: </p> <pre><code>#define malloc RedisModule_Alloc #define realloc RedisModule_Realloc #define free RedisModule_Free #define strdup RedisModule_Strdup </code></pre> <p> However take in mind that mixing libc calls with Redis API calls will result into troubles and crashes, so if you replace calls using macros, you need to make sure that all the calls are correctly replaced, and that the code with the substituted calls will never, for example, attempt to call <code> RedisModule_Free() </code> with a pointer allocated using libc <code> malloc() </code> . </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/reference/modules/modules-native-types/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/develop/tools/insight/release-notes/v.2.56.0/.html
<section class="prose w-full py-12"> <h1> Redis Insight v2.56.0, September 2024 </h1> <p class="text-lg -mt-5 mb-10"> Redis Insight v2.56 </p> <h2 id="256-september-2024"> 2.56 (September 2024) </h2> <p> This is the General Availability (GA) release of Redis Insight 2.56. </p> <h3 id="highlights"> Highlights </h3> <ul> <li> Seamlessly sign in to your Redis Cloud account using the new <a href="https://redis.io/docs/latest/operate/rc/security/access-control/saml-sso/"> SAML single sign-on </a> feature, now available alongside existing social logins via Google and GitHub. This integration lets you connect to all your Redis Cloud databases in several clicks. </li> <li> Start your Redis journey faster with a sample data set automatically loaded for new free Redis Cloud databases created directly within Redis Insight. </li> <li> Focus on what matters most: <ul> <li> Hide or show <a href="https://redis.io/docs/latest/develop/data-types/hashes/?utm_source=redisinsight&amp;utm_medium=release_notes&amp;utm_campaign=2.52#field-expiration"> TTL for individual hash fields </a> to create a cleaner, more efficient workspace. </li> <li> Enhanced vector data representation with updated 32-bit and 64-bit vector formatters in the Browser. </li> <li> UX optimizations to make it easier and more intuitive to connect to your <a href="https://redis.io/data-integration/?utm_source=redisinsight&amp;utm_medium=repository&amp;utm_campaign=release_notes"> Redis Data Integration (RDI) </a> instance within Redis Insight. </li> </ul> </li> </ul> <h3 id="details"> Details </h3> <p> <strong> Features and improvements </strong> </p> <ul> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/3727"> #3727 </a> Seamlessly sign in to your Redis Cloud account using the new <a href="https://redis.io/docs/latest/operate/rc/security/access-control/saml-sso/"> SAML single sign-on </a> feature, now available alongside existing social logins via Google and GitHub. This integration lets you connect to all your Redis Cloud databases in several clicks. Before setting up SAML in Redis Cloud, you must first <a href="https://redis.io/docs/latest/operate/rc/security/access-control/saml-sso/?utm_source=redisinsight&amp;utm_medium=repository&amp;utm_campaign=release_notes"> verify domain ownership </a> for any domains associated with your SAML setup. Note that integration with Redis Cloud is currently available only in the desktop version of Redis Insight. </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/3659"> #3659 </a> Start your Redis journey faster with a sample data set automatically loaded for new free Redis Cloud databases created directly within Redis Insight. This feature ensures a smoother setup process, allowing you to dive into your data immediately. </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/3624"> #3624 </a> The ability to hide or show <a href="https://redis.io/docs/latest/develop/data-types/hashes/?utm_source=redisinsight&amp;utm_medium=release_notes&amp;utm_campaign=2.52#field-expiration"> TTL for individual hash fields </a> to create a cleaner, more efficient workspace. This optimization complements the highly requested hash field expiration feature introduced in the <a href="https://github.com/redis-stack/redis-stack/releases/tag/v7.4.0-v0"> first release candidate of Redis 7.4 </a> . </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/3701"> #3701 </a> Enhanced vector data representation with updated 32-bit and 64-bit vector formatters in the Browser. These changes ensure that vector formatters are applied only to data containing unprintable values when converted to UTF-8, providing a clearer and more accurate view of your data. </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/3714"> #3714 </a> UX optimizations to make it easier and more intuitive to connect to your <a href="https://redis.io/data-integration/?utm_source=redisinsight&amp;utm_medium=repository&amp;utm_campaign=release_notes"> Redis Data Integration (RDI) </a> instance within Redis Insight. </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/3665"> #3665 </a> A new timestamp formatter in the Browser to improve data readability. This formatter converts timestamps in hash fields to a human-readable format, making it easier to interpret results, validate and optimize queries, and inspect indexed data when using the <a href="https://redis.io/docs/latest/develop/interact/search-and-query/?utm_source=redisinsight&amp;utm_medium=repository&amp;utm_campaign=release_notes"> Redis Query Engine </a> . </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/3730"> #3730 </a> Date and time format customization to make the data more intuitive in Redis Insight. This flexibility helps match your local time zone or standardize it to UTC for better alignment in time-critical operations across global teams. </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/tools/insight/release-notes/v.2.56.0/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/databases/active-active/develop/data-types/hashes/.html
<section class="prose w-full py-12 max-w-none"> <h1> Hashes in an Active-Active databases </h1> <p class="text-lg -mt-5 mb-10"> Information about using hashes with an Active-Active database. </p> <p> Hashes are great for structured data thatΒ contain a map of fields and values. They are used for managing distributed user or app session state, user preferences, form data and so on. Hash fields contain string type and string types operate just like the standard Redis string types when it comes to CRDTs. Fields in hashes can be initialized as a string using HSET or HMSET or can be used to initialize counter types that are numeric integers using HINCRBY or floats using HINCRBYFLOAT. </p> <p> Hashes in Active-Active databases behave the same and maintain additional metadata to achieve an "OR-Set" behavior to handle concurrent conflicting writes. With the OR-Set behavior, writes to add new fields across multiple Active-Active database instances are typically unioned except in cases of conflicts. Conflicting instance writes can happen when an Active-Active database instance deletes a field while the other adds the same field. In this case and observed remove rule is followed. That is, remove can only remove fields it has already seen and in all other cases element add/update wins. </p> <p> Field values behave just like CRDT strings. String values can be types string, counter integer based on the command used for initialization of the field value. See "String Data Type in Active-Active databases" and "String Data Type with Counter Value in Active-Active databases" for more details. </p> <p> Here is an example of an "add wins" case: </p> <table> <thead> <tr> <th style="text-align:right"> <strong> Time </strong> </th> <th style="text-align:center"> <strong> CRDB Instance1 </strong> </th> <th style="text-align:center"> <strong> CRDB Instance2 </strong> </th> </tr> </thead> <tbody> <tr> <td style="text-align:right"> t1 </td> <td style="text-align:center"> HSET key1 field1 β€œa” </td> <td style="text-align:center"> </td> </tr> <tr> <td style="text-align:right"> t2 </td> <td style="text-align:center"> </td> <td style="text-align:center"> HSET key1 field2 β€œb” </td> </tr> <tr> <td style="text-align:right"> t4 </td> <td style="text-align:center"> - Sync - </td> <td style="text-align:center"> - Sync - </td> </tr> <tr> <td style="text-align:right"> t5 </td> <td style="text-align:center"> HGETALL key1 <br/> 1) β€œfield2” <br/> 2) β€œb” <br/> 3) β€œfield1” <br/> 4) β€œa” </td> <td style="text-align:center"> HGETALL key1 <br/> 1) β€œfield2” <br/> 2) β€œb” <br/> 3) β€œfield1” <br/> 4) β€œa” </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/databases/active-active/develop/data-types/hashes/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/release-notes/rs-6-2-18-releases/rs-6-2-18-43/.html
<section class="prose w-full py-12 max-w-none"> <h1> Redis Enterprise Software release notes 6.2.18-43 (September 2022) </h1> <p class="text-lg -mt-5 mb-10"> Database auditing. Private key encryption. Active-Active database support for MEMORY USAGE command. Improvements to crdb-cli. </p> <p> <a href="https://redislabs.com/redis-enterprise-software/download-center/software/"> Redis Enterprise Software version 6.2.18 </a> is now available! </p> <p> This version of Redis Enterprise Software offers: </p> <ul> <li> RedisJSON on Active-Active General Availability </li> <li> Database connection auditing </li> <li> Private key encryption </li> <li> Active-Active support for <code> memory usage </code> command </li> <li> <code> crdb-cli </code> improvements </li> <li> Compatibility with open source Redis v6.2.6 </li> <li> Additional enhancements and fixes </li> </ul> <p> The following table shows the MD5 checksums for the available packages: </p> <table> <thead> <tr> <th style="text-align:left"> Package </th> <th style="text-align:left"> MD5 checksum (6.2.18-43 September release) </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> Ubuntu 16 </td> <td style="text-align:left"> <code> 055973eb7009073b0c199ec1dfd81018 </code> </td> </tr> <tr> <td style="text-align:left"> Ubuntu 18 </td> <td style="text-align:left"> <code> 8c37c6ae10b0ae4956e3c11db80d18ce </code> </td> </tr> <tr> <td style="text-align:left"> RedHat Enterprise Linux (RHEL) 7 <br/> Oracle Enterprise Linux (OL) 7 </td> <td style="text-align:left"> <code> c770a66d9bfdd8734f1208d64aa67784 </code> </td> </tr> <tr> <td style="text-align:left"> RedHat Enterprise Linux (RHEL) 8 <br/> Oracle Enterprise Linux (OL) 8 </td> <td style="text-align:left"> <code> 85eb6339f837205d83f215e32c1d028f </code> </td> </tr> </tbody> </table> <h2 id="new-features-and-enhancements"> New features and enhancements </h2> <h4 id="general-availability-of-active-active-databases-with-redisjson"> General Availability of Active-Active databases with RedisJSON </h4> <p> Active-Active databases now support Index, query, and full-text search of nested JSON documents when combining RedisJSON with RediSearch. </p> <h4 id="database-connection-auditing"> Database connection auditing </h4> <p> You can now <a href="/docs/latest/operate/rs/security/audit-events/"> audit database connection </a> and authentication events to track and troubleshoot activity. Administrators can now use third-party systems to track and analyze connection events in realtime. </p> <h4 id="private-key-encryption"> Private key encryption </h4> <p> When enabled, private key encryption encrypts private keys stored in the cluster configuration store (CCS). Private keys are encrypted using a secure, self-contained internal process. Databases must be at least version 6.2.2 or later to use this feature. </p> <h4 id="active-active-support-for-memory-usage-command"> Active-Active support for MEMORY USAGE command </h4> <p> Redis Enterprise Active-Active databases now support the <a href="/docs/latest/commands/memory-usage/"> MEMORY USAGE </a> command, which simplifies troubleshooting and lets applications detect anomalous behavior and dangerous trends. To learn more, see <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/json/active-active/"> <code> Active-Active with RedisJSON </code> </a> . </p> <p> MEMORY USAGE reports the RAM memory use, in bytes, of a key and its value. The result includes the memory allocated for the data value and the administrative overhead associated with the key. </p> <h4 id="crdb-cli-improvements"> <code> crdb-cli </code> improvements </h4> <p> The <code> crdb-cli </code> utility used to manage Active-Active databases now allows greater visibility into management operations to make it easier to investigate and troubleshoot problems. You can now use: </p> <ul> <li> <p> <code> crdb-cli task list </code> to retrieve details about current and previous tasks for all Active-Active databases on a cluster </p> </li> <li> <p> <code> crdb-cli task --task-id &lt;task-id&gt; </code> to get detailed information about a specific task. </p> </li> </ul> <p> To learn more, see <a href="/docs/latest/operate/rs/references/cli-utilities/crdb-cli/"> <code> crdb-cli </code> </a> </p> <h4 id="redis-modules"> Redis modules </h4> <p> Redis Enterprise Software v6.2.18-43 (September release) includes the following Redis modules: </p> <ul> <li> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/redisearch-2.4-release-notes#v2411-july-2022"> RediSearch v2.4.11 </a> </li> <li> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisjson/redisjson-2.2-release-notes#v220-july-2022"> RedisJSON v2.2.0 </a> </li> <li> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/bloom/release-notes/redisbloom-2.2-release-notes/#v2218-july-2022"> RedisBloom v2.2.18 </a> </li> <li> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisgraph/redisgraph-2.8-release-notes#v2817-july-2022"> RedisGraph v2.8.17 </a> </li> <li> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redistimeseries/redistimeseries-1.6-release-notes#v1617-july-2022"> RedisTimeSeries v1.6.17 </a> </li> </ul> <p> See <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/upgrade-module/"> Upgrade modules </a> to learn how to upgrade a module for a database. </p> <h4 id="additional-enhancements"> Additional enhancements </h4> <ul> <li> <p> Added support for the MODULE LIST command on Active-Active databases </p> </li> <li> <p> Enhanced validity checks of the input parameters of the CRDB-CLI tool </p> </li> <li> <p> The Syncer lag calculation has been improved and fixes multiple miscalculations </p> </li> <li> <p> Support package includes additional information for Active-Active databases </p> </li> <li> <p> Added the ability to retrieve the syncer mode (centralized / distributed) by running </p> <p> <code> rladmin info db [{db:&lt;id&gt; | &lt;name&gt;}] </code> </p> <p> To learn more, see <a href="/docs/latest/operate/rs/databases/active-active/synchronization-mode/"> Distributed sychronization </a> </p> </li> </ul> <h2 id="version-changes"> Version changes </h2> <h3 id="breaking-changes"> Breaking changes </h3> <p> RS84006 - When using the REST API to create a database, this specific set of conditions can lead to an error: </p> <ul> <li> sharding is enabled </li> <li> oss_sharding and implicit_shard_key are both deactivated </li> <li> A shard_key_regex is <em> not </em> defined </li> </ul> <p> If this occurs, the database endpoint returns <code> (error) ERR key "test" does not match any rule </code> . </p> <p> To address this issue, do one of the following: </p> <ul> <li> Explicitly define shard_key_regex </li> <li> Enable oss_sharding or implicit_shard_key (enabling both also works) </li> </ul> <h3 id="prerequisites-and-notes"> Prerequisites and notes </h3> <ul> <li> <p> You can <a href="/docs/latest/operate/rs/installing-upgrading/upgrading/"> upgrade to v6.2.18 </a> from Redis Enterprise Software v6.0 and later. </p> </li> <li> <p> Refer to <a href="/docs/latest/operate/rs/release-notes/rs-6-2-4-august-2021/"> v6.2.4 release notes </a> for important notes regarding changes made to the upgrade policy and how those changes might impact your experience. </p> </li> <li> <p> Upgrades from versions earlier than v6.0 are not supported. </p> </li> <li> <p> If you plan to upgrade your cluster to RHEL 8, see the <a href="/docs/latest/operate/rs/release-notes/rs-6-2-8-october-2021/"> v6.2.8 release notes </a> for known limitations. </p> </li> </ul> <h3 id="deprecations"> Deprecations </h3> <h4 id="active-active-database-persistence"> Active-Active database persistence </h4> <p> The snapshot option for <a href="/docs/latest/operate/rs/databases/active-active/manage/#data-persistence"> data persistence on Active-Active databases </a> will be deprecated in a future version of Redis Enterprise Software. If you have an Active-Active database using snapshot persistence, we strongly encourage you to switch to AOF persistence. Use <code> crdb-cli </code> to do so: </p> <div class="highlight"> <pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">crdb-cli crdb update --crdb-guid &lt;CRDB_GUID&gt; --default-db-config '{"data_persistence": "aof", "aof_policy":"appendfsync-every-sec"}' </span></span></code></pre> </div> <h4 id="tls-10-and-tls-11"> TLS 1.0 and TLS 1.1 </h4> <p> TLS 1.0 and TLS 1.1 connections are considered deprecated in favor of TLS 1.2 or later. </p> <p> Please verify that all clients, apps, and connections support TLS 1.2. Support for the earlier protocols will be removed in a future release. </p> <p> Certain operating systems, such as RHEL 8, have already removed support for the earlier protocols. Redis Enterprise Software cannot support connection protocols that are not supported by the underlying operating system. </p> <h4 id="3des-encryption-cipher"> 3DES encryption cipher </h4> <p> The 3DES encryption cipher is considered deprecated in favor of stronger ciphers like AES. </p> <p> Please verify that all clients, apps, and connections support the AES cipher. Support for 3DES will be removed in a future release. </p> <p> Certain operating systems, such as RHEL 8, have already removed support for 3DES. Redis Enterprise Software cannot support cipher suites that are not supported by the underlying operating system. </p> <h3 id="product-lifecycle-updates"> Product lifecycle updates </h3> <p> Redis Enterprise Software v6.0.x reached end-of-life (EOL) on May 31, 2022. </p> <p> EOL of Redis Enterprise Software 6.2.x was reset to occur 18 months after the release of version 6.4, in accordance with the updated EOL policy. The new EOL date is August 31, 2024. </p> <p> To learn more, see the Redis Enterprise Software <a href="/docs/latest/operate/rs/installing-upgrading/product-lifecycle/"> product lifecycle </a> , which details the release number and the end-of-life schedule for Redis Enterprise Software. </p> <p> For Redis modules information and lifecycle, see <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/modules-lifecycle/"> Module lifecycle </a> . </p> <h2 id="resolved-issues"> Resolved issues </h2> <ul> <li> RS64002 - Fixes email alerts for LDAP mappings. </li> <li> RS79519 - fixes a bug that prevented Administrators from editing an Active-Active database using the API with username instead of email as their identifier. </li> <li> RS78039 - fixes a bug that caused the sync between two shards to pause when resetting a shard's data which can be when performing full sync or importing an RDB. </li> <li> RS73454 - Updates internal timeouts to enable faster resharding. </li> <li> RS75783 - Fixes failover due to false identification of dead nodes when master node goes down. </li> <li> RS75206, RS52686 - Fixes backup_interval_offset in case where the user chose an offset that is higher than backup_interval; Fixes the UI from resetting backup_interval_offset after manual DB configuration. </li> <li> RS75176 - Fixes rare case of stuck state machine during β€œmaintenance off”. </li> <li> RS57200 - Add an IP address to "failed_authentication_attempt" errors. </li> <li> RS56615 - Changed rladmin tune db db_name max_aof_load_time to receive the value in seconds; Added max_aof_load_time option to rladmin help tune. </li> <li> RS54745 - Fixes the Rest API to reject BDB creation using negative integers as a uid. </li> <li> RS46092 - Fixes rlcheck failure when somaxconn policy is a value other than 1024. </li> <li> RS68965, RS80615 - Adds internode encryption ports 3340-3344 to rlcheck connectivity. </li> <li> RS63302 - Adds umask validation for root user when installing. </li> <li> RS46947 - Fixes removal of old installations in install.sh. </li> </ul> <h2 id="known-limitations"> Known limitations </h2> <h3 id="feature-limitations"> Feature limitations </h3> <ul> <li> <p> RS81463 A shard might crash when resharding an Active-Active database with Auto Tiering . Specifically, the shard will crash when volatile keys or Active-Active tombstone keys reside in Flash memory. </p> </li> <li> <p> RS54131 Running the <code> QUIT </code> command on a TLS connected database closes connection and does not return a <code> +OK </code> reply </p> </li> </ul> <h3 id="upgrade-limitations"> Upgrade limitations </h3> <p> Before you upgrade a cluster that hosts Active-Active databases with modules to v6.2.18, perform the following steps: </p> <ol> <li> <p> Use <code> crdb-cli </code> to verify that the modules ( <code> modules </code> ) and their versions (in <code> module_list </code> ) are as they appear in the database configuration and in the default database configuration: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">crdb-cli crdb get --crdb-guid &lt;crdb-guid&gt; </span></span></code></pre> </div> </li> <li> <p> From the admin console's <strong> redis modules </strong> tab, validate that these modules with their specific versions are loaded to the cluster. </p> </li> <li> <p> If one or more of the modules/versions are missing or if you need help, <a href="https://redis.com/company/support/"> contact Redis support </a> before taking additional steps. </p> </li> </ol> <h2 id="security"> Security </h2> <h4 id="open-source-redis-security-fixes-compatibility"> Open source Redis security fixes compatibility </h4> <p> As part of Redis's commitment to security, Redis Enterprise Software implements the latest <a href="https://github.com/redis/redis/releases"> security fixes </a> available with open source Redis. The following <a href="https://github.com/redis/redis"> Open Source Redis </a> <a href="https://github.com/redis/redis/security/advisories"> CVEs </a> do not affect Redis Enterprise: </p> <ul> <li> <p> <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32625"> CVE-2021-32625 </a> - Redis Enterprise is not impacted by the CVE that was found and fixed in open source Redis since Redis Enterprise does not implement LCS. Additional information about the open source Redis fix is on <a href="https://github.com/redis/redis/releases"> the Redis GitHub page </a> (Redis 6.2.4, Redis 6.0.14) </p> </li> <li> <p> <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32672"> CVE-2021-32672 </a> - Redis Enterprise is not impacted by the CVE that was found and fixed in open source Redis because the LUA debugger is unsupported in Redis Enterprise. Additional information about the open source Redis fix is on <a href="https://github.com/redis/redis/releases"> the Redis GitHub page </a> (Redis 6.2.6, Redis 6.0.16) </p> </li> <li> <p> <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32675"> CVE-2021-32675 </a> - Redis Enterprise is not impacted by the CVE that was found and fixed in open source Redis because the proxy in Redis Enterprise does not forward unauthenticated requests. Additional information about the open source Redis fix is on <a href="https://github.com/redis/redis/releases"> the Redis GitHub page </a> (Redis 6.2.6, Redis 6.0.16) </p> </li> <li> <p> <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32762"> CVE-2021-32762 </a> - Redis Enterprise is not impacted by the CVE that was found and fixed in open source Redis because the memory allocator used in Redis Enterprise is not vulnerable. Additional information about the open source Redis fix is on <a href="https://github.com/redis/redis/releases"> the Redis GitHub page </a> (Redis 6.2.6, Redis 6.0.16) </p> </li> <li> <p> <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-41099"> CVE-2021-41099 </a> - Redis Enterprise is not impacted by the CVE that was found and fixed in open source Redis because the proto-max-bulk-len CONFIG is blocked in Redis Enterprise. Additional information about the open source Redis fix is on <a href="https://github.com/redis/redis/releases"> the Redis GitHub page </a> (Redis 6.2.6, Redis 6.0.16) security fixes for <a href="https://github.com/redis/redis/security/advisories"> recent CVEs </a> . Redis Enterprise has already included the fixes for the relevant CVEs. Some CVEs announced for Open Source Redis do not affect Redis Enterprise due to different and additional functionality available in Redis Enterprise that is not available in Open Source Redis. </p> </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/release-notes/rs-6-2-18-releases/rs-6-2-18-43/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/databases/memory-performance/.html
<section class="prose w-full py-12 max-w-none"> <h1> Memory and performance </h1> <p class="text-lg -mt-5 mb-10"> Learn more about managing your memory and optimizing performance for your database. </p> <p> Redis Enterprise Software has multiple mechanisms in its architecture to help optimize storage and performance. </p> <h2 id="memory-limits"> Memory limits </h2> <p> Database memory limits define the maximum size your database can reach across all database replicas and <a href="/docs/latest/glossary/#letter-s"> shards </a> on the cluster. Your memory limit will also determine the number of shards you'll need. </p> <p> Besides your dataset, the memory limit must also account for replication, Active-Active overhead, and module overhead, and a number of other factors. These can significantly increase your database size, sometimes increasing it by four times or more. </p> <p> For more information on memory limits, see <a href="/docs/latest/operate/rs/7.4/databases/memory-performance/memory-limit/"> Database memory limits </a> . </p> <h2 id="eviction-policies"> Eviction policies </h2> <p> When a database exceeds its memory limit, eviction policies determine which data is removed. The eviction policy removes keys based on frequency of use, how recently used, randomly, expiration date, or a combination of these factors. The policy can also be set to <code> noeviction </code> to return a memory limit error when trying to insert more data. </p> <p> The default eviction policy for databases is <code> volatile-lru </code> which evicts the least recently used keys out of all keys with the <code> expire </code> field set. The default for Active-Active databases is <code> noeviction </code> . </p> <p> For more information, see <a href="/docs/latest/operate/rs/7.4/databases/memory-performance/eviction-policy/"> eviction policies </a> . </p> <h2 id="database-persistence"> Database persistence </h2> <p> Both RAM memory and flash memory are at risk of data loss if a server or process fails. Persisting your data to disk helps protect it against loss in those situations. You can configure persistence at the time of database creation, or by editing the database’s configuration. </p> <p> There are two main types of persistence strategies in Redis Enterprise Software: append-only files (AoF) and snapshots. </p> <p> Append-only files (AoF) keep a record of data changes and writes each change to the end of a file, allowing you to recover the dataset by replaying the writes in the append-only log. </p> <p> Snapshots capture all the data as it exists in one moment in time and writes it to disk, allowing you to recover the entire dataset as it existed at that moment in time. </p> <p> For more info on data persistence see <a href="/docs/latest/operate/rs/7.4/databases/configure/database-persistence/"> Database persistence with Redis Enterprise Software </a> or <a href="https://redis.com/redis-enterprise/technology/durable-redis/"> Durable Redis </a> . </p> <h2 id="auto-tiering"> Auto Tiering </h2> <p> By default, Redis Enterprise Software stores your data entirely in <a href="https://en.wikipedia.org/wiki/Random-access_memory"> RAM </a> for improved performance. The <a href="/docs/latest/operate/rs/7.4/databases/auto-tiering/"> Auto Tiering </a> feature enables your data to span both RAM and <a href="https://en.wikipedia.org/wiki/Solid-state_drive"> SSD </a> storage ( <a href="https://en.wikipedia.org/wiki/Flash_memory"> flash memory </a> ). Keys are always stored in RAM, but Auto Tiering manages the location of their values. Frequently used (hot) values are stored on RAM, but infrequently used (warm) values are moved to flash memory. This saves on expensive RAM space, which give you comparable performance at a lower cost for large datasets. </p> <p> For more info, see <a href="/docs/latest/operate/rs/7.4/databases/auto-tiering/"> Auto Tiering </a> . </p> <h2 id="shard-placement"> Shard placement </h2> <p> The location of the primary and replica shards on the cluster nodes can impact your database performance. Primary shards and their corresponding replica shards are always placed on separate nodes for data resiliency and high availability. The shard placement policy helps to maintain optimal performance and resiliency. </p> <p> Redis Enterprise Software has two shard placement policies available: </p> <ul> <li> <strong> dense </strong> : puts as many shards as possible on the smallest number of nodes </li> <li> <strong> sparse </strong> : spread the shards across as many nodes as possible </li> </ul> <p> For more info about the shard placement policy, see <a href="/docs/latest/operate/rs/7.4/databases/memory-performance/shard-placement-policy/"> Shard placement policy </a> </p> <h2 id="metrics"> Metrics </h2> <p> From the Redis Enterprise Software Cluster Manager UI, you can monitor the performance of your clusters, nodes, databases, and shards with real-time metrics. You can also enable alerts for node, cluster, or database events such as high memory usage or throughput. </p> <p> With the Redis Enterprise Software API, you can also integrate Redis Enterprise metrics into other monitoring environments, such as Prometheus. </p> <p> For more info about monitoring with Redis Enterprise Software, see <a href="/docs/latest/operate/rs/7.4/clusters/monitoring/"> Monitoring with metrics and alerts </a> , and <a href="/docs/latest/operate/rs/7.4/databases/memory-performance/memory-limit/#memory-metrics"> Memory statistics </a> . </p> <h2 id="scaling-databases"> Scaling databases </h2> <p> Each Redis Enterprise cluster can contain multiple databases. In Redis, databases represent data that belong to a single application, tenant, or microservice. Redis Enterprise is built to scale to 100s of databases per cluster to provide flexible and efficient multi-tenancy models. </p> <p> Each database can contain few or many Redis shards. Sharding is transparent to Redis applications. Master shards in the database process data operations for a given subset of keys. The number of shards per database is configurable and depend on the throughput needs of the applications. Databases in Redis Enterprise can be resharded into more Redis shards to scale throughput while maintaining sub-millisecond latencies. Resharding is performed without downtime. </p> <a href="/docs/latest/images/rs/sharding.png" sdata-lightbox="/images/rs/sharding.png"> <img src="/docs/latest/images/rs/sharding.png"/> </a> <p> Redis Enterprise places master shards and replicas in separate nodes, racks, and zones, and uses in-memory replication to protect data against failures. </p> <p> In Redis Enterprise, each database has a quota of RAM. The quota cannot exceed the limits of the RAM available on the node. However, with Redis Enterprise Flash, RAM is extended to the local flash drive (SATA, NVMe SSDs etc). The total quota of the database can take advantage of both RAM and Flash drive. The administrator can choose the RAM vs Flash ratio and adjust that anytime in the lifetime of the database without downtime. </p> <p> With Auto Tiering, instead of storing all keys and data for a given shard in RAM, less frequently accessed values are pushed to flash. If applications need to access a value that is in flash, Redis Enterprise automatically brings the value into RAM. Depending on the flash hardware in use, applications experience slightly higher latency when bringing values back into RAM from flash. However subsequent accesses to the same value is fast, once the value is in RAM. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/databases/memory-performance/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/develop/tools/insight/release-notes/v.2.4.0/.html
<section class="prose w-full py-12"> <h1> RedisInsight v2.4.0, June 2022 </h1> <p class="text-lg -mt-5 mb-10"> RedisInsight v2.4.0 </p> <h2 id="240-june-2022"> 2.4.0 (June 2022) </h2> <p> This is the General Availability (GA) release of RedisInsight 2.4.0 </p> <h3 id="headlines"> Headlines: </h3> <ul> <li> Pub/Sub: Added support for <a href="https://redis.io/docs/manual/pubsub/"> Redis pub/sub </a> enabling subscription to channels and posting messages to channels. </li> <li> Consumer groups: Added support for <a href="https://redis.io/docs/manual/data-types/streams/#consumer-groups"> streams consumer groups </a> enabling provision of different subsets of messages from the same stream to many clients for inspection and processing. </li> <li> Database search: Search the list of databases added to RedisInsight to quickly find the required database. </li> </ul> <h3 id="details"> Details </h3> <p> <strong> Features and improvements: </strong> </p> <ul> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/760"> #760 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/737"> #737 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/773"> #773 </a> Added support for <a href="https://redis.io/docs/manual/pubsub/"> Redis pub/sub </a> enabling subscription to channels and posting messages to channels. Currently does not support sharded channels. </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/717"> #717 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/683"> #683 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/684"> #684 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/688"> #688 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/720"> #720 </a> , Added support for <a href="https://redis.io/docs/manual/data-types/streams/#consumer-groups"> streams consumer groups </a> to manage different groups and consumers for the same stream, explicit acknowledgment of processed items, ability to inspect the pending items, claiming of unprocessed messages, and coherent history visibility for each single client. </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/754"> #754 </a> New <strong> All Relationship </strong> toggle for RedisGraph visualizations in <strong> Workbench </strong> . Enable it to see all relationships between your nodes. </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/788"> #788 </a> Quickly search the list of databases added to RedisInsight per database alias, host:port, or the last connection to find the database needed. </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/788"> #788 </a> Overview displays the number of keys per the logical database connected if this number is not equal to the total number in the database. </li> </ul> <p> <strong> Bugs Fixed: </strong> </p> <ul> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/774"> #774 </a> Fixed cases when not all parameters are received in Overview. </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/810"> #810 </a> Display several streams values with the same timestamp. </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/tools/insight/release-notes/v.2.4.0/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/incr/.html
<section class="prose w-full py-12"> <h1 class="command-name"> INCR </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">INCR key</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 1.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @write </code> <span class="mr-1 last:hidden"> , </span> <code> @string </code> <span class="mr-1 last:hidden"> , </span> <code> @fast </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Increments the number stored at <code> key </code> by one. If the key does not exist, it is set to <code> 0 </code> before performing the operation. An error is returned if the key contains a value of the wrong type or contains a string that can not be represented as integer. This operation is limited to 64 bit signed integers. </p> <p> <strong> Note </strong> : this is a string operation because Redis does not have a dedicated integer type. The string stored at the key is interpreted as a base-10 <strong> 64 bit signed integer </strong> to execute the operation. </p> <p> Redis stores integers in their integer representation, so for string values that actually hold an integer, there is no overhead for storing the string representation of the integer. </p> <h2 id="examples"> Examples </h2> <div class="codetabs cli group flex justify-start items-center flex-wrap box-border rounded-lg mt-0 mb-0 mx-auto bg-slate-900" id="cmds_string-stepincr"> <input checked="" class="radiotab w-0 h-0" data-lang="redis-cli" id="redis-cli_cmds_string-stepincr" name="cmds_string-stepincr" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="redis-cli_cmds_string-stepincr" title="Open example"> &gt;_ Redis CLI </label> <div aria-labelledby="tab-cmds_string-stepincr" class="panel order-last hidden w-full mt-0 relative" id="panel_redis-cli_cmds_string-stepincr" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-plaintext" data-lang="plaintext"><span class="line hl"><span class="cl">&gt; SET mykey "10" </span></span><span class="line hl"><span class="cl">"OK" </span></span><span class="line hl"><span class="cl">&gt; INCR mykey </span></span><span class="line hl"><span class="cl">(integer) 11 </span></span><span class="line hl"><span class="cl">&gt; GET mykey </span></span><span class="line hl"><span class="cl">"11"</span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_redis-cli_cmds_string-stepincr')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <div class="flex-1 text-xs text-white overflow-ellipsis"> Are you tired of using redis-cli? Try Redis Insight - the developer GUI for Redis. </div> <div class="text-right"> <a class="rounded rounded-mx px-2 py-1 flex items-center text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.com/redis-enterprise/redis-insight/" tabindex="1" title="Get Redis Insight"> <svg class="w-4 h-4 mr-1" fill="none" height="14" viewbox="0 0 14 14" width="14" xmlns="http://www.w3.org/2000/svg"> <path d="M2.26236 5.66895L1.21732 6.07172L7.00018 8.65693V7.79842L2.26236 5.66895Z" fill="#fca5a5"> </path> <path d="M2.26236 8.02271L1.21732 8.42548L7.00018 11.0119V10.1516L2.26236 8.02271Z" fill="#fca5a5"> </path> <path d="M1.21732 3.7175L7.00018 6.30392V2.87805L8.66273 2.13423L7.00018 1.49512L1.21732 3.7175Z" fill="#fca5a5"> </path> <path d="M7.00018 2.8781V6.30366L1.21732 3.71724V5.20004L7.00018 7.79705V8.65526L1.21732 6.07217V7.55496L7.00018 10.1553V11.0135L1.21732 8.42376V9.90656H1.18878L7.00018 12.5051L8.66273 11.7613V2.13428L7.00018 2.8781Z" fill="#f87171"> </path> <path d="M9.07336 11.5777L10.7359 10.8338V4.01538L9.07336 4.7592V11.5777Z" fill="#f87171"> </path> <path d="M9.07336 4.75867L10.7359 4.01485L9.07336 3.37573V4.75867Z" fill="#fca5a5"> </path> <path d="M11.1481 10.6497L12.8112 9.90591V5.896L11.1487 6.63982L11.1481 10.6497Z" fill="#f87171"> </path> <path d="M11.1481 6.63954L12.8112 5.89572L11.1481 5.25781V6.63954Z" fill="#fca5a5"> </path> </svg> <span> Get Redis Insight </span> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="python" id="Python_cmds_string-stepincr" name="cmds_string-stepincr" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Python_cmds_string-stepincr" title="Open example"> Python </label> <div aria-labelledby="tab-cmds_string-stepincr" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_cmds_string-stepincr" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">r</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">Redis</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s2">"localhost"</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">6379</span><span class="p">,</span> <span class="n">db</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"mykey"</span><span class="p">,</span> <span class="s2">"10"</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt; True</span> </span></span><span class="line hl"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">incr</span><span class="p">(</span><span class="s2">"mykey"</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Python_cmds_string-stepincr')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Python_cmds_string-stepincr" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/python/redis-py/" tabindex="1" title="Quick-Start"> Python Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/redis-py/tree/master/doctests/cmds_string.py" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="javascript" id="Nodejs_cmds_string-stepincr" name="cmds_string-stepincr" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Nodejs_cmds_string-stepincr" title="Open example"> Node.js </label> <div aria-labelledby="tab-cmds_string-stepincr" class="panel order-last hidden w-full mt-0 relative" id="panel_Nodejs_cmds_string-stepincr" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-javascript" data-lang="javascript"><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="p">{</span> <span class="nx">createClient</span> <span class="p">}</span> <span class="nx">from</span> <span class="s1">'redis'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">client</span> <span class="o">=</span> <span class="nx">createClient</span><span class="p">();</span> </span></span><span class="line"><span class="cl"><span class="nx">client</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">'error'</span><span class="p">,</span> <span class="nx">err</span> <span class="p">=&gt;</span> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">'Redis Client Error'</span><span class="p">,</span> <span class="nx">err</span><span class="p">));</span> </span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">connect</span><span class="p">().</span><span class="k">catch</span><span class="p">(</span><span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s2">"mykey"</span><span class="p">,</span> <span class="s2">"10"</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">value1</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">incr</span><span class="p">(</span><span class="s2">"mykey"</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">value1</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"><span class="c1">// returns 11 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">quit</span><span class="p">();</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Nodejs_cmds_string-stepincr')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Nodejs_cmds_string-stepincr" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/nodejs/" tabindex="1" title="Quick-Start"> Node.js Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/node-redis/tree/emb-examples/doctests/cmds-string.js" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="java" id="Java_cmds_string-stepincr" name="cmds_string-stepincr" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Java_cmds_string-stepincr" title="Open example"> Java </label> <div aria-labelledby="tab-cmds_string-stepincr" class="panel order-last hidden w-full mt-0 relative" id="panel_Java_cmds_string-stepincr" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.UnifiedJedis</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kd">public</span> <span class="kd">class</span> <span class="nc">CmdsStringExample</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="kd">public</span> <span class="kt">void</span> <span class="nf">run</span><span class="o">()</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">UnifiedJedis</span> <span class="n">jedis</span> <span class="o">=</span> <span class="k">new</span> <span class="n">UnifiedJedis</span><span class="o">(</span><span class="s">"redis://localhost:6379"</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="n">String</span> <span class="n">incrResult1</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">set</span><span class="o">(</span><span class="s">"mykey"</span><span class="o">,</span> <span class="s">"10"</span><span class="o">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">incrResult1</span><span class="o">);</span> <span class="c1">// &gt;&gt;&gt; OK </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"> <span class="kt">long</span> <span class="n">incrResult2</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">incr</span><span class="o">(</span><span class="s">"mykey"</span><span class="o">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">incrResult2</span><span class="o">);</span> <span class="c1">// &gt;&gt;&gt; 11 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"> <span class="n">String</span> <span class="n">incrResult3</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"mykey"</span><span class="o">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">incrResult3</span><span class="o">);</span> <span class="c1">// &gt;&gt;&gt; 11 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'incr' step. </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="o">}</span> </span></span><span class="line"><span class="cl"><span class="o">}</span> </span></span><span class="line"><span class="cl"> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Java_cmds_string-stepincr')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Java_cmds_string-stepincr" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/java/jedis/" tabindex="1" title="Quick-Start"> Java Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/jedis/tree/master/src/test/java/io/redis/examples/CmdsStringExample.java" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="go" id="Go_cmds_string-stepincr" name="cmds_string-stepincr" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Go_cmds_string-stepincr" title="Open example"> Go </label> <div aria-labelledby="tab-cmds_string-stepincr" class="panel order-last hidden w-full mt-0 relative" id="panel_Go_cmds_string-stepincr" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="kn">package</span> <span class="nx">example_commands_test</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"context"</span> </span></span><span class="line"><span class="cl"> <span class="s">"fmt"</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">"github.com/redis/go-redis/v9"</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kd">func</span> <span class="nf">ExampleClient_cmd_incr</span><span class="p">()</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">ctx</span> <span class="o">:=</span> <span class="nx">context</span><span class="p">.</span><span class="nf">Background</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nx">rdb</span> <span class="o">:=</span> <span class="nx">redis</span><span class="p">.</span><span class="nf">NewClient</span><span class="p">(</span><span class="o">&amp;</span><span class="nx">redis</span><span class="p">.</span><span class="nx">Options</span><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">Addr</span><span class="p">:</span> <span class="s">"localhost:6379"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">Password</span><span class="p">:</span> <span class="s">""</span><span class="p">,</span> <span class="c1">// no password docs </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="nx">DB</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1">// use default DB </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="p">})</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="nx">incrResult1</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">Set</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"mykey"</span><span class="p">,</span> <span class="s">"10"</span><span class="p">,</span> <span class="mi">0</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="p">}</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">incrResult1</span><span class="p">)</span> <span class="c1">// &gt;&gt;&gt; OK </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"> <span class="nx">incrResult2</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">Incr</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"mykey"</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="p">}</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">incrResult2</span><span class="p">)</span> <span class="c1">// &gt;&gt;&gt; 11 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"> <span class="nx">incrResult3</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">Get</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"mykey"</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="p">}</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">incrResult3</span><span class="p">)</span> <span class="c1">// &gt;&gt;&gt; 11 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Go_cmds_string-stepincr')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Go_cmds_string-stepincr" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/go/" tabindex="1" title="Quick-Start"> Go Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/go-redis/tree/master/doctests/cmds_string_test.go" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="dotnet" id="Csharp_cmds_string-stepincr" name="cmds_string-stepincr" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Csharp_cmds_string-stepincr" title="Open example"> C# </label> <div aria-labelledby="tab-cmds_string-stepincr" class="panel order-last hidden w-full mt-0 relative" id="panel_Csharp_cmds_string-stepincr" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-C#" data-lang="C#"><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.Tests</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">StackExchange.Redis</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">public</span> <span class="k">class</span> <span class="nc">CmdsStringExample</span> </span></span><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">public</span> <span class="k">void</span> <span class="n">run</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">muxer</span> <span class="p">=</span> <span class="n">ConnectionMultiplexer</span><span class="p">.</span><span class="n">Connect</span><span class="p">(</span><span class="s">"localhost:6379"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">db</span> <span class="p">=</span> <span class="n">muxer</span><span class="p">.</span><span class="n">GetDatabase</span><span class="p">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'append1' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'append2' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'decr' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'decrby' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'get' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'getdel' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'getex' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'getrange' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'getset' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="kt">bool</span> <span class="n">incrResult1</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">StringSet</span><span class="p">(</span><span class="s">"mykey"</span><span class="p">,</span> <span class="s">"10"</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">incrResult1</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; true</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="kt">long</span> <span class="n">incrResult2</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">StringIncrement</span><span class="p">(</span><span class="s">"mykey"</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">incrResult2</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 11</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="n">RedisValue</span> <span class="n">incrResult3</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">StringGet</span><span class="p">(</span><span class="s">"mykey"</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">incrResult3</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 11</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'incr' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'incrby' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'incrbyfloat' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'lcs1' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'lcs2' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'lcs3' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'lcs4' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'lcs5' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'mget' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'mset' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'msetnx' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'psetex' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'set' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'setex' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'setnx' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'setrange1' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'setrange2' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'strlen' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'substr' step.</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span><span class="line"><span class="cl"> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Csharp_cmds_string-stepincr')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Csharp_cmds_string-stepincr" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/dotnet/" tabindex="1" title="Quick-Start"> C# Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/NRedisStack/tree/master/tests/Doc/CmdsStringExample.cs" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> </div> <p> Give this command a try in the interactive console: </p> <div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex"> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z"> </path> </svg> </div> <form class="redis-cli overflow-y-auto max-h-80"> <pre tabindex="0">redis&gt; SET mykey "10" "OK" redis&gt; INCR mykey (integer) 11 redis&gt; GET mykey "11" </pre> <div class="prompt" style=""> <span> redis&gt; </span> <input autocomplete="off" name="prompt" spellcheck="false" type="text"/> </div> </form> <h2 id="pattern-counter"> Pattern: Counter </h2> <p> The counter pattern is the most obvious thing you can do with Redis atomic increment operations. The idea is simply send an <code> INCR </code> command to Redis every time an operation occurs. For instance in a web application we may want to know how many page views this user did every day of the year. </p> <p> To do so the web application may simply increment a key every time the user performs a page view, creating the key name concatenating the User ID and a string representing the current date. </p> <p> This simple pattern can be extended in many ways: </p> <ul> <li> It is possible to use <code> INCR </code> and <a href="/docs/latest/commands/expire/"> <code> EXPIRE </code> </a> together at every page view to have a counter counting only the latest N page views separated by less than the specified amount of seconds. </li> <li> A client may use GETSET in order to atomically get the current counter value and reset it to zero. </li> <li> Using other atomic increment/decrement commands like <a href="/docs/latest/commands/decr/"> <code> DECR </code> </a> or <a href="/docs/latest/commands/incrby/"> <code> INCRBY </code> </a> it is possible to handle values that may get bigger or smaller depending on the operations performed by the user. Imagine for instance the score of different users in an online game. </li> </ul> <h2 id="pattern-rate-limiter"> Pattern: Rate limiter </h2> <p> The rate limiter pattern is a special counter that is used to limit the rate at which an operation can be performed. The classical materialization of this pattern involves limiting the number of requests that can be performed against a public API. </p> <p> We provide two implementations of this pattern using <code> INCR </code> , where we assume that the problem to solve is limiting the number of API calls to a maximum of <em> ten requests per second per IP address </em> . </p> <h2 id="pattern-rate-limiter-1"> Pattern: Rate limiter 1 </h2> <p> The more simple and direct implementation of this pattern is the following: </p> <pre tabindex="0"><code>FUNCTION LIMIT_API_CALL(ip) ts = CURRENT_UNIX_TIME() keyname = ip+":"+ts MULTI INCR(keyname) EXPIRE(keyname,10) EXEC current = RESPONSE_OF_INCR_WITHIN_MULTI IF current &gt; 10 THEN ERROR "too many requests per second" ELSE PERFORM_API_CALL() END </code></pre> <p> Basically we have a counter for every IP, for every different second. But these counters are always incremented setting an expire of 10 seconds so that they'll be removed by Redis automatically when the current second is a different one. </p> <p> Note the used of <a href="/docs/latest/commands/multi/"> <code> MULTI </code> </a> and <a href="/docs/latest/commands/exec/"> <code> EXEC </code> </a> in order to make sure that we'll both increment and set the expire at every API call. </p> <h2 id="pattern-rate-limiter-2"> Pattern: Rate limiter 2 </h2> <p> An alternative implementation uses a single counter, but is a bit more complex to get it right without race conditions. We'll examine different variants. </p> <pre tabindex="0"><code>FUNCTION LIMIT_API_CALL(ip): current = GET(ip) IF current != NULL AND current &gt; 10 THEN ERROR "too many requests per second" ELSE value = INCR(ip) IF value == 1 THEN EXPIRE(ip,1) END PERFORM_API_CALL() END </code></pre> <p> The counter is created in a way that it only will survive one second, starting from the first request performed in the current second. If there are more than 10 requests in the same second the counter will reach a value greater than 10, otherwise it will expire and start again from 0. </p> <p> <strong> In the above code there is a race condition </strong> . If for some reason the client performs the <code> INCR </code> command but does not perform the <a href="/docs/latest/commands/expire/"> <code> EXPIRE </code> </a> the key will be leaked until we'll see the same IP address again. </p> <p> This can be fixed easily turning the <code> INCR </code> with optional <a href="/docs/latest/commands/expire/"> <code> EXPIRE </code> </a> into a Lua script that is send using the <a href="/docs/latest/commands/eval/"> <code> EVAL </code> </a> command (only available since Redis version 2.6). </p> <pre tabindex="0"><code>local current current = redis.call("incr",KEYS[1]) if current == 1 then redis.call("expire",KEYS[1],1) end </code></pre> <p> There is a different way to fix this issue without using scripting, by using Redis lists instead of counters. The implementation is more complex and uses more advanced features but has the advantage of remembering the IP addresses of the clients currently performing an API call, that may be useful or not depending on the application. </p> <pre tabindex="0"><code>FUNCTION LIMIT_API_CALL(ip) current = LLEN(ip) IF current &gt; 10 THEN ERROR "too many requests per second" ELSE IF EXISTS(ip) == FALSE MULTI RPUSH(ip,ip) EXPIRE(ip,1) EXEC ELSE RPUSHX(ip,ip) END PERFORM_API_CALL() END </code></pre> <p> The <a href="/docs/latest/commands/rpushx/"> <code> RPUSHX </code> </a> command only pushes the element if the key already exists. </p> <p> Note that we have a race here, but it is not a problem: <a href="/docs/latest/commands/exists/"> <code> EXISTS </code> </a> may return false but the key may be created by another client before we create it inside the <a href="/docs/latest/commands/multi/"> <code> MULTI </code> </a> / <a href="/docs/latest/commands/exec/"> <code> EXEC </code> </a> block. However this race will just miss an API call under rare conditions, so the rate limiting will still work correctly. </p> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : the value of the key after the increment. <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/incr/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/installing-upgrading/install/prepare-install/download-install-package/.html
<section class="prose w-full py-12 max-w-none"> <h1> Download a Redis Enterprise Software installation package </h1> <p class="text-lg -mt-5 mb-10"> Download a Redis Enterprise Software installation package. </p> <p> To download the installation package for any of the supported platforms: </p> <ol> <li> Go to the <a href="https://cloud.redis.io/#/rlec-downloads"> Redis download page </a> . </li> <li> Sign in with your Redis credentials or create a new account. </li> <li> In the <strong> Downloads </strong> section for Redis Enterprise Software, select the installation package for your platform then select <strong> Go </strong> . </li> </ol> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> Before you install the Linux package or AWS AMI on an AWS EC2 instance, review the <a href="/docs/latest/operate/rs/7.4/installing-upgrading/install/plan-deployment/configuring-aws-instances/"> configuration requirements for AWS EC2 instances </a> . </div> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/installing-upgrading/install/prepare-install/download-install-package/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/ts.queryindex/.html
<section class="prose w-full py-12"> <h1 class="command-name"> TS.QUERYINDEX </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">TS.QUERYINDEX filterExpr... </pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available in: </dt> <dd class="m-0"> <a href="/docs/stack"> Redis Stack </a> / <a href="/docs/data-types/timeseries"> TimeSeries 1.0.0 </a> </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(n) where n is the number of time-series that match the filters </dd> </dl> <p> Get all time series keys matching a filter list </p> <p> <a href="#examples"> Examples </a> </p> <h2 id="required-arguments"> Required arguments </h2> <details open=""> <summary> <code> filterExpr... </code> </summary> <p> filters time series based on their labels and label values. Each filter expression has one of the following syntaxes: </p> <ul> <li> <code> label!= </code> - the time series has a label named <code> label </code> </li> <li> <code> label=value </code> - the time series has a label named <code> label </code> with a value equal to <code> value </code> </li> <li> <code> label=(value1,value2,...) </code> - the time series has a label named <code> label </code> with a value equal to one of the values in the list </li> <li> <code> label= </code> - the time series does not have a label named <code> label </code> </li> <li> <code> label!=value </code> - the time series does not have a label named <code> label </code> with a value equal to <code> value </code> </li> <li> <code> label!=(value1,value2,...) </code> - the time series does not have a label named <code> label </code> with a value equal to any of the values in the list </li> </ul> <p> <note> <b> Notes: </b> </note> </p> <ul> <li> At least one filter expression with a syntax <code> label=value </code> or <code> label=(value1,value2,...) </code> is required. </li> <li> Filter expressions are conjunctive. For example, the filter <code> type=temperature room=study </code> means that a time series is a temperature time series of a study room. </li> <li> Whitespaces are unallowed in a filter expression except between quotes or double quotes in values - e.g., <code> x="y y" </code> or <code> x='(y y,z z)' </code> . </li> </ul> </details> <p> <note> <b> Note: </b> The <code> QUERYINDEX </code> command cannot be part of a transaction when running on a Redis cluster. </note> </p> <h2 id="return-value"> Return value </h2> <p> Returns one of these replies: </p> <ul> <li> <a href="/docs/latest/develop/reference/protocol-spec/#arrays"> Array reply </a> where each element is a <a href="/docs/latest/develop/reference/protocol-spec/#bulk-strings"> Bulk string reply </a> : a time series key. The array is empty if no time series matches the filter. </li> <li> [] (e.g., on invalid filter expression) </li> </ul> <h2 id="examples"> Examples </h2> <details open=""> <summary> <b> Find keys by location and sensor type </b> </summary> <p> Create a set of sensors to measure temperature and humidity in your study and kitchen. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.CREATE telemetry:study:temperature LABELS room study <span class="nb">type</span> temperature </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.CREATE telemetry:study:humidity LABELS room study <span class="nb">type</span> humidity </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.CREATE telemetry:kitchen:temperature LABELS room kitchen <span class="nb">type</span> temperature </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.CREATE telemetry:kitchen:humidity LABELS room kitchen <span class="nb">type</span> humidity </span></span><span class="line"><span class="cl">OK</span></span></code></pre> </div> <p> Retrieve keys of all time series representing sensors located in the kitchen. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.QUERYINDEX <span class="nv">room</span><span class="o">=</span>kitchen </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="s2">"telemetry:kitchen:humidity"</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"telemetry:kitchen:temperature"</span></span></span></code></pre> </div> <p> To retrieve the keys of all time series representing sensors that measure temperature, use this query: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.QUERYINDEX <span class="nv">type</span><span class="o">=</span>temperature </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="s2">"telemetry:kitchen:temperature"</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"telemetry:study:temperature"</span></span></span></code></pre> </div> </details> <h2 id="see-also"> See also </h2> <p> <a href="/docs/latest/commands/ts.create/"> <code> TS.CREATE </code> </a> | <a href="/docs/latest/commands/ts.mrange/"> <code> TS.MRANGE </code> </a> | <a href="/docs/latest/commands/ts.mrevrange/"> <code> TS.MREVRANGE </code> </a> | <a href="/docs/latest/commands/ts.mget/"> <code> TS.MGET </code> </a> </p> <h2 id="related-topics"> Related topics </h2> <p> <a href="/docs/latest/develop/data-types/timeseries/"> RedisTimeSeries </a> </p> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/ts.queryindex/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rc/databases/configuration/active-active-redis/.html
<section class="prose w-full py-12 max-w-none"> <h1> Active-Active Redis </h1> <p class="text-lg -mt-5 mb-10"> Overview of the Active-Active feature for Redis Cloud. </p> <p> Active-Active databases store data across multiple regions and availability zones. This improves scalability, performance, and availability, especially when compared to standalone databases. </p> <p> To create Active-Active databases, you need a Redis Cloud Pro subscription that enables Active-Active Redis and defines the regions for each copy of your databases. See <a href="/docs/latest/operate/rc/databases/create-database/create-active-active-database/"> Create an Active-Active database </a> for instructions. </p> <p> Active-Active databases are distributed across multiple regions (geo-distribution). This improves performance by reducing latency for nearby users and improves availability by protecting against data loss in case of network or resource failure. </p> <p> Active-Active databases allow read and write operations in each copy. Each copy eventually reflects changes made in other copies ( <a href="/docs/latest/glossary/#eventual-consistency"> eventual consistency </a> ). Conflict-free data types (CRDTs) synchronize read and write operations between copies. CRDTs ensure consistency and resolve conflicts. </p> <p> When developing for Active-Active databases, you need to consider some important differences. See <a href="/docs/latest/operate/rs/databases/active-active/develop/"> Develop applications with Active-Active databases </a> for related information. </p> <h2 id="active-active-geo-distributed-replication-highlights"> Active-Active geo-distributed replication highlights </h2> <h3 id="multi-zone"> Multi-zone </h3> <p> Geo-distributed replication maintains copies of both primary and replica shards in multiple clusters. These clusters can be spread across multiple availability zones. Active-Active Redis uses zone awareness to spread your primary and replica shards across zones, which helps protect against data loss from regional outages. </p> <h3 id="local-latency-with-unique-endpoints"> Local latency with unique endpoints </h3> <p> Applications can connect to a specific copy of an Active-Active database using its unique endpoint. For local latency, configure your application to use a database endpoint in the closest region. </p> <h3 id="conflict-resolution"> Conflict resolution </h3> <p> Active-Active databases use special data types called conflict-free data types (CRDT). These automatically resolve conflicts that occur when writes are made to different clusters at the same time. </p> <h3 id="failover-handling"> Failover handling </h3> <p> After a failure at the process, node, or zone level, Active-Active databases automatically promote replica shards to replace failed primaries, copy data to new replica shards, and migrate shards to new nodes as needed. This reduces downtime and makes the most of your computing resources, even in the event of a failure. </p> <p> Active-Active also provides a failover opportunity in case an entire cluster fails. Applications should redirect traffic to another cluster in the Active-Active deployment if a connected cluster fails. After the original cluster recovers, applications can direct traffic back to the original cluster. Redirecting traffic to alternate clusters is not handled automatically by Active-Active, so you must add redirection logic to the application. However, data automatically syncs to a recovered cluster when it returns to a healthy state. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rc/databases/configuration/active-active-redis/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/georadiusbymember_ro/.html
<section class="prose w-full py-12"> <h1 class="command-name"> GEORADIUSBYMEMBER_RO <span class="text-base"> (deprecated) </span> </h1> <div class="border-l-8 pl-4"> <p> As of Redis version 6.2.0, this command is regarded as deprecated. </p> <p> It can be replaced by <a href="/docs/latest/commands/geosearch/"> <code> GEOSEARCH </code> </a> with the <code> BYRADIUS </code> and <code> FROMMEMBER </code> arguments when migrating or writing new code. </p> </div> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">GEORADIUSBYMEMBER_RO key member radius &lt;m | km | ft | mi&gt; [WITHCOORD] [WITHDIST] [WITHHASH] [COUNTΒ count [ANY]] [ASC | DESC]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 3.2.10 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> 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. </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @read </code> <span class="mr-1 last:hidden"> , </span> <code> @geo </code> <span class="mr-1 last:hidden"> , </span> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Read-only variant of the <a href="/docs/latest/commands/georadiusbymember/"> <code> GEORADIUSBYMEMBER </code> </a> command. </p> <p> This command is identical to the <a href="/docs/latest/commands/georadiusbymember/"> <code> GEORADIUSBYMEMBER </code> </a> command, except that it doesn't support the optional <code> STORE </code> and <code> STOREDIST </code> parameters. </p> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <p> One of the following: </p> <ul> <li> If no <code> WITH* </code> option is specified, an <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> of matched member names </li> <li> If <code> WITHCOORD </code> , <code> WITHDIST </code> , or <code> WITHHASH </code> options are specified, the command returns an <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> of arrays, where each sub-array represents a single item: <ul> <li> The distance from the center as a floating point number, in the same unit specified in the radius. </li> <li> The Geohash integer. </li> <li> The coordinates as a two items x,y array (longitude,latitude). </li> </ul> </li> </ul> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/georadiusbymember_ro/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-105/.html
<section class="prose w-full py-12 max-w-none"> <h1> Redis Enterprise Software release notes 7.2.4-105 (February 2024) </h1> <p class="text-lg -mt-5 mb-10"> LDAP authentication timeout is configurable using the REST API. RHEL 8.9 support. </p> <p> This is a maintenance release for ​ <a href="https://redis.com/redis-enterprise-software/download-center/software/"> ​Redis Enterprise Software version 7.2.4 </a> . </p> <h2 id="highlights"> Highlights </h2> <p> This version offers: </p> <ul> <li> <p> Configurable LDAP authentication timeout </p> </li> <li> <p> RHEL 8.9 support </p> </li> </ul> <h2 id="new-in-this-release"> New in this release </h2> <h3 id="enhancements"> Enhancements </h3> <ul> <li> <p> LDAP authentication timeout <code> directory_timeout_s </code> is now configurable using a <a href="/docs/latest/operate/rs/references/rest-api/requests/cluster/ldap/#put-cluster-ldap"> <code> PUT /v1/cluster/ldap </code> </a> REST API request. </p> </li> <li> <p> Added support for RHEL 8.9. </p> </li> </ul> <h4 id="redis-modules"> Redis modules </h4> <p> Redis Enterprise Software versions 7.2.4-105 includes the following Redis Stack modules: </p> <ul> <li> <p> <a href="https://github.com/RediSearch/RediSearch/releases/tag/v2.8.9"> RediSearch 2.8.9 </a> </p> </li> <li> <p> <a href="https://github.com/RedisJSON/RedisJSON/releases/tag/v2.6.6"> RedisJSON 2.6.6 </a> </p> </li> <li> <p> <a href="https://github.com/RedisTimeSeries/RedisTimeSeries/releases/tag/v1.10.6"> RedisTimeSeries 1.10.6 </a> </p> </li> <li> <p> <a href="https://github.com/RedisBloom/RedisBloom/releases/tag/v2.6.11"> RedisBloom 2.6.11 </a> </p> </li> <li> <p> <a href="https://github.com/RedisGears/RedisGears/releases/tag/v2.0.17-m18"> RedisGears 2.0.17 </a> </p> </li> </ul> <h3 id="resolved-issues"> Resolved issues </h3> <ul> <li> <p> RS106070: Cluster upgrade will fail and display an error to the user after a timeout is exceeded. </p> </li> <li> <p> RS107974: Increased retry count for join requests in case the local CCS isn’t available. </p> </li> <li> <p> RS118229: Fixed an issue in the new Cluster Manager UI where a database could not be scaled up to use the maximum shards available for a trial license. </p> </li> </ul> <h2 id="version-changes"> Version changes </h2> <h3 id="supported-platforms"> Supported platforms </h3> <p> The following table provides a snapshot of supported platforms as of this Redis Enterprise Software release. See the <a href="/docs/latest/operate/rs/references/supported-platforms/"> supported platforms reference </a> for more details about operating system compatibility. </p> <p> <span title="Check mark icon"> βœ… </span> Supported – The platform is supported for this version of Redis Enterprise Software. </p> <p> <span title="Warning icon"> ⚠️ </span> Deprecated – The platform is still supported for this version of Redis Enterprise Software, but support will be removed in a future release. </p> <p> <span title="X icon"> ❌ </span> End of life – Platform support ended in this version of Redis Enterprise Software. </p> <table> <thead> <tr> <th> Redis Enterprise </th> <th> 7.2.4 </th> <th> 6.4.2 </th> <th> 6.2.18 </th> <th> 6.2.12 </th> <th> 6.2.10 </th> <th> 6.2.8 </th> <th> 6.2.4 </th> </tr> </thead> <tbody> <tr> <td> <strong> Release date </strong> </td> <td> Aug <br/> 2023 </td> <td> Feb <br/> 2023 </td> <td> Sept <br/> 2022 </td> <td> Aug <br/> 2022 </td> <td> Feb <br/> 2022 </td> <td> Oct <br/> 2021 </td> <td> Aug <br/> 2021 </td> </tr> <tr> <td> <a href="/docs/latest/operate/rs/installing-upgrading/product-lifecycle/#endoflife-schedule"> <strong> End-of-life date </strong> </a> </td> <td> – </td> <td> Feb <br/> 2025 </td> <td> Aug <br/> 2024 </td> <td> Aug <br/> 2024 </td> <td> Aug <br/> 2024 </td> <td> Aug <br/> 2024 </td> <td> Aug <br/> 2024 </td> </tr> <tr> <td> <strong> Ubuntu </strong> <sup> <a href="#table-note-1"> 1 </a> </sup> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 20.04 </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> <sup> <a href="#table-note-6"> 6 </a> </sup> </td> <td> – </td> <td> – </td> <td> – </td> <td> – </td> <td> – </td> </tr> <tr> <td> 18.04 </td> <td> <span title="Deprecated"> ⚠️ </span> </td> <td> <span title="Supported"> <span title="Supported"> βœ… </span> </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> </tr> <tr> <td> 16.04 </td> <td> <span title="End of life"> ❌ </span> </td> <td> <span title="Deprecated"> ⚠️ </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> </tr> <tr> <td> <strong> RHEL &amp; CentOS </strong> <sup> <a href="#table-note-2"> 2 </a> </sup> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 8.9 </td> <td> <span title="Supported"> βœ… </span> <sup> <a href="#table-note-9"> 9 </a> </sup> </td> <td> – </td> <td> – </td> <td> – </td> <td> – </td> <td> – </td> <td> – </td> </tr> <tr> <td> 8.8 </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> <sup> <a href="#table-note-8"> 8 </a> </sup> </td> <td> – </td> <td> – </td> <td> – </td> <td> – </td> <td> – </td> </tr> <tr> <td> 8.7 </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> – </td> <td> – </td> <td> – </td> <td> – </td> <td> – </td> </tr> <tr> <td> 8.5-8.6 </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> – </td> <td> – </td> </tr> <tr> <td> 8.0-8.4 </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> – </td> </tr> <tr> <td> 7.0-7.9 </td> <td> <span title="Deprecated"> ⚠️ </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> </tr> <tr> <td> <strong> Oracle Linux </strong> <sup> <a href="#table-note-3"> 3 </a> </sup> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 8 </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> – </td> <td> – </td> </tr> <tr> <td> 7 </td> <td> <span title="Deprecated"> ⚠️ </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> </tr> <tr> <td> <strong> Rocky Linux </strong> <sup> <a href="#table-note-3"> 3 </a> </sup> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 8 </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> – </td> <td> – </td> <td> – </td> <td> – </td> </tr> <tr> <td> <strong> Amazon Linux </strong> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 2 </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> <sup> <a href="#table-note-7"> 7 </a> </sup> </td> <td> – </td> <td> – </td> <td> – </td> <td> – </td> <td> – </td> </tr> <tr> <td> 1 </td> <td> <span title="Deprecated"> ⚠️ </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> </tr> <tr> <td> <strong> Docker </strong> <sup> <a href="#table-note-4"> 4 </a> </sup> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> </tr> <tr> <td> <strong> Kubernetes </strong> <sup> <a href="#table-note-5"> 5 </a> </sup> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> <td> <span title="Supported"> βœ… </span> </td> </tr> </tbody> </table> <ol> <li> <p> <a name="table-note-1" style="display: block; height: 80px; margin-top: -80px;"> </a> The server version of Ubuntu is recommended for production installations. The desktop version is only recommended for development deployments. </p> </li> <li> <p> <a name="table-note-2" style="display: block; height: 80px; margin-top: -80px;"> </a> RHEL and CentOS deployments require OpenSSL 1.0.2 and <a href="/docs/latest/operate/rs/installing-upgrading/configuring/centos-rhel-firewall/"> firewall configuration </a> . </p> </li> <li> <p> <a name="table-note-3" style="display: block; height: 80px; margin-top: -80px;"> </a> Based on the corresponding RHEL version. </p> </li> <li> <p> <a name="table-note-4" style="display: block; height: 80px; margin-top: -80px;"> </a> <a href="/docs/latest/operate/rs/installing-upgrading/quickstarts/docker-quickstart/"> Docker images </a> of Redis Enterprise Software are certified for development and testing only. </p> </li> <li> <p> <a name="table-note-5" style="display: block; height: 80px; margin-top: -80px;"> </a> See the <a href="/docs/latest/operate/kubernetes/"> Redis Enterprise for Kubernetes documentation </a> . </p> </li> <li> <p> <a name="table-note-6" style="display: block; height: 80px; margin-top: -80px;"> </a> Ubuntu 20.04 support was added in Redis Enterprise Software <a href="/docs/latest/operate/rs/release-notes/rs-6-4-2-releases/rs-6-4-2-43/"> 6.4.2-43 </a> . </p> </li> <li> <p> <a name="table-note-7" style="display: block; height: 80px; margin-top: -80px;"> </a> A release candidate for Amazon Linux 2 support was added in Redis Enterprise Software <a href="/docs/latest/operate/rs/release-notes/rs-6-4-2-releases/rs-6-4-2-61/"> 6.4.2-61 </a> . Official support for Amazon Linux 2 was added in Redis Enterprise Software <a href="/docs/latest/operate/rs/release-notes/rs-6-4-2-releases/rs-6-4-2-69/"> 6.4.2-69 </a> . </p> </li> <li> <p> <a name="table-note-8" style="display: block; height: 80px; margin-top: -80px;"> </a> Redis Enterprise Software <a href="/docs/latest/operate/rs/release-notes/rs-6-4-2-releases/rs-6-4-2-103/"> 6.4.2-103 </a> and later supports RHEL 8.8. </p> </li> <li> <p> <a name="table-note-9" style="display: block; height: 80px; margin-top: -80px;"> </a> Redis Enterprise Software <a href="/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-105/"> 7.2.4-105 </a> and later supports RHEL 8.9. </p> </li> </ol> <h2 id="downloads"> Downloads </h2> <p> The following table shows the MD5 checksums for the available packages: </p> <table> <thead> <tr> <th> Package </th> <th> MD5 checksum (7.2.4-105 February release) </th> </tr> </thead> <tbody> <tr> <td> Ubuntu 18 </td> <td> 8d78258f76d0968437c0b6bc4e1c5e12 </td> </tr> <tr> <td> Ubuntu 20 </td> <td> 48bcb267f6d154989726b556e93f64aa </td> </tr> <tr> <td> RedHat Enterprise Linux (RHEL) 7 <br/> Oracle Enterprise Linux (OL) 7 </td> <td> 2d5ad0090de6f5ef513cbf4e07da9ed5 </td> </tr> <tr> <td> RedHat Enterprise Linux (RHEL) 8 <br/> Oracle Enterprise Linux (OL) 8 <br/> Rocky Enterprise Linux </td> <td> 974c6815bfd53bf74e349b2beae1780f </td> </tr> <tr> <td> Amazon Linux 2 </td> <td> bf296f206da39830f3c4d8d46e2193c1 </td> </tr> </tbody> </table> <h2 id="security"> Security </h2> <h4 id="open-source-redis-security-fixes-compatibility"> Open source Redis security fixes compatibility </h4> <p> As part of Redis's commitment to security, Redis Enterprise Software implements the latest <a href="https://github.com/redis/redis/releases"> security fixes </a> available with <a href="https://github.com/redis/redis"> open source Redis </a> . Redis Enterprise has already included the fixes for the relevant CVEs. </p> <p> Some CVEs announced for open source Redis do not affect Redis Enterprise due to different or additional functionality available in Redis Enterprise that is not available in open source Redis. </p> <p> Redis Enterprise 7.2.4-105 supports open source Redis 7.2, 6.2, and 6.0. Below is the list of open source Redis CVEs fixed by version. </p> <p> Redis 7.2.x: </p> <ul> <li> <p> (CVE-2023-41056) In some cases, Redis may incorrectly handle resizing of memory buffers, which can result in incorrect accounting of buffer sizes and lead to heap overflow and potential remote code execution. </p> </li> <li> <p> (CVE-2023-41053) Redis does not correctly identify keys accessed by <code> SORT_RO </code> and, as a result, may grant users executing this command access to keys that are not explicitly authorized by the ACL configuration. (Redis 7.2.1) </p> </li> </ul> <p> Redis 7.0.x: </p> <ul> <li> <p> (CVE-2023-41056) In some cases, Redis may incorrectly handle resizing of memory buffers, which can result in incorrect accounting of buffer sizes and lead to heap overflow and potential remote code execution. </p> </li> <li> <p> (CVE-2023-41053) Redis does not correctly identify keys accessed by <code> SORT_RO </code> and, as a result, may grant users executing this command access to keys that are not explicitly authorized by the ACL configuration. (Redis 7.0.13) </p> </li> <li> <p> (CVE-2023-36824) Extracting key names from a command and a list of arguments may, in some cases, trigger a heap overflow and result in reading random heap memory, heap corruption, and potentially remote code execution. Specifically: using <code> COMMAND GETKEYS* </code> and validation of key names in ACL rules. (Redis 7.0.12) </p> </li> <li> <p> (CVE-2023-28856) Authenticated users can use the <code> HINCRBYFLOAT </code> command to create an invalid hash field that will crash Redis on access. (Redis 7.0.11) </p> </li> <li> <p> (CVE-2023-28425) Specially crafted <code> MSETNX </code> command can lead to assertion and denial-of-service. (Redis 7.0.10) </p> </li> <li> <p> (CVE-2023-25155) Specially crafted <code> SRANDMEMBER </code> , <code> ZRANDMEMBER </code> , and <code> HRANDFIELD </code> commands can trigger an integer overflow, resulting in a runtime assertion and termination of the Redis server process. (Redis 7.0.9) </p> </li> <li> <p> (CVE-2023-22458) Integer overflow in the Redis <code> HRANDFIELD </code> and <code> ZRANDMEMBER </code> commands can lead to denial-of-service. (Redis 7.0.8) </p> </li> <li> <p> (CVE-2022-36021) String matching commands (like <code> SCAN </code> or <code> KEYS </code> ) with a specially crafted pattern to trigger a denial-of-service attack on Redis, causing it to hang and consume 100% CPU time. (Redis 7.0.9) </p> </li> <li> <p> (CVE-2022-35977) Integer overflow in the Redis <code> SETRANGE </code> and <code> SORT </code> / <code> SORT_RO </code> commands can drive Redis to OOM panic. (Redis 7.0.8) </p> </li> <li> <p> (CVE-2022-35951) Executing an <code> XAUTOCLAIM </code> command on a stream key in a specific state, with a specially crafted <code> COUNT </code> argument, may cause an integer overflow, a subsequent heap overflow, and potentially lead to remote code execution. The problem affects Redis versions 7.0.0 or newer. (Redis 7.0.5) </p> </li> <li> <p> (CVE-2022-31144) A specially crafted <code> XAUTOCLAIM </code> command on a stream key in a specific state may result in heap overflow and potentially remote code execution. The problem affects Redis versions 7.0.0 or newer. (Redis 7.0.4) </p> </li> <li> <p> (CVE-2022-24834) A specially crafted Lua script executing in Redis can trigger a heap overflow in the cjson and cmsgpack libraries, and result in heap corruption and potentially remote code execution. The problem exists in all versions of Redis with Lua scripting support, starting from 2.6, and affects only authenticated and authorized users. (Redis 7.0.12) </p> </li> <li> <p> (CVE-2022-24736) An attacker attempting to load a specially crafted Lua script can cause NULL pointer dereference which will result in a crash of the <code> redis-server </code> process. This issue affects all versions of Redis. (Redis 7.0.0) </p> </li> <li> <p> (CVE-2022-24735) By exploiting weaknesses in the Lua script execution environment, an attacker with access to Redis can inject Lua code that will execute with the (potentially higher) privileges of another Redis user. (Redis 7.0.0) </p> </li> </ul> <p> Redis 6.2.x: </p> <ul> <li> <p> (CVE-2023-28856) Authenticated users can use the <code> HINCRBYFLOAT </code> command to create an invalid hash field that will crash Redis on access. (Redis 6.2.12) </p> </li> <li> <p> (CVE-2023-25155) Specially crafted <code> SRANDMEMBER </code> , <code> ZRANDMEMBER </code> , and <code> HRANDFIELD </code> commands can trigger an integer overflow, resulting in a runtime assertion and termination of the Redis server process. (Redis 6.2.11) </p> </li> <li> <p> (CVE-2023-22458) Integer overflow in the Redis <code> HRANDFIELD </code> and <code> ZRANDMEMBER </code> commands can lead to denial-of-service. (Redis 6.2.9) </p> </li> <li> <p> (CVE-2022-36021) String matching commands (like <code> SCAN </code> or <code> KEYS </code> ) with a specially crafted pattern to trigger a denial-of-service attack on Redis, causing it to hang and consume 100% CPU time. (Redis 6.2.11) </p> </li> <li> <p> (CVE-2022-35977) Integer overflow in the Redis <code> SETRANGE </code> and <code> SORT </code> / <code> SORT_RO </code> commands can drive Redis to OOM panic. (Redis 6.2.9) </p> </li> <li> <p> (CVE-2022-24834) A specially crafted Lua script executing in Redis can trigger a heap overflow in the cjson and cmsgpack libraries, and result in heap corruption and potentially remote code execution. The problem exists in all versions of Redis with Lua scripting support, starting from 2.6, and affects only authenticated and authorized users. (Redis 6.2.13) </p> </li> <li> <p> (CVE-2022-24736) An attacker attempting to load a specially crafted Lua script can cause NULL pointer dereference which will result in a crash of the <code> redis-server </code> process. This issue affects all versions of Redis. (Redis 6.2.7) </p> </li> <li> <p> (CVE-2022-24735) By exploiting weaknesses in the Lua script execution environment, an attacker with access to Redis can inject Lua code that will execute with the (potentially higher) privileges of another Redis user. (Redis 6.2.7) </p> </li> <li> <p> (CVE-2021-41099) Integer to heap buffer overflow handling certain string commands and network payloads, when <code> proto-max-bulk-len </code> is manually configured to a non-default, very large value. (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32762) Integer to heap buffer overflow issue in <code> redis-cli </code> and <code> redis-sentinel </code> parsing large multi-bulk replies on some older and less common platforms. (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32761) An integer overflow bug in Redis version 2.2 or newer can be exploited using the <code> BITFIELD </code> command to corrupt the heap and potentially result with remote code execution. (Redis 6.2.5) </p> </li> <li> <p> (CVE-2021-32687) Integer to heap buffer overflow with intsets, when <code> set-max-intset-entries </code> is manually configured to a non-default, very large value. (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32675) Denial Of Service when processing RESP request payloads with a large number of elements on many connections. (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32672) Random heap reading issue with Lua Debugger. (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32628) Integer to heap buffer overflow handling ziplist-encoded data types, when configuring a large, non-default value for <code> hash-max-ziplist-entries </code> , <code> hash-max-ziplist-value </code> , <code> zset-max-ziplist-entries </code> or <code> zset-max-ziplist-value </code> . (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32627) Integer to heap buffer overflow issue with streams, when configuring a non-default, large value for <code> proto-max-bulk-len </code> and <code> client-query-buffer-limit </code> . (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32626) Specially crafted Lua scripts may result with Heap buffer overflow. (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32625) An integer overflow bug in Redis version 6.0 or newer can be exploited using the STRALGO LCS command to corrupt the heap and potentially result with remote code execution. This is a result of an incomplete fix by CVE-2021-29477. (Redis 6.2.4) </p> </li> <li> <p> (CVE-2021-29478) An integer overflow bug in Redis 6.2 could be exploited to corrupt the heap and potentially result with remote code execution. The vulnerability involves changing the default set-max-intset-entries configuration value, creating a large set key that consists of integer values and using the COPY command to duplicate it. The integer overflow bug exists in all versions of Redis starting with 2.6, where it could result with a corrupted RDB or DUMP payload, but not exploited through COPY (which did not exist before 6.2). (Redis 6.2.3) </p> </li> <li> <p> (CVE-2021-29477) An integer overflow bug in Redis version 6.0 or newer could be exploited using the STRALGO LCS command to corrupt the heap and potentially result in remote code execution. The integer overflow bug exists in all versions of Redis starting with 6.0. (Redis 6.2.3) </p> </li> </ul> <p> Redis 6.0.x: </p> <ul> <li> <p> (CVE-2022-24834) A specially crafted Lua script executing in Redis can trigger a heap overflow in the cjson and cmsgpack libraries, and result in heap corruption and potentially remote code execution. The problem exists in all versions of Redis with Lua scripting support, starting from 2.6, and affects only authenticated and authorized users. (Redis 6.0.20) </p> </li> <li> <p> (CVE-2023-28856) Authenticated users can use the <code> HINCRBYFLOAT </code> command to create an invalid hash field that will crash Redis on access. (Redis 6.0.19) </p> </li> <li> <p> (CVE-2023-25155) Specially crafted <code> SRANDMEMBER </code> , <code> ZRANDMEMBER </code> , and <code> HRANDFIELD </code> commands can trigger an integer overflow, resulting in a runtime assertion and termination of the Redis server process. (Redis 6.0.18) </p> </li> <li> <p> (CVE-2022-36021) String matching commands (like <code> SCAN </code> or <code> KEYS </code> ) with a specially crafted pattern to trigger a denial-of-service attack on Redis, causing it to hang and consume 100% CPU time. (Redis 6.0.18) </p> </li> <li> <p> (CVE-2022-35977) Integer overflow in the Redis <code> SETRANGE </code> and <code> SORT </code> / <code> SORT_RO </code> commands can drive Redis to OOM panic. (Redis 6.0.17) </p> </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-105/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/move/.html
<section class="prose w-full py-12"> <h1 class="command-name"> MOVE </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">MOVE key db</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 1.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @keyspace </code> <span class="mr-1 last:hidden"> , </span> <code> @write </code> <span class="mr-1 last:hidden"> , </span> <code> @fast </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Move <code> key </code> from the currently selected database (see <a href="/docs/latest/commands/select/"> <code> SELECT </code> </a> ) to the specified destination database. When <code> key </code> already exists in the destination database, or it does not exist in the source database, it does nothing. It is possible to use <code> MOVE </code> as a locking primitive because of this. </p> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <p> One of the following: </p> <ul> <li> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : <code> 1 </code> if <em> key </em> was moved. </li> <li> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : <code> 0 </code> if <em> key </em> wasn't moved. </li> </ul> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/move/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/enterprise-capabilities/.html
<section class="prose w-full py-12 max-w-none"> <h1> Redis Enterprise and Redis Stack feature compatibility </h1> <p class="text-lg -mt-5 mb-10"> Describes the Redis Enterprise features supported by each Redis Stack feature. </p> <p> This article describes compatibility between Redis Enterprise features and Redis Stack features. Version numbers indicate the minimum module version required for feature support. </p> <h2 id="supported-redis-stack-features"> Supported Redis Stack features </h2> <p> The following table shows which Redis Stack features are supported by Redis Enterprise Software and Redis Cloud. </p> <table> <thead> <tr> <th style="text-align:left"> Feature </th> <th style="text-align:left"> Redis Enterprise <br/> Software </th> <th style="text-align:left"> Redis Enterprise <br/> Cloud </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/search/"> Search and query </a> </td> <td style="text-align:left"> βœ… Supported </td> <td style="text-align:left"> βœ… Supported </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/json/"> JSON </a> </td> <td style="text-align:left"> βœ… Supported </td> <td style="text-align:left"> βœ… Supported </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/graph/"> Graph </a> </td> <td style="text-align:left"> ⚠️ Deprecated </td> <td style="text-align:left"> ⚠️ Deprecated </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/timeseries/"> Time series </a> </td> <td style="text-align:left"> βœ… Supported </td> <td style="text-align:left"> βœ… Supported </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/bloom/"> Probabilistic </a> </td> <td style="text-align:left"> βœ… Supported </td> <td style="text-align:left"> βœ… Supported </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/"> Triggers and functions </a> </td> <td style="text-align:left"> ⚠️ Deprecated </td> <td style="text-align:left"> ⚠️ Deprecated </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/"> Gears </a> </td> <td style="text-align:left"> βœ… Supported </td> <td style="text-align:left"> ❌ Not supported </td> </tr> </tbody> </table> <h2 id="feature-compatibility"> Feature compatibility </h2> <p> The following tables show Redis Enterprise feature support for each Redis Stack feature. </p> <p> Version numbers indicate when the feature was first supported. If you're using an earlier version than what's shown in the table, the feature is not supported. </p> <p> For details about individual features, see the corresponding documentation. </p> <table> <thead> <tr> <th> Feature name/capability </th> <th style="text-align:center"> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/search/"> Search and query </a> </th> <th style="text-align:center"> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/json/"> JSON </a> </th> <th style="text-align:center"> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/graph/"> Graph </a> </th> </tr> </thead> <tbody> <tr> <td> Active-Active (CRDB) <sup id="fnref:1"> <a class="footnote-ref" href="#fn:1" role="doc-noteref"> 1 </a> </sup> </td> <td style="text-align:center"> Yes (v2.0) </td> <td style="text-align:center"> Yes (v2.2) </td> <td style="text-align:center"> No </td> </tr> <tr> <td> Backup/Restore </td> <td style="text-align:center"> Yes (v1.4) </td> <td style="text-align:center"> Yes (v1.0) </td> <td style="text-align:center"> Yes (v1.0) </td> </tr> <tr> <td> Clustering </td> <td style="text-align:center"> Yes (v1.6) <sup id="fnref:2"> <a class="footnote-ref" href="#fn:2" role="doc-noteref"> 2 </a> </sup> </td> <td style="text-align:center"> Yes (v1.0) </td> <td style="text-align:center"> Yes (v2.2.3) <sup id="fnref:3"> <a class="footnote-ref" href="#fn:3" role="doc-noteref"> 3 </a> </sup> </td> </tr> <tr> <td> Custom hashing policy </td> <td style="text-align:center"> Yes (v2.0) </td> <td style="text-align:center"> Yes (v1.0) </td> <td style="text-align:center"> Yes (v1.0) </td> </tr> <tr> <td> Eviction expiration </td> <td style="text-align:center"> Yes (v2.0) </td> <td style="text-align:center"> Yes (v1.0) </td> <td style="text-align:center"> Yes (v2.8.10) </td> </tr> <tr> <td> Failover/migration </td> <td style="text-align:center"> Yes (v1.4) </td> <td style="text-align:center"> Yes (v1.0) </td> <td style="text-align:center"> Yes (v1.0) </td> </tr> <tr> <td> Internode encryption </td> <td style="text-align:center"> Yes (v2.0.11) </td> <td style="text-align:center"> Yes (v1.0.8) </td> <td style="text-align:center"> Yes (v2.4) </td> </tr> <tr> <td> Module data types </td> <td style="text-align:center"> Yes </td> <td style="text-align:center"> Yes </td> <td style="text-align:center"> Yes </td> </tr> <tr> <td> Persistence (AOF) </td> <td style="text-align:center"> Yes (v1.4) </td> <td style="text-align:center"> Yes (v1.0) </td> <td style="text-align:center"> Yes (v2.0) </td> </tr> <tr> <td> Persistence (snapshot) </td> <td style="text-align:center"> Yes (v1.6) </td> <td style="text-align:center"> Yes (v1.0) </td> <td style="text-align:center"> Yes (v1.0) </td> </tr> <tr> <td> Auto Tiering <sup id="fnref:4"> <a class="footnote-ref" href="#fn:4" role="doc-noteref"> 4 </a> </sup> </td> <td style="text-align:center"> Yes (v2.0) </td> <td style="text-align:center"> Yes (v1.0) </td> <td style="text-align:center"> No </td> </tr> <tr> <td> Replica Of </td> <td style="text-align:center"> Yes (v1.6) <sup id="fnref:5"> <a class="footnote-ref" href="#fn:5" role="doc-noteref"> 5 </a> </sup> </td> <td style="text-align:center"> Yes (v1.0) </td> <td style="text-align:center"> Yes (v2.2) </td> </tr> <tr> <td> Reshard/rebalance </td> <td style="text-align:center"> Yes (v2.0) </td> <td style="text-align:center"> Yes (v1.0) </td> <td style="text-align:center"> No </td> </tr> </tbody> </table> <table> <thead> <tr> <th> Feature name/capability </th> <th style="text-align:center"> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/timeseries/"> Time series </a> </th> <th style="text-align:center"> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/bloom/"> Probabilistic </a> </th> <th style="text-align:center"> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/"> Gears </a> </th> <th style="text-align:center"> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/"> Triggers and functions </a> </th> </tr> </thead> <tbody> <tr> <td> Active-Active (CRDB) <sup id="fnref1:1"> <a class="footnote-ref" href="#fn:1" role="doc-noteref"> 1 </a> </sup> </td> <td style="text-align:center"> No </td> <td style="text-align:center"> No </td> <td style="text-align:center"> Yes (v1.0) </td> <td style="text-align:center"> No </td> </tr> <tr> <td> Backup/Restore </td> <td style="text-align:center"> Yes (v1.2) </td> <td style="text-align:center"> Yes (v2.0) </td> <td style="text-align:center"> Yes (v1.0) </td> <td style="text-align:center"> Yes </td> </tr> <tr> <td> Clustering </td> <td style="text-align:center"> Yes (v1.2) </td> <td style="text-align:center"> Yes (v2.0) </td> <td style="text-align:center"> Yes (v1.0) </td> <td style="text-align:center"> Yes </td> </tr> <tr> <td> Custom hashing policy </td> <td style="text-align:center"> Yes (v1.2) </td> <td style="text-align:center"> Yes (v2.0) </td> <td style="text-align:center"> Yes (v1.0) </td> <td style="text-align:center"> Yes </td> </tr> <tr> <td> Eviction expiration </td> <td style="text-align:center"> Yes (v1.2) </td> <td style="text-align:center"> Yes (v2.0) </td> <td style="text-align:center"> Yes (v1.0) </td> <td style="text-align:center"> Yes </td> </tr> <tr> <td> Failover/migration </td> <td style="text-align:center"> Yes (v1.2) </td> <td style="text-align:center"> Yes (v2.0) </td> <td style="text-align:center"> Yes (v1.0) </td> <td style="text-align:center"> Yes </td> </tr> <tr> <td> Internode encryption </td> <td style="text-align:center"> Yes (v1.4.9) </td> <td style="text-align:center"> Yes (v2.2.6) </td> <td style="text-align:center"> Yes (v1.2) </td> <td style="text-align:center"> yes </td> </tr> <tr> <td> Module data types </td> <td style="text-align:center"> Yes </td> <td style="text-align:center"> Yes </td> <td style="text-align:center"> Yes </td> <td style="text-align:center"> Yes </td> </tr> <tr> <td> Persistence (AOF) </td> <td style="text-align:center"> Yes (v1.2) </td> <td style="text-align:center"> Yes (v2.0) </td> <td style="text-align:center"> Yes (v1.0) </td> <td style="text-align:center"> Yes </td> </tr> <tr> <td> Persistence (snapshot) </td> <td style="text-align:center"> Yes (v1.2) </td> <td style="text-align:center"> Yes (v2.0) </td> <td style="text-align:center"> Yes (v1.0) </td> <td style="text-align:center"> Yes </td> </tr> <tr> <td> Auto Tiering <sup id="fnref1:4"> <a class="footnote-ref" href="#fn:4" role="doc-noteref"> 4 </a> </sup> </td> <td style="text-align:center"> Yes (v1.6) <sup id="fnref:6"> <a class="footnote-ref" href="#fn:6" role="doc-noteref"> 6 </a> </sup> </td> <td style="text-align:center"> Yes (vTBD) </td> <td style="text-align:center"> Yes (vTBD) </td> <td style="text-align:center"> No </td> </tr> <tr> <td> Replica Of </td> <td style="text-align:center"> Yes (v1.2) </td> <td style="text-align:center"> Yes (v2.0) </td> <td style="text-align:center"> No </td> <td style="text-align:center"> Yes </td> </tr> <tr> <td> Reshard/rebalance </td> <td style="text-align:center"> Yes (v1.2) </td> <td style="text-align:center"> Yes (v2.0) </td> <td style="text-align:center"> Yes (v1.0) </td> <td style="text-align:center"> Yes </td> </tr> </tbody> </table> <h2 id="feature-descriptions"> Feature descriptions </h2> <p> The following table briefly describes each feature shown in the earlier tables. </p> <table> <thead> <tr> <th> Feature name/capability </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> Active-Active (CRDB) </td> <td> Compatible with Active-Active (CRDB) databases </td> </tr> <tr> <td> Backup/Restore </td> <td> Supports import and export features </td> </tr> <tr> <td> Clustering </td> <td> Compatible with sharded databases and shard migration </td> </tr> <tr> <td> Custom hashing policy </td> <td> Compatible with databases using custom hashing policies </td> </tr> <tr> <td> Eviction expiration </td> <td> Allows data to be evicted when the database reaches memory limits </td> </tr> <tr> <td> Failover/migration </td> <td> Compatible with primary/replica failover and the migration of shards between nodes within the cluster </td> </tr> <tr> <td> Internode encryption </td> <td> Compatible with encryption on the data plane </td> </tr> <tr> <td> Persistence (AOF) </td> <td> Compatible with databases using AoF persistence </td> </tr> <tr> <td> Persistence (snapshot) </td> <td> Compatible with databases using snapshot persistence </td> </tr> <tr> <td> Auto Tiering </td> <td> Compatible with Auto Tiering </td> </tr> <tr> <td> Replica Of </td> <td> Compatible with Active-Passive replication </td> </tr> <tr> <td> Reshard/rebalance </td> <td> Compatible with database scaling for clustered databases, which redistributes data between the new shards. </td> </tr> </tbody> </table> <!-- Individual footnotes are rendered below the following heading. Thus, any additional sections need to be placed above this comment. --> <h2 id="footnotes"> Footnotes </h2> <div class="footnotes" role="doc-endnotes"> <hr/> <ol> <li id="fn:1"> <p> With the exception of JSON, you currently cannot combine Active-Active with Redis Stack features in Redis Cloud. <a class="footnote-backref" href="#fnref:1" role="doc-backlink"> β†©οΈŽ </a> <a class="footnote-backref" href="#fnref1:1" role="doc-backlink"> β†©οΈŽ </a> </p> </li> <li id="fn:2"> <p> You cannot use search and query with the <a href="/docs/latest/operate/rs/databases/configure/oss-cluster-api/"> OSS Cluster API </a> . <a class="footnote-backref" href="#fnref:2" role="doc-backlink"> β†©οΈŽ </a> </p> </li> <li id="fn:3"> <p> Graphs are compatible with clustering; however, individual graphs contained in a key reside in a single shard, which can affect pricing. To learn more, <a href="https://redis.com/company/support/"> contact support </a> . <a class="footnote-backref" href="#fnref:3" role="doc-backlink"> β†©οΈŽ </a> </p> </li> <li id="fn:4"> <p> You currently cannot combine Auto Tiering with Redis Stack features in Redis Cloud. <a class="footnote-backref" href="#fnref:4" role="doc-backlink"> β†©οΈŽ </a> <a class="footnote-backref" href="#fnref1:4" role="doc-backlink"> β†©οΈŽ </a> </p> </li> <li id="fn:5"> <p> RediSearch version 1.6 supported Replica Of only between databases with the same number of shards. This limitation was fixed in v2.0. <a class="footnote-backref" href="#fnref:5" role="doc-backlink"> β†©οΈŽ </a> </p> </li> <li id="fn:6"> <p> Although time series are compatible with Auto Tiering, the entire series either lives in RAM or on flash. <a class="footnote-backref" href="#fnref:6" role="doc-backlink"> β†©οΈŽ </a> </p> </li> </ol> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/enterprise-capabilities/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/installing-upgrading/install/plan-deployment/persistent-ephemeral-storage/.html
<section class="prose w-full py-12 max-w-none"> <h1> Persistent and ephemeral node storage </h1> <p class="text-lg -mt-5 mb-10"> Configure paths for persistent storage and ephemeral storage. </p> <p> For each node in the cluster, you can configure paths for both persistent storage and ephemeral storage. To do so, the volume must have full permissions for user and group <code> redislabs </code> or users:group <code> redislabs:redislabs </code> . See the <a href="/docs/latest/operate/rs/installing-upgrading/install/customize-user-and-group/"> Customize system user and group </a> page for instructions. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> The persistent storageΒ and ephemeral storage discussed in this document are not related to Redis persistence or AWS ephemeral drives. </div> </div> <h2 id="persistent-storage"> Persistent storage </h2> <p> Persistent storage is mandatory. The cluster uses persistent storage to store information that needs to persist if a shard or a node fails, such as server logs, configurations, and files. </p> <p> To set the frequency of syncs, you can configure <a href="/docs/latest/operate/rs/databases/configure/database-persistence/"> persistence </a> options for a database. </p> <p> The persistent volume must be a storage area network (SAN) using an EXT4 or XFS file system and be connected as an external storage volume. </p> <p> When using append-only file (AOF) persistence, use flash-based storage for the persistent volume. </p> <h2 id="ephemeral-storage"> Ephemeral storage </h2> <p> Ephemeral storage is optional. If configured, temporary information that does not need to be persisted is stored by the cluster in the ephemeral storage. This improves performance and helps reduce the load on the persistent storage. </p> <p> Ephemeral storage must be a locally attached volume on each node. </p> <h2 id="disk-size-requirements"> Disk size requirements </h2> <p> For disk size requirements, see: </p> <ul> <li> <a href="/docs/latest/operate/rs/installing-upgrading/install/plan-deployment/hardware-requirements/"> Hardware requirements </a> for general guidelines regarding the ideal disk size for each type of storage. </li> <li> <a href="/docs/latest/operate/rs/clusters/optimize/disk-sizing-heavy-write-scenarios/"> Disk size requirements for extreme write scenarios </a> for special considerations when dealing with a high rate of write commands. </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/installing-upgrading/install/plan-deployment/persistent-ephemeral-storage/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/databases/import-export/replica-of/.html
<section class="prose w-full py-12 max-w-none"> <h1> Replica Of geo-distributed Redis </h1> <p class="text-lg -mt-5 mb-10"> Replica Of provides read-only access to replicas of the dataset from different geographical locations. </p> <p> In Redis Enterprise, the Replica Of feature provides active-passive geo-distribution to applications for read-only access to replicas of the dataset from different geographical locations. The Redis Enterprise implementation of active-passive replication is called Replica Of. </p> <p> In Replica Of, an administrator designates a database as a replica (destination) of one or more databases (sources). After the initial data load from source to destination is completed, all write commands are synchronized from the sources to the destination. Replica Of lets you distribute the read load of your application across multiple databases or synchronize the database, either within Redis Enterprise or external to Redis Enterprise, to another database. </p> <p> You can <a href="/docs/latest/operate/rs/7.4/databases/import-export/replica-of/create/"> create Active-Passive </a> databases on Redis Enterprise Software or Redis Cloud. </p> <p> <a href="/docs/latest/operate/rs/7.4/databases/active-active/"> Active-Active Geo-Distribution (CRDB) </a> provides these benefits and also provides write access to all of the database replicas. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Warning: </div> Configuring a database as a replica of the database that it replicates creates a cyclical replication and is not supported. </div> </div> <p> The Replica Of is defined in the context of the destination database by specifying the source databases. </p> <p> A destination database can have a maximum of thirty-two (32)Β source databases. </p> <p> If only one source is defined, then the command execution order in the source is kept in the destination. However, when multiple sources are defined, commands that are replicated from the source databases are executed in the order in which they reach the destination database. As a result, commands that were executed in a certain order when compared across source databases might be executed in a different order on the destination database. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> The Replica Of feature should not be confused with the in-memory <a href="/docs/latest/operate/rs/7.4/databases/durability-ha/replication/"> Database replication </a> feature, which is used for creating a master / replica configuration that enables ensuring database high-availability. </div> </div> <h2 id="replication-process"> Replication process </h2> <p> When a database is defined as a replica of another database, all its existing data is deleted and replaced by data that is loaded from the source database. </p> <p> Once the initial data load is completed, an ongoing synchronization process takes place to keep the destination always synchronized with its source. During the ongoing synchronization process, there is a certain delay between the time when a command was executed on the source and when it is executed on the destination. This delay is referred to as the <strong> Lag </strong> . </p> <p> When there is a <strong> synchronization error </strong> , <strong> the process might stop </strong> or it might continue running on the assumption that the error automatically resolves. The result depends on the error type. See more details below. </p> <p> In addition, <strong> the user can manually stop the synchronization process </strong> . </p> <p> When the process is in the stopped state - whether stopped by the user or by the system - the user can restart the process. <strong> Restarting the process causes the synchronization process to flush the DB and restart the process from the beginning </strong> . </p> <h3 id="replica-of-status"> Replica Of status </h3> <p> The replication process can have the following statuses: </p> <ul> <li> <strong> Syncing </strong> - indicates that the synchronization process has started from scratch. Progress is indicated in percentages (%). </li> <li> <strong> Synced </strong> - indicates that the initial synchronization process was completed and the destination is synchronizing changes on an ongoing basis. The <strong> Lag </strong> delay in synchronization with the source is indicated as a time duration. </li> <li> <strong> Sync stopped </strong> - indicates that the synchronization process is currently not running and the user needs to restart it in order for it to continue running. This status happens if the user stops the process, or if certain errors arose that prevent synchronization from continuing without manual intervention. See more details below. </li> </ul> <p> The statuses above are shown for the source database. In addition, a timestamp is shown on the source indicating when the last command from the source was executed on the destination. </p> <p> The system also displays the destination database status as an aggregate of the statuses of all the sources. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> If you encounter issues with the Replica Of process, refer to the troubleshooting section <a href="/docs/latest/operate/rs/7.4/databases/import-export/replica-of/replicaof-repeatedly-fails/"> Replica Of repeatedly fails </a> . </div> </div> <h3 id="synchronization-errors"> Synchronization errors </h3> <p> Certain errors that occur during the synchronization process require user intervention for their resolution. When such errors occur, the synchronization process is automatically stopped. </p> <p> For other errors, the synchronization process continues running on the assumption that the error automatically resolves. </p> <p> Examples of errors that require user intervention for their resolution and that stop the synchronization process include: </p> <ul> <li> Error authenticating with the source database. </li> <li> Cross slot violation error while executing a command on a sharded destination database. </li> <li> Out-of-memory error on a source or on the destination database. </li> </ul> <p> Example of an error that does not cause the synchronization process to stop: </p> <ul> <li> Connection error with the source database. A connection error might occur occasionally, for example as result of temporary network issues that get resolved. Depending on the connection error and its duration the process might be able to start syncing from the last point it reached (partial sync) or require a complete resynchronization from scratch across all sources (full sync). </li> </ul> <h2 id="encryption"> Encryption </h2> <p> Replica Of supports the ability to encrypt uni-directional replication communications between source and destination clusters utilizing TLS 1.2 based encryption. </p> <h2 id="data-compression-for-replica-of"> Data compression for Replica Of </h2> <p> When the Replica Of is defined across different Redis Enterprise Software clusters, it may be beneficial to compress the data that flows through the network (depending on where the clusters physically reside and the available network). </p> <p> Compressing the data reduces the traffic and can help: </p> <ul> <li> Resolve throughput issues </li> <li> Reduce network traffic costs </li> </ul> <p> Compressing the data does haveΒ trade-offs, which is why it should not always be turned on by default. For example: </p> <ul> <li> It uses CPU and disk resources to compress the data before sending it to the network and decompress it on the other side. </li> <li> It takes time to compress and decompress the data which can increase latency. </li> <li> Replication is disk-based and done gradually, shard by shard in the case of a multi-shard database. This may have an impact on replication times depending on the speed of the disks and load on the database. </li> <li> If traffic is too fast and the compression takes too much time it can cause the replication process to fail and be restarted. </li> </ul> <p> It is advised that you test compression out in a lower environment before enabling it in production. </p> <p> In the Redis Enterprise Software management UI, when designating a Replica Of source from a different Redis Enterprise Software cluster, there is also an option to enable compression. When enabled, gzip compression with level -6 is utilized. </p> <h2 id="database-clustering-sharding-implications"> Database clustering (sharding) implications </h2> <p> If a <strong> source </strong> database is sharded, that entire database is treated as a single source for the destination database. </p> <p> If the <strong> destination </strong> database is sharded, when the commands replicated from the source are executed on the destination database, the destination database's hashing function is executed to determine to which shard/s the command refers. </p> <p> The source and destination can have different shard counts and functions for placement of keys. </p> <h3 id="synchronization-in-active-passive-replication"> Synchronization in Active-Passive Replication </h3> <p> In Active-Passive databases, one cluster hosts the source database that receives read-write operations and the other clusters host destination databases that receive synchronization updates from the source database. </p> <p> When there is a significant difference between the source and destination databases, the destination database flushes all of the data from its memory and starts synchronizing the data again. This process is called a <strong> full sync </strong> . </p> <p> For example, if the database updates for the destination databases that are stored by the destination database in a synchronization backlog exceed their allocated memory, the source database starts a full sync. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Warning: </div> When you failover to the destination database for write operations, make sure that you disable <strong> Replica Of </strong> before you direct clients to the destination database. This avoids a full sync that can overwrite your data. </div> </div> <h2 id="active-passive-replication-backlog"> Active-Passive replication backlog </h2> <p> In addition to the <a href="/docs/latest/operate/rs/7.4/databases/durability-ha/replication/#database-replication-backlog"> database replication backlog </a> , active-passive databases maintain a replication backlog (per shard) to synchronize the database instances between clusters. By default, the replication backlog is set to one percent (1%) of the database size divided by the database number of shards and ranges between 1MB to 250MB per shard. Use the <a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/"> <code> rladmin </code> </a> utility to control the size of the replication backlog. You can set it to <code> auto </code> or set a specific size. </p> <p> For an Active-Passive database: </p> <div class="highlight"> <pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">rladmin tune db &lt;db:id | name&gt; repl_backlog &lt;Backlog size in MB or 'auto'&gt; </span></span></code></pre> </div> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> On an Active-Passive database, the replication backlog configuration applies to both the replication backlog for shards synchronization and for synchronization of database instances between clusters. </div> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/databases/import-export/replica-of/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/kubernetes/recommendations/node-resources/.html
<section class="prose w-full py-12 max-w-none"> <h1> Manage node resources </h1> <p class="text-lg -mt-5 mb-10"> Recommendations on managing node resources and setting eviction thresholds with Redis Enterprise for Kubernetes. </p> <h2 id="node-eviction-thresholds"> Node eviction thresholds </h2> <p> Kubernetes uses <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/"> node-pressure eviction </a> to terminate pods and free up node resources. Redis Enterprise for Kubernetes works best when you use the recommendations below. </p> <p> Eviction thresholds are managed by <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/"> kubelet arguments </a> . </p> <p> Redis recommends setting a high <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#soft-eviction-thresholds"> soft eviction threshold </a> . This changes the node condition early enough to alert the administrator. </p> <p> We also recommend setting the <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#soft-eviction-thresholds"> <code> eviction-soft-grace-period </code> </a> high enough for the administrator to scale the cluster. </p> <p> For more information about configuring eviction thresholds on specific platforms, see <a href="https://docs.openshift.com/container-platform/4.9/nodes/nodes/nodes-nodes-garbage-collection.html"> Freeing node resources </a> for OpenShift or <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture#node_allocatable"> Cluster architecture </a> for GKE. </p> <h3 id="monitor-node-conditions"> Monitor node conditions </h3> <p> Redis recommends monitoring the node conditions. If both <code> MemoryPressure </code> and <code> DiskPressure </code> are true, the eviction threshold was met. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">&gt; kubectl get nodes -o <span class="nv">jsonpath</span><span class="o">=</span><span class="s1">'{range .items[*]}name:{.metadata.name}{"\t"}MemoryPressure:{.status.conditions[?(@.type == "MemoryPressure")].status}{"\t"}DiskPressure:{.status.conditions[?(@.type == "DiskPressure")].status}{"\n"}{end}'</span> </span></span><span class="line"><span class="cl">name:gke-55d1ac88-213c MemoryPressure:False DiskPressure:False </span></span><span class="line"><span class="cl">name:gke-55d1ac88-vrpp MemoryPressure:False DiskPressure:False </span></span><span class="line"><span class="cl">name:gke-7253cc19-42g0 MemoryPressure:False DiskPressure:False </span></span></code></pre> </div> <p> For more information about monitoring node conditions, see <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#node-conditions"> Node conditions </a> on <a href="https://kubernetes.io/docs/home/"> kubernetes.io </a> . </p> <h2 id="resource-quotas"> Resource quotas </h2> <p> Kubernetes uses the <code> ResourceQuota </code> object to limit resource consumption per namespace. This lets you limit the number of objects created by a namespace or the amount of compute resources consumed by a namespace. </p> <p> The resource settings for Redis Enterprise for Kubernetes are defined in the <code> operator.yaml </code> and the <a href="https://github.com/RedisLabs/redis-enterprise-k8s-docs/blob/master/redis_enterprise_cluster_api.md#redisenterpriseclusterspec"> <code> RedisEnterpriseCluster </code> </a> custom resource. </p> <p> The following settings are the minimum workloads for the operator to function. </p> <div class="highlight"> <pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="w"> </span><span class="nt">resources</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">limits</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">cpu</span><span class="p">:</span><span class="w"> </span><span class="m">0.5</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">memory</span><span class="p">:</span><span class="w"> </span><span class="l">256Mi</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">requests</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">cpu</span><span class="p">:</span><span class="w"> </span><span class="m">0.5</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">memory</span><span class="p">:</span><span class="w"> </span><span class="l">256Mi</span><span class="w"> </span></span></span></code></pre> </div> <p> For more details on using resource quotas, see the <a href="https://kubernetes.io/docs/concepts/policy/resource-quotas/"> Kubernetes documentation </a> . </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/kubernetes/recommendations/node-resources/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/pexpireat/.html
<section class="prose w-full py-12"> <h1 class="command-name"> PEXPIREAT </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">PEXPIREAT key unix-time-milliseconds [NX | XX | GT | LT]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 2.6.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @keyspace </code> <span class="mr-1 last:hidden"> , </span> <code> @write </code> <span class="mr-1 last:hidden"> , </span> <code> @fast </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> <code> PEXPIREAT </code> has the same effect and semantic as <a href="/docs/latest/commands/expireat/"> <code> EXPIREAT </code> </a> , but the Unix time at which the key will expire is specified in milliseconds instead of seconds. </p> <h2 id="options"> Options </h2> <p> The <code> PEXPIREAT </code> command supports a set of options since Redis 7.0: </p> <ul> <li> <code> NX </code> -- Set expiry only when the key has no expiry </li> <li> <code> XX </code> -- Set expiry only when the key has an existing expiry </li> <li> <code> GT </code> -- Set expiry only when the new expiry is greater than current one </li> <li> <code> LT </code> -- Set expiry only when the new expiry is less than current one </li> </ul> <p> A non-volatile key is treated as an infinite TTL for the purpose of <code> GT </code> and <code> LT </code> . The <code> GT </code> , <code> LT </code> and <code> NX </code> options are mutually exclusive. </p> <h2 id="examples"> Examples </h2> <div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex"> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z"> </path> </svg> </div> <form class="redis-cli overflow-y-auto max-h-80"> <pre tabindex="0">redis&gt; SET mykey "Hello" "OK" redis&gt; PEXPIREAT mykey 1555555555005 (integer) 1 redis&gt; TTL mykey (integer) -2 redis&gt; PTTL mykey (integer) -2 </pre> <div class="prompt" style=""> <span> redis&gt; </span> <input autocomplete="off" name="prompt" spellcheck="false" type="text"/> </div> </form> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <p> One of the following: </p> <ul> <li> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : <code> 1 </code> if the timeout was set. </li> <li> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : <code> 0 </code> if the timeout was not set. For example, if the key doesn't exist, or the operation was skipped due to the provided arguments. </li> </ul> <br/> <h2> History </h2> <ul> <li> Starting with Redis version 7.0.0: Added options: <code> NX </code> , <code> XX </code> , <code> GT </code> and <code> LT </code> . </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/pexpireat/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/kubernetes/release-notes/6-2-18-releases/.html
<section class="prose w-full py-12 max-w-none"> <h1> 6.2.18 release notes </h1> <p class="text-lg -mt-5 mb-10"> Release notes for the 6.2.18 releases of Redis Enterprise Software for Kubernetes. </p> <h2 id="before-upgrading"> Before upgrading </h2> <p> Be aware the following changes included in this release affect the upgrade process. Please read carefully before upgrading. </p> <h3 id="supported-upgrade-paths"> Supported upgrade paths </h3> <p> If you are using operator version 6.2.8-15 or earlier, you cannot upgrade directly to operator versions 6.2.12 through 6.4.2-5. You must upgrade to operator version 6.2.10-45 before you can upgrade to operator versions between 6.2.12 and 6.4.2-5. However, upgrades directly to operator version 6.4.2-6 are supported. </p> <h3 id="openshift-versions-6212-or-earlier"> OpenShift versions 6.2.12 or earlier </h3> <p> Due to a change in the SCC, on OpenShift clusters running version 6.2.12 or earlier upgrading to version 6.2.18 or later, where <code> node:1 </code> is <b> not </b> the master node, the upgrade might get stuck. </p> <p> For more info and steps to prevent this issue, see <a href="/docs/latest/operate/kubernetes/upgrade/upgrade-redis-cluster/#before-upgrading"> upgrade a Redis Enterprise cluster (REC) </a> . </p> <p> Operator version 6.4.2-6 includes a fix for this issue. </p> <h3 id="large-clusters"> Large clusters </h3> <p> On clusters with more than 9 REC nodes, a Kubernetes upgrade can render the Redis cluster unresponsive in some cases. A fix is available in the 6.4.2-5 release. Upgrade your operator version to 6.4.2-5 or later before upgrading your Kubernetes cluster. </p> <table> <thead> <tr> <th style="text-align:left"> VersionΒ (ReleaseΒ date) </th> <th style="text-align:left"> Major changes </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/kubernetes/release-notes/6-2-18-releases/k8s-6-2-18-41-jan-2023/"> 6.2.18-41 (Jan 2023) </a> </td> <td style="text-align:left"> This is a maintenance release for 6.2.18 and includes support for Redis Enterprise 6.2.18-72. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/kubernetes/release-notes/6-2-18-releases/k8s-6-2-18-41/"> 6.2.18-41 (Dec 2022) </a> </td> <td style="text-align:left"> This is a maintenance release for 6.2.18 and includes bug fixes. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/kubernetes/release-notes/6-2-18-releases/k8s-6-2-18-3/"> 6.2.18-3 (Nov 2022) </a> </td> <td style="text-align:left"> Support added for additional distributions, as well as feature improvements and bug fixes. </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/kubernetes/release-notes/6-2-18-releases/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/cluster-forget/.html
<section class="prose w-full py-12"> <h1 class="command-name"> CLUSTER FORGET </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">CLUSTER FORGET node-id</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 3.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @admin </code> <span class="mr-1 last:hidden"> , </span> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> <code> @dangerous </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> The command is used in order to remove a node, specified via its node ID, from the set of <em> known nodes </em> of the Redis Cluster node receiving the command. In other words the specified node is removed from the <em> nodes table </em> of the node receiving the command. </p> <p> Because when a given node is part of the cluster, all the other nodes participating in the cluster knows about it, in order for a node to be completely removed from a cluster, the <code> CLUSTER FORGET </code> command must be sent to all the remaining nodes, regardless of the fact they are masters or replicas. </p> <p> However the command cannot simply drop the node from the internal node table of the node receiving the command, it also implements a ban-list, not allowing the same node to be added again as a side effect of processing the <em> gossip section </em> of the heartbeat packets received from other nodes. </p> <h2 id="details-on-why-the-ban-list-is-needed"> Details on why the ban-list is needed </h2> <p> In the following example we'll show why the command must not just remove a given node from the nodes table, but also prevent it for being re-inserted again for some time. </p> <p> Let's assume we have four nodes, A, B, C and D. In order to end with just a three nodes cluster A, B, C we may follow these steps: </p> <ol> <li> Reshard all the hash slots from D to nodes A, B, C. </li> <li> D is now empty, but still listed in the nodes table of A, B and C. </li> <li> We contact A, and send <code> CLUSTER FORGET D </code> . </li> <li> B sends node A a heartbeat packet, where node D is listed. </li> <li> A does no longer known node D (see step 3), so it starts a handshake with D. </li> <li> D ends re-added in the nodes table of A. </li> </ol> <p> As you can see in this way removing a node is fragile, we need to send <code> CLUSTER FORGET </code> commands to all the nodes ASAP hoping there are no gossip sections processing in the meantime. Because of this problem the command implements a ban-list with an expire time for each entry. </p> <p> So what the command really does is: </p> <ol> <li> The specified node gets removed from the nodes table. </li> <li> The node ID of the removed node gets added to the ban-list, for 1 minute. </li> <li> The node will skip all the node IDs listed in the ban-list when processing gossip sections received in heartbeat packets from other nodes. </li> </ol> <p> This way we have a 60 second window to inform all the nodes in the cluster that we want to remove a node. </p> <h2 id="special-conditions-not-allowing-the-command-execution"> Special conditions not allowing the command execution </h2> <p> The command does not succeed and returns an error in the following cases: </p> <ol> <li> The specified node ID is not found in the nodes table. </li> <li> The node receiving the command is a replica, and the specified node ID identifies its current master. </li> <li> The node ID identifies the same node we are sending the command to. </li> </ol> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#simple-strings"> Simple string reply </a> : <code> OK </code> if the command was executed successfully. Otherwise an error is returned. <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/cluster-forget/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/integrate/redisvl/overview/install/.html
<section class="prose w-full py-12 max-w-none"> <h1> Install RedisVL </h1> <p class="text-lg -mt-5 mb-10"> How to install RedisVL </p> <p> There are a few ways to install RedisVL. The easiest way is to use Python's <code> pip </code> command. </p> <h2 id="install-redisvl-with-pip"> Install RedisVL with pip </h2> <p> Install <code> redisvl </code> into your Python (&gt;=3.8) environment using <code> pip </code> : </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ pip install -U redisvl </span></span></code></pre> </div> <p> RedisVL comes with a few dependencies that are automatically installed. However, a few dependencies are optional and can be installed separately if needed: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ pip install redisvl<span class="o">[</span>all<span class="o">]</span> <span class="c1"># install vectorizer dependencies</span> </span></span><span class="line"><span class="cl">$ pip install redisvl<span class="o">[</span>dev<span class="o">]</span> <span class="c1"># install dev dependencies</span> </span></span></code></pre> </div> <p> If you use Zsh, remember to escape the brackets: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ pip install redisvl<span class="se">\[</span>all<span class="se">\]</span> </span></span></code></pre> </div> <p> This library supports the use of <a href="https://redis.com/lp/hiredis/"> hiredis </a> , so you can also install RedisVL by running: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">pip install redisvl<span class="o">[</span>hiredis<span class="o">]</span> </span></span></code></pre> </div> <h2 id="install-redisvl-from-source"> Install RedisVL from source </h2> <p> To install RedisVL from source, clone the repository and install the package using <code> pip </code> : </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ git clone https://github.com/redisventures/redisvl.git <span class="o">&amp;&amp;</span> <span class="nb">cd</span> redisvl </span></span><span class="line"><span class="cl">$ pip install . </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># or for an editable installation (for developers of RedisVL)</span> </span></span><span class="line"><span class="cl">$ pip install -e . </span></span></code></pre> </div> <h2 id="install-redis"> Install Redis </h2> <p> RedisVL requires a distribution of Redis that supports the <a href="https://redis.com/modules/redis-search/"> Redis Query Engine </a> capability, of which there are three: </p> <ol> <li> <a href="https://redis.com/try-free"> Redis Cloud </a> , a fully managed cloud offering that you can try for free. </li> <li> <a href="/docs/latest/operate/oss_and_stack/install/install-stack/docker/"> Redis Stack </a> , a local docker image for testing and development. </li> <li> <a href="https://redis.com/redis-enterprise/"> Redis Enterprise </a> , a commercial self-hosted offering. </li> </ol> <h3 id="redis-cloud"> Redis Cloud </h3> <p> Redis Cloud is the easiest way to get started with RedisVL. You can sign up for a free account <a href="https://redis.com/try-free"> here </a> . Make sure to have the <strong> Search and Query </strong> capability enabled when creating your database. </p> <h3 id="redis-stack-local-development"> Redis Stack (local development) </h3> <p> For local development and testing, Redis Stack and be used. We recommend running Redis in a docker container. To do so, run the following command: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">docker run -d --name redis-stack -p 6379:6379 -p 8001:8001 redis/redis-stack:latest </span></span></code></pre> </div> <p> This will also start the <a href="https://redis.com/redis-enterprise/redis-insight/"> Redis Insight application </a> at <code> http://localhost:8001 </code> . </p> <h3 id="redis-enterprise-self-hosted"> Redis Enterprise (self-hosted) </h3> <p> Redis Enterprise is a commercial offering that can be self-hosted. You can download the latest version <a href="https://redis.com/redis-enterprise-software/download-center/software/"> here </a> . </p> <p> If you are considering a self-hosted Redis Enterprise deployment on Kubernetes, there is the <a href="https://docs.redis.com/latest/kubernetes/"> Redis Enterprise Operator </a> for Kubernetes. This will allow you to easily deploy and manage a Redis Enterprise cluster on Kubernetes. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/integrate/redisvl/overview/install/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/bf.exists/.html
<section class="prose w-full py-12"> <h1 class="command-name"> BF.EXISTS </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">BF.EXISTS key item</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available in: </dt> <dd class="m-0"> <a href="/docs/stack"> Redis Stack </a> / <a href="/docs/data-types/probabilistic"> Bloom 1.0.0 </a> </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(k), where k is the number of hash functions used by the last sub-filter </dd> </dl> <p> Determines whether a given item was added to a Bloom filter. </p> <p> This command is similar to <a href="/docs/latest/commands/bf.mexists/"> <code> BF.MEXISTS </code> </a> , except that only one item can be checked. </p> <h2 id="required-arguments"> Required arguments </h2> <details open=""> <summary> <code> key </code> </summary> <p> is key name for a Bloom filter. </p> </details> <details open=""> <summary> <code> item </code> </summary> <p> is an item to check. </p> </details> <h2 id="return-value"> Return value </h2> <p> Returns one of these replies: </p> <ul> <li> <a href="/docs/latest/develop/reference/protocol-spec/#integers"> Integer reply </a> , where <code> 1 </code> means that, with high probability, <code> item </code> was already added to the filter, and <code> 0 </code> means that <code> key </code> does not exist or that <code> item </code> had not been added to the filter. </li> <li> [] on error (invalid arguments, wrong key type, etc.) </li> </ul> <h2 id="examples"> Examples </h2> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; BF.ADD bf item1 </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">redis&gt; BF.EXISTS bf item1 </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">redis&gt; BF.EXISTS bf item2 </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span></span></span></code></pre> </div> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/bf.exists/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/node/snapshot/.html
<section class="prose w-full py-12 max-w-none"> <h1> rladmin node snapshot </h1> <p class="text-lg -mt-5 mb-10"> Manages snapshots of the configuration of a node's shards and endpoints. </p> <p> Manages snapshots of the configuration of a node's shards and endpoints. </p> <p> You can create node snapshots and use them to restore the node's shards and endpoints to a configuration from a previous point in time. If you restore a node from a snapshot (for example, after an event such as failover or maintenance), the node's shards have the same placement and roles as when the snapshot was created. </p> <h2 id="node-snapshot-create"> <code> node snapshot create </code> </h2> <p> Creates a snapshot of a node's current configuration, including the placement of shards and endpoints on the node and the shards' roles. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin node &lt;ID&gt; snapshot create &lt;name&gt; </span></span></code></pre> </div> <h3 id="parameters"> Parameters </h3> <table> <thead> <tr> <th> Parameter </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> node </td> <td> integer </td> <td> Creates a snapshot of the specified node </td> </tr> <tr> <td> name </td> <td> string </td> <td> Name of the created snapshot </td> </tr> </tbody> </table> <h3 id="returns"> Returns </h3> <p> Returns <code> Done </code> if the snapshot was created successfully. Otherwise, returns an error. </p> <h3 id="example"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin node <span class="m">1</span> snapshot create snap1 </span></span><span class="line"><span class="cl">Creating node snapshot <span class="s1">'snap1'</span> <span class="k">for</span> node:1 </span></span><span class="line"><span class="cl">Done. </span></span></code></pre> </div> <h2 id="node-snapshot-delete"> <code> node snapshot delete </code> </h2> <p> Deletes an existing snapshot of a node. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin node &lt;ID&gt; snapshot delete &lt;name&gt; </span></span></code></pre> </div> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> You cannot use this command to delete a snapshot created by maintenance mode. As of Redis Enterprise Software version 7.4.2, only the latest maintenance mode snapshot is kept. </div> </div> <h3 id="parameters-1"> Parameters </h3> <table> <thead> <tr> <th> Parameter </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> node </td> <td> integer </td> <td> Deletes a snapshot of the specified node </td> </tr> <tr> <td> name </td> <td> string </td> <td> Deletes the specified snapshot </td> </tr> </tbody> </table> <h3 id="returns-1"> Returns </h3> <p> Returns <code> Done </code> if the snapshot was deleted successfully. Otherwise, returns an error. </p> <h3 id="example-1"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin node <span class="m">1</span> snapshot delete snap1 </span></span><span class="line"><span class="cl">Deleting node snapshot <span class="s1">'snap1'</span> <span class="k">for</span> node:1 </span></span><span class="line"><span class="cl">Done. </span></span></code></pre> </div> <h2 id="node-snapshot-list"> <code> node snapshot list </code> </h2> <p> Displays a list of created snapshots for the specified node. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin node &lt;ID&gt; snapshot list </span></span></code></pre> </div> <h3 id="parameters-2"> Parameters </h3> <table> <thead> <tr> <th> Parameter </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> node </td> <td> integer </td> <td> Displays snapshots of the specified node </td> </tr> </tbody> </table> <h3 id="returns-2"> Returns </h3> <p> Returns a list of snapshots of the specified node. </p> <h3 id="example-2"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin node <span class="m">2</span> snapshot list </span></span><span class="line"><span class="cl">Name Node Time </span></span><span class="line"><span class="cl">snap2 <span class="m">2</span> 2022-05-12T19:27:51Z </span></span></code></pre> </div> <h2 id="node-snapshot-restore"> <code> node snapshot restore </code> </h2> <p> Restores a node's shards and endpoints as close to the stored snapshot as possible. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin node &lt;ID&gt; snapshot restore &lt;name&gt; </span></span></code></pre> </div> <h3 id="parameters-3"> Parameters </h3> <table> <thead> <tr> <th> Parameter </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> node </td> <td> integer </td> <td> Restore the specified node from a snapshot. </td> </tr> <tr> <td> restore </td> <td> string </td> <td> Name of the snapshot used to restore the node. </td> </tr> </tbody> </table> <h3 id="returns-3"> Returns </h3> <p> Returns <code> Snapshot restore completed successfully </code> if the actions needed to restore the snapshot completed successfully. Otherwise, it returns an error. </p> <h3 id="example-3"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin node <span class="m">2</span> snapshot restore snap2 </span></span><span class="line"><span class="cl">Reading node snapshot <span class="s1">'snap2'</span> <span class="k">for</span> node:2 </span></span><span class="line"><span class="cl">Planning restore </span></span><span class="line"><span class="cl">Planned actions: </span></span><span class="line"><span class="cl">* migrate redis:15 to node:2 </span></span><span class="line"><span class="cl">* failover redis:14 </span></span><span class="line"><span class="cl">* migrate redis:17 to node:2 </span></span><span class="line"><span class="cl">* failover redis:16 </span></span><span class="line"><span class="cl">* migrate redis:19 to node:2 </span></span><span class="line"><span class="cl">* failover redis:18 </span></span><span class="line"><span class="cl">* migrate redis:21 to node:2 </span></span><span class="line"><span class="cl">* failover redis:20 </span></span><span class="line"><span class="cl">Proceed?<span class="o">[</span>Y<span class="o">]</span>es/<span class="o">[</span>N<span class="o">]</span>o? Y </span></span><span class="line"><span class="cl">2022-05-12T19:43:31.486613 Scheduling <span class="m">8</span> actions </span></span><span class="line"><span class="cl"><span class="o">[</span>2022-05-12T19:43:31.521422 Actions Status: <span class="m">8</span> waiting <span class="o">]</span> </span></span><span class="line"><span class="cl">* <span class="o">[</span>migrate redis:21 to node:2<span class="o">]</span> <span class="nv">waiting</span> <span class="o">=</span>&gt; executing </span></span><span class="line"><span class="cl">* <span class="o">[</span>migrate redis:19 to node:2<span class="o">]</span> <span class="nv">waiting</span> <span class="o">=</span>&gt; executing </span></span><span class="line"><span class="cl">* <span class="o">[</span>migrate redis:17 to node:2<span class="o">]</span> <span class="nv">waiting</span> <span class="o">=</span>&gt; executing </span></span><span class="line"><span class="cl">* <span class="o">[</span>migrate redis:15 to node:2<span class="o">]</span> <span class="nv">waiting</span> <span class="o">=</span>&gt; executing </span></span><span class="line"><span class="cl"><span class="o">[</span>2022-05-12T19:43:32.586084 Actions Status: <span class="m">4</span> executing <span class="p">|</span> <span class="m">4</span> waiting <span class="o">]</span> </span></span><span class="line"><span class="cl">* <span class="o">[</span>migrate redis:21 to node:2<span class="o">]</span> <span class="nv">executing</span> <span class="o">=</span>&gt; finished </span></span><span class="line"><span class="cl">* <span class="o">[</span>migrate redis:19 to node:2<span class="o">]</span> <span class="nv">executing</span> <span class="o">=</span>&gt; finished </span></span><span class="line"><span class="cl">* <span class="o">[</span>migrate redis:17 to node:2<span class="o">]</span> <span class="nv">executing</span> <span class="o">=</span>&gt; finished </span></span><span class="line"><span class="cl">* <span class="o">[</span>migrate redis:15 to node:2<span class="o">]</span> <span class="nv">executing</span> <span class="o">=</span>&gt; finished </span></span><span class="line"><span class="cl">* <span class="o">[</span>failover redis:20<span class="o">]</span> <span class="nv">waiting</span> <span class="o">=</span>&gt; executing </span></span><span class="line"><span class="cl">* <span class="o">[</span>failover redis:18<span class="o">]</span> <span class="nv">waiting</span> <span class="o">=</span>&gt; executing </span></span><span class="line"><span class="cl">* <span class="o">[</span>failover redis:16<span class="o">]</span> <span class="nv">waiting</span> <span class="o">=</span>&gt; executing </span></span><span class="line"><span class="cl">* <span class="o">[</span>failover redis:14<span class="o">]</span> <span class="nv">waiting</span> <span class="o">=</span>&gt; executing </span></span><span class="line"><span class="cl"><span class="o">[</span>2022-05-12T19:43:33.719496 Actions Status: <span class="m">4</span> finished <span class="p">|</span> <span class="m">4</span> executing <span class="o">]</span> </span></span><span class="line"><span class="cl">* <span class="o">[</span>failover redis:20<span class="o">]</span> <span class="nv">executing</span> <span class="o">=</span>&gt; finished </span></span><span class="line"><span class="cl">* <span class="o">[</span>failover redis:18<span class="o">]</span> <span class="nv">executing</span> <span class="o">=</span>&gt; finished </span></span><span class="line"><span class="cl">* <span class="o">[</span>failover redis:16<span class="o">]</span> <span class="nv">executing</span> <span class="o">=</span>&gt; finished </span></span><span class="line"><span class="cl">* <span class="o">[</span>failover redis:14<span class="o">]</span> <span class="nv">executing</span> <span class="o">=</span>&gt; finished </span></span><span class="line"><span class="cl">Snapshot restore completed successfully. </span></span></code></pre> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/node/snapshot/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/suffixes/.html
<section class="prose w-full py-12 max-w-none"> <h1> Suffixes requests </h1> <p class="text-lg -mt-5 mb-10"> DNS suffixes requests </p> <table> <thead> <tr> <th> Method </th> <th> Path </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="#get-all-suffixes"> GET </a> </td> <td> <code> /v1/suffixes </code> </td> <td> Get all DNS suffixes </td> </tr> </tbody> </table> <h2 id="get-all-suffixes"> Get all suffixes </h2> <pre><code>GET /v1/suffixes </code></pre> <p> Get all DNS suffixes in the cluster. </p> <h3 id="get-all-request"> Request </h3> <h4 id="example-http-request"> Example HTTP request </h4> <pre><code>GET /suffixes </code></pre> <h4 id="request-headers"> Request headers </h4> <table> <thead> <tr> <th> Key </th> <th> Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> Host </td> <td> cnm.cluster.fqdn </td> <td> Domain name </td> </tr> <tr> <td> Accept </td> <td> application/json </td> <td> Accepted media type </td> </tr> </tbody> </table> <h3 id="get-all-response"> Response </h3> <p> The response body contains a JSON array with all suffixes, represented as <a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/suffix/"> suffix objects </a> . </p> <h4 id="example-json-body"> Example JSON body </h4> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"cluster.fqdn"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"// additional fields..."</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"internal.cluster.fqdn"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"// additional fields..."</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">]</span> </span></span></code></pre> </div> <h3 id="get-all-status-codes"> Status codes </h3> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1"> 200 OK </a> </td> <td> No error </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/suffixes/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisjson/redisjson-2.4-release-notes/.html
<section class="prose w-full py-12 max-w-none"> <h1> RedisJSON 2.4 release notes </h1> <p class="text-lg -mt-5 mb-10"> Low-level API changes in order to support the multi-value indexing and querying support that comes with RediSearch 2.6. RediSearch 2.6 comes with multi-value indexing and querying of attributes for any attribute type (Text, Tag, Numeric, Geo and Vector) defined by a JSONPath leading to an array or to multiple scalar values. </p> <h2 id="requirements"> Requirements </h2> <p> RedisJSON v2.4.9 requires: </p> <ul> <li> Minimum Redis compatibility version (database): 6.0.16 </li> <li> Minimum Redis Enterprise Software version (cluster): 6.2.18 </li> </ul> <h2 id="v249-april-2024"> v2.4.9 (April 2024) </h2> <p> This is a maintenance release for RedisJSON 2.4. </p> <p> Update urgency: <code> MODERATE </code> : Program an upgrade of the server, but it's not urgent. </p> <p> Details: </p> <ul> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RedisJSON/RedisJSON/pull/1192"> #1192 </a> Crashes with numeric values greater than i64::MAX (MOD-6501, MOD-4551, MOD-4856, MOD-5714) </li> <li> HDT#228 (Redis Enterprise A-A only) Incorrect error when processing escaped characters (MOD-6645) </li> </ul> </li> </ul> <h2 id="v248-january-2024"> v2.4.8 (January 2024) </h2> <p> This is a maintenance release for RedisJSON 2.4. </p> <p> Update urgency: <code> MODERATE </code> : Program an upgrade of the server, but it's not urgent. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> Ubuntu 16.04 and RHEL 7 are no longer supported as of v2.4.8. </div> </div> <p> Details: </p> <ul> <li> <p> Improvements: </p> <ul> <li> <a href="https://github.com/RedisJSON/RedisJSON/pull/1149"> #1149 </a> Added support for CBL-Mariner 2 </li> </ul> </li> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RedisJSON/RedisJSON/pull/1025"> #1025 </a> <code> JSON.TOGGLE </code> - missing keyspace notification </li> </ul> </li> </ul> <h2 id="v247-april-2023"> v2.4.7 (April 2023) </h2> <p> This is a maintenance release for RedisJSON 2.4. </p> <p> Update urgency: <code> MODERATE </code> : Program an upgrade of the server, but it's not urgent. </p> <p> Details: </p> <ul> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RedisJSON/RedisJSON/issues/947"> #947 </a> Crash when using array slice operator ( <code> [startπŸ”šstep] </code> ) with step <code> 0 </code> </li> </ul> </li> </ul> <h2 id="v246-march-2023"> v2.4.6 (March 2023) </h2> <p> This is a maintenance release for RedisJSON 2.4. </p> <p> Update urgency: <code> MODERATE </code> : Program an upgrade of the server, but it's not urgent. </p> <p> Details: </p> <ul> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RedisJSON/RedisJSON/pull/912"> #912 </a> Fix actual memory usage calculation (MOD-4787) </li> </ul> </li> </ul> <h2 id="v245-february-2023"> v2.4.5 (February 2023) </h2> <p> This is a maintenance release for RedisJSON 2.4. </p> <p> Update urgency: <code> LOW </code> : No need to upgrade unless there are new features you want to use. </p> <p> Details: </p> <ul> <li> <p> Improvements: </p> <ul> <li> Adds support to Redis Enterprise on Ubuntu Linux 20.04 LTS (Focal Fossa) </li> </ul> </li> </ul> <h2 id="v244-february-2023"> v2.4.4 (February 2023) </h2> <p> This is a maintenance release for RedisJSON 2.4. </p> <p> Update urgency: <code> MODERATE </code> : Program an upgrade of the server, but it's not urgent. </p> <p> Details: </p> <ul> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RedisJSON/RedisJSON/pull/919"> #919 </a> Possible failure loading RDB files (MOD-4822) </li> </ul> </li> <li> <p> Improvements: </p> <ul> <li> <a href="https://github.com/RedisJSON/RedisJSON/issues/725"> #725 </a> Improve error messages </li> <li> <a href="https://github.com/RedisJSON/RedisJSON/pull/918"> #918 </a> Add IPv6 to the capabilities list </li> </ul> </li> </ul> <h2 id="v243-december-2022"> v2.4.3 (December 2022) </h2> <p> This is a maintenance release for RedisJSON 2.4. </p> <p> Update urgency: <code> MODERATE </code> : Program an upgrade of the server, but it's not urgent. </p> <p> Details: </p> <ul> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RedisJSON/RedisJSON/pull/890"> #890 </a> JSONPath ignores any filter condition beyond the second (MOD-4602) </li> </ul> </li> <li> <p> Improvements: </p> <ul> <li> <a href="https://github.com/RedisJSON/RedisJSON/pull/892"> #892 </a> Allow <code> JSON.ARRINDEX </code> with nonscalar values </li> </ul> </li> </ul> <h2 id="v24-ga-v242-november-2022"> v2.4 GA (v2.4.2) (November 2022) </h2> <p> This is the General Availability release of RedisJSON 2.4. </p> <h3 id="highlights"> Highlights </h3> <p> RedisJSON 2.4 contains several low-level API changes in order to support the multi-value indexing and querying support that comes with RediSearch 2.6. RediSearch 2.6 comes with multi-value indexing and querying of attributes for any attribute type (Text, Tag, Numeric, Geo and Vector) defined by a JSONPath leading to an array or to multiple scalar values. </p> <h3 id="whats-new-in-24"> What's new in 2.4 </h3> <ul> <li> <p> Features: </p> <ul> <li> <a href="https://github.com/RedisJSON/RedisJSON/pull/848"> #848 </a> Add JSONPath filter the regexp match operator (MOD-4432) </li> <li> <a href="https://github.com/RedisJSON/RedisJSON/pull/861"> #861 </a> Support legacy JSONPath with the dollar sign $ (MOD-4436) </li> </ul> </li> <li> <p> Performance enhancements: </p> <ul> <li> <a href="https://github.com/RedisJSON/RedisJSON/pull/699"> #699 </a> A new JSONPath library which enhances the performance of parsing any JSONPath expression in RedisJSON. </li> </ul> </li> <li> <p> Changing behaviour: </p> <ul> <li> <a href="https://github.com/RedisJSON/RedisJSON/pull/699"> #699 </a> Floating point numbers which become round numbers due to some operation, such as <code> JSON.NUMINCRBY </code> , will now return as a floating point with a trailing <code> .0 </code> , e.g., instead of just <code> 42 </code> , now <code> 42.0 </code> will be returned. </li> </ul> </li> <li> <p> Bugs fixes (since 2.4-RC1/ v2.4.0): </p> <ul> <li> <a href="https://github.com/RedisJSON/RedisJSON/pull/850"> #850 </a> Allow repetition of filter relation instead of optional (MOD-4431) </li> </ul> </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisjson/redisjson-2.4-release-notes/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/references/rest-api/requests/ocsp/test/.html
<section class="prose w-full py-12 max-w-none"> <h1> OCSP test requests </h1> <p class="text-lg -mt-5 mb-10"> OCSP test requests </p> <table> <thead> <tr> <th> Method </th> <th> Path </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="#post-test"> POST </a> </td> <td> <code> /v1/ocsp/test </code> </td> <td> Test OCSP </td> </tr> </tbody> </table> <h2 id="post-test"> Test OCSP </h2> <pre><code>POST /v1/ocsp/test </code></pre> <p> Queries the OCSP server for the proxy certificate’s latest status and returns the response as JSON. It caches the response if the OCSP feature is enabled. </p> <h4 id="required-permissions"> Required permissions </h4> <table> <thead> <tr> <th> Permission name </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/references/rest-api/permissions/#test_ocsp_status"> test_ocsp_status </a> </td> </tr> </tbody> </table> <h3 id="post-request"> Request </h3> <h4 id="example-http-request"> Example HTTP request </h4> <pre><code>POST /ocsp/test </code></pre> <h4 id="request-headers"> Request headers </h4> <table> <thead> <tr> <th> Key </th> <th> Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> Host </td> <td> cnm.cluster.fqdn </td> <td> Domain name </td> </tr> <tr> <td> Accept </td> <td> application/json </td> <td> Accepted media type </td> </tr> </tbody> </table> <h3 id="post-response"> Response </h3> <p> Returns an <a href="/docs/latest/operate/rs/references/rest-api/objects/ocsp_status/"> OCSP status object </a> . </p> <h4 id="example-json-body"> Example JSON body </h4> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"responder_url"</span><span class="p">:</span> <span class="s2">"http://responder.ocsp.url.com"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"cert_status"</span><span class="p">:</span> <span class="s2">"REVOKED"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"produced_at"</span><span class="p">:</span> <span class="s2">"Wed, 22 Dec 2021 12:50:11 GMT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"this_update"</span><span class="p">:</span> <span class="s2">"Wed, 22 Dec 2021 12:50:11 GMT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"next_update"</span><span class="p">:</span> <span class="s2">"Wed, 22 Dec 2021 14:50:00 GMT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"revocation_time"</span><span class="p">:</span> <span class="s2">"Wed, 22 Dec 2021 12:50:04 GMT"</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <h3 id="post-error-codes"> Error codes </h3> <p> When errors occur, the server returns a JSON object with <code> error_code </code> and <code> message </code> fields that provide additional information. The following are possible <code> error_code </code> values: </p> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> no_responder_url </td> <td> Tried to test OCSP status with no responder URL configured </td> </tr> <tr> <td> ocsp_unsupported_by_capability </td> <td> Not all nodes support OCSP capability </td> </tr> <tr> <td> task_queued_for_too_long </td> <td> OCSP polling task was in status β€œqueued” for over 5 seconds </td> </tr> <tr> <td> invalid_ocsp_response </td> <td> The server returned a response that is not compatible with OCSP </td> </tr> </tbody> </table> <h3 id="post-status-codes"> Status codes </h3> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1"> 200 OK </a> </td> <td> Success querying the OCSP server </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7"> 406 Not Acceptable </a> </td> <td> Feature is not supported in all nodes </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1"> 500 Internal Server Error </a> </td> <td> <code> responder_url </code> is not configured or polling task failed </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/rest-api/requests/ocsp/test/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/references/rest-api/objects/statistics/cluster-metrics/.html
<section class="prose w-full py-12 max-w-none"> <h1> Cluster metrics </h1> <p class="text-lg -mt-5 mb-10"> Documents the cluster metrics used with Redis Enterprise Software REST API calls. </p> <table> <thead> <tr> <th> Metric name </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> available_flash </td> <td> float </td> <td> Sum of available flash in all nodes (bytes) </td> </tr> <tr> <td> available_memory </td> <td> float </td> <td> Sum of available memory in all nodes (bytes) </td> </tr> <tr> <td> avg_latency </td> <td> float </td> <td> Average latency of requests handled by all cluster endpoints (micro-sec); returned only when there is traffic </td> </tr> <tr> <td> bigstore_free </td> <td> float </td> <td> Sum of free space of backend flash (used by flash DB's BigRedis) on all cluster nodes (bytes); only returned when BigRedis is enabled </td> </tr> <tr> <td> bigstore_iops </td> <td> float </td> <td> Rate of I/O operations against backend flash for all shards which are part of a flash-based DB (BigRedis) in the cluster (ops/sec); returned only when BigRedis is enabled </td> </tr> <tr> <td> bigstore_kv_ops </td> <td> float </td> <td> Rate of value read/write operations against back-end flash for all shards which are part of a flash based DB (BigRedis) in cluster (ops/sec); only returned when BigRedis is enabled </td> </tr> <tr> <td> bigstore_throughput </td> <td> float </td> <td> Throughput I/O operations against backend flash for all shards which are part of a flash-based DB (BigRedis) in the cluster (bytes/sec); only returned when BigRedis is enabled </td> </tr> <tr> <td> conns </td> <td> float </td> <td> Total number of clients connected to all cluster endpoints </td> </tr> <tr> <td> cpu_idle </td> <td> float </td> <td> CPU idle time portion, the value is weighted between all nodes based on number of cores in each node (0-1, multiply by 100 to get percent) </td> </tr> <tr> <td> cpu_system </td> <td> float </td> <td> CPU time portion spent in kernel on the cluster, the value is weighted between all nodes based on number of cores in each node (0-1, multiply by 100 to get percent) </td> </tr> <tr> <td> cpu_user </td> <td> float </td> <td> CPU time portion spent by users-pace processes on the cluster. The value is weighted between all nodes based on number of cores in each node (0-1, multiply by 100 to get percent). </td> </tr> <tr> <td> egress_bytes </td> <td> float </td> <td> Sum of rate of outgoing network traffic on all cluster nodes (bytes/sec) </td> </tr> <tr> <td> ephemeral_storage_avail </td> <td> float </td> <td> Sum of disk space available to Redis Enterprise processes on configured ephemeral disk on all cluster nodes (bytes) </td> </tr> <tr> <td> ephemeral_storage_free </td> <td> float </td> <td> Sum of free disk space on configured ephemeral disk on all cluster nodes (bytes) </td> </tr> <tr> <td> free_memory </td> <td> float </td> <td> Sum of free memory in all cluster nodes (bytes) </td> </tr> <tr> <td> ingress_bytes </td> <td> float </td> <td> Sum of rate of incoming network traffic on all cluster nodes (bytes/sec) </td> </tr> <tr> <td> persistent_storage_avail </td> <td> float </td> <td> Sum of disk space available to Redis Enterprise processes on configured persistent disk on all cluster nodes (bytes) </td> </tr> <tr> <td> persistent_storage_free </td> <td> float </td> <td> Sum of free disk space on configured persistent disk on all cluster nodes (bytes) </td> </tr> <tr> <td> provisional_flash </td> <td> float </td> <td> Sum of provisional flash in all nodes (bytes) </td> </tr> <tr> <td> provisional_memory </td> <td> float </td> <td> Sum of provisional memory in all nodes (bytes) </td> </tr> <tr> <td> total_req </td> <td> float </td> <td> Request rate handled by all endpoints on the cluster (ops/sec) </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/rest-api/objects/statistics/cluster-metrics/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/release-notes/legacy-release-notes/.html
<section class="prose w-full py-12 max-w-none"> <h1> Previous releases </h1> <p class="text-lg -mt-5 mb-10"> Release notes for Redis Enterprise Software 5.6.0 (April 2020) and earlier versions. </p> <table> <thead> <tr> <th style="text-align:left"> VersionΒ (ReleaseΒ date) </th> <th style="text-align:left"> Major changes </th> <th style="text-align:left"> OSSΒ Redis compatibility </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rs-5-6-0-april-2020/"> 5.6.0 (April 2020) </a> </td> <td style="text-align:left"> Install improvements for RHEL 6 and 7. Active-Active support for HyperLogLog. Auto Tiering now supports RedisJSON. Active-Active default changes for high availability and OSS Cluster API support. Backup support for Google Cloud Storage and Azure Blob storage. </td> <td style="text-align:left"> Redis 5.0.8 </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rs-5-5-preview-april-2019/"> 5.5 preview (April 2019) </a> </td> <td style="text-align:left"> Preview release. Databases support multiple modules. </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rs-5-4-14-february-2020/"> 5.4.14 (February 2020) </a> </td> <td style="text-align:left"> </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rs-5-4-10-december-2019/"> 5.4.10 (December 2019) </a> </td> <td style="text-align:left"> </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rs-5-4-6-july-2019/"> 5.4.6 (July 2019) </a> </td> <td style="text-align:left"> </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rs-5-4-4-june-2019/"> 5.4.4 (June 2019) </a> </td> <td style="text-align:left"> </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rs-5-4-2-april-2019/"> 5.4.2 (April 2019) </a> </td> <td style="text-align:left"> </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rs-5-4-december-2018/"> 5.4 (December 2018) </a> </td> <td style="text-align:left"> </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rs-5-2-2-august-2018/"> 5.2.2 (August 2018) </a> </td> <td style="text-align:left"> </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rs-5-3-beta-july-2018/"> 5.3 beta(July 2018) </a> </td> <td style="text-align:left"> </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rs-5-2-june-2018/"> 5.2 (June 2018) </a> </td> <td style="text-align:left"> </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/release-notes-redis-enterprise-software-v5-0-2/"> 5.0.2 (2018 March) </a> </td> <td style="text-align:left"> </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/redis-enterprise-5/"> 5.0 (November 2017) </a> </td> <td style="text-align:left"> </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/redis-pack-4-5-0-may-2017/"> 4.5 (May 2017) </a> </td> <td style="text-align:left"> </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rlec-4-4-dec-2016/"> 4.4 (December 2016) </a> </td> <td style="text-align:left"> </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rlec-4-3-aug-2016/"> 4.3.0-230 (August 2, 2016) </a> </td> <td style="text-align:left"> </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rlec-4-2-october-2015/"> 4.2.1-30 (October 18, 2015) </a> </td> <td style="text-align:left"> </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rlec-4-0-june-2015/"> 4.0.0-49 (June 18, 2015) </a> </td> <td style="text-align:left"> </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rlec-0-99-february-2015/"> 0.99.5-24 (February 15, 2015) </a> </td> <td style="text-align:left"> </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rlec-0-99-5-11-january-2015/"> 0.99.5-11 (January 5, 2015) </a> </td> <td style="text-align:left"> </td> <td style="text-align:left"> </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/release-notes/legacy-release-notes/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> β˜… </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> β˜… </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> β˜… </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> β˜… </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> β˜… </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>