<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>k6/x/redis on Grafana Labs</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-x-redis/</link><description>Recent content in k6/x/redis on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/k6/v2.3.x/javascript-api/k6-x-redis/index.xml" rel="self" type="application/rss+xml"/><item><title>Client</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/</guid><content><![CDATA[&lt;h1 id=&#34;client&#34;&gt;Client&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;Client&lt;/code&gt; is a &lt;a href=&#34;https://redis.io&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Redis&lt;/a&gt; client to interact with a Redis server, sentinel, or cluster. It exposes a promise-based API, which users can interact with in an asynchronous manner.&lt;/p&gt;
&lt;p&gt;Though the API intends to be thorough and extensive, it does not expose the whole Redis API. Instead, the intent is to expose Redis for use cases most appropriate to k6.&lt;/p&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&lt;/h2&gt;
&lt;h3 id=&#34;single-node-server&#34;&gt;Single-node server&lt;/h3&gt;
&lt;p&gt;You can create a new &lt;code&gt;Client&lt;/code&gt; instance that connects to a single Redis server by passing a URL string.
It must be in the format:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;redis[s]://[[username][:password]@][host][:port][/db-number]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Here&amp;rsquo;s an example of a URL string that connects to a Redis server running on localhost, on the default port (6379), and using the default database (0):&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import redis from &amp;#39;k6/x/redis&amp;#39;;

const client = new redis.Client(&amp;#39;redis://localhost:6379&amp;#39;);&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;A client can also be instantiated using an 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/redis-options/&#34;&gt;options&lt;/a&gt; object to support more complex use cases, and for more flexibility:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import redis from &amp;#39;k6/x/redis&amp;#39;;

const client = new redis.Client({
  socket: {
    host: &amp;#39;localhost&amp;#39;,
    port: 6379,
  },
  username: &amp;#39;someusername&amp;#39;,
  password: &amp;#39;somepassword&amp;#39;,
});&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;tls&#34;&gt;TLS&lt;/h3&gt;
&lt;p&gt;You can configure a TLS connection in a couple of ways.&lt;/p&gt;
&lt;p&gt;If the server has a certificate signed by a public Certificate Authority, you can use the &lt;code&gt;rediss&lt;/code&gt; URL scheme:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import redis from &amp;#39;k6/x/redis&amp;#39;;

const client = new redis.Client(&amp;#39;rediss://example.com&amp;#39;);&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Otherwise, you can supply your own self-signed certificate in PEM format using the 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/redis-options/#tls-configuration-options-tlsoptions&#34;&gt;socket.tls&lt;/a&gt; object:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import redis from &amp;#39;k6/x/redis&amp;#39;;

const client = new redis.Client({
  socket: {
    host: &amp;#39;localhost&amp;#39;,
    port: 6379,
    tls: {
      ca: [open(&amp;#39;ca.crt&amp;#39;)],
    },
  },
});&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Note that for self-signed certificates, k6&amp;rsquo;s 
    &lt;a href=&#34;/docs/k6/v2.3.x/using-k6/k6-options/reference/#insecure-skip-tls-verify&#34;&gt;insecureSkipTLSVerify&lt;/a&gt; option must be enabled (set to &lt;code&gt;true&lt;/code&gt;).&lt;/p&gt;
&lt;h4 id=&#34;tls-client-authentication-mtls&#34;&gt;TLS client authentication (mTLS)&lt;/h4&gt;
&lt;p&gt;You can also enable mTLS by setting two additional properties in the 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/redis-options/#tls-configuration-options-tlsoptions&#34;&gt;socket.tls&lt;/a&gt; object:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import redis from &amp;#39;k6/x/redis&amp;#39;;

const client = new redis.Client({
  socket: {
    host: &amp;#39;localhost&amp;#39;,
    port: 6379,
    tls: {
      ca: [open(&amp;#39;ca.crt&amp;#39;)],
      cert: open(&amp;#39;client.crt&amp;#39;), // client certificate
      key: open(&amp;#39;client.key&amp;#39;), // client private key
    },
  },
});&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;cluster-client&#34;&gt;Cluster client&lt;/h3&gt;
&lt;p&gt;You can connect to a cluster of Redis servers by using the 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/redis-options/#redis-cluster-options-clusteroptions&#34;&gt;cluster&lt;/a&gt; configuration property, and passing 2 or more node URLs:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import redis from &amp;#39;k6/x/redis&amp;#39;;

const client = new redis.Client({
  cluster: {
    // Cluster options
    maxRedirects: 3,
    readOnly: true,
    routeByLatency: true,
    routeRandomly: true,
    nodes: [&amp;#39;redis://host1:6379&amp;#39;, &amp;#39;redis://host2:6379&amp;#39;],
  },
});&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Or the same as above, but passing 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/redis-options/#socket-connection-options-socketoptions&#34;&gt;socket&lt;/a&gt; objects to the nodes array instead of URLs:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import redis from &amp;#39;k6/x/redis&amp;#39;;

const client = new redis.Client({
  cluster: {
    nodes: [
      {
        socket: {
          host: &amp;#39;host1&amp;#39;,
          port: 6379,
        },
      },
      {
        socket: {
          host: &amp;#39;host2&amp;#39;,
          port: 6379,
        },
      },
    ],
  },
});&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;sentinel-client&#34;&gt;Sentinel client&lt;/h3&gt;
&lt;p&gt;A &lt;a href=&#34;https://redis.io/docs/management/sentinel/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Redis Sentinel&lt;/a&gt; provides high availability features, as an alternative to a Redis cluster.&lt;/p&gt;
&lt;p&gt;You can connect to a sentinel instance by setting additional 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/redis-options/&#34;&gt;options&lt;/a&gt; in the object passed to the &lt;code&gt;Client&lt;/code&gt; constructor:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import redis from &amp;#39;k6/x/redis&amp;#39;;

const client = new redis.Client({
  username: &amp;#39;someusername&amp;#39;,
  password: &amp;#39;somepassword&amp;#39;,
  socket: {
    host: &amp;#39;localhost&amp;#39;,
    port: 6379,
  },
  // Sentinel options
  masterName: &amp;#39;masterhost&amp;#39;,
  sentinelUsername: &amp;#39;sentineluser&amp;#39;,
  sentinelPassword: &amp;#39;sentinelpass&amp;#39;,
});&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;real-world-example&#34;&gt;Real world example&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { check } from &amp;#39;k6&amp;#39;;
import http from &amp;#39;k6/http&amp;#39;;
import redis from &amp;#39;k6/x/redis&amp;#39;;
import exec from &amp;#39;k6/execution&amp;#39;;
import { textSummary } from &amp;#39;https://jslib.k6.io/k6-summary/0.0.2/index.js&amp;#39;;

export const options = {
  scenarios: {
    redisPerformance: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      vus: 10,
      iterations: 200,
      exec: &amp;#39;measureRedisPerformance&amp;#39;,
    },
    usingRedisData: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      vus: 10,
      iterations: 200,
      exec: &amp;#39;measureUsingRedisData&amp;#39;,
    },
  },
};

// Instantiate a new redis client
const redisClient = new redis.Client(`redis://localhost:6379`);

// Prepare an array of rating ids for later use
// in the context of the measureUsingRedisData function.
const ratingIDs = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);

export async function measureRedisPerformance() {
  // VUs are executed in a parallel fashion,
  // thus, to ensure that parallel VUs are not
  // modifying the same key at the same time,
  // we use keys indexed by the VU id.
  const key = `foo-${exec.vu.idInTest}`;

  await redisClient.set(key, 1);
  await redisClient.incrBy(key, 10);
  const value = await redisClient.get(key);
  if (value !== &amp;#39;11&amp;#39;) {
    throw new Error(&amp;#39;foo should have been incremented to 11&amp;#39;);
  }

  await redisClient.del(key);
  if ((await redisClient.exists(key)) !== 0) {
    throw new Error(&amp;#39;foo should have been deleted&amp;#39;);
  }
}

export async function setup() {
  await redisClient.sadd(&amp;#39;rating_ids&amp;#39;, ...ratingIDs);
}

export async function measureUsingRedisData() {
  // Pick a random rating id from the dedicated redis set,
  // we have filled in setup().
  const randomID = await redisClient.srandmember(&amp;#39;rating_ids&amp;#39;);
  const url = `https://quickpizza.grafana.com/api/ratings/${randomID}`;
  const res = await http.asyncRequest(&amp;#39;GET&amp;#39;, url, {
    headers: { Authorization: &amp;#39;token abcdef0123456789&amp;#39; },
  });

  check(res, { &amp;#39;status is 200&amp;#39;: (r) =&amp;gt; r.status === 200 });

  await redisClient.hincrby(&amp;#39;k6_rating_fetched&amp;#39;, url, 1);
}

export async function teardown() {
  await redisClient.del(&amp;#39;rating_ids&amp;#39;);
}

export function handleSummary(data) {
  redisClient
    .hgetall(&amp;#39;k6_rating_fetched&amp;#39;)
    .then((fetched) =&amp;gt; Object.assign(data, { k6_rating_fetched: fetched }))
    .then((data) =&amp;gt; redisClient.set(`k6_report_${Date.now()}`, JSON.stringify(data)))
    .then(() =&amp;gt; redisClient.del(&amp;#39;k6_rating_fetched&amp;#39;));

  return {
    stdout: textSummary(data, { indent: &amp;#39;  &amp;#39;, enableColors: true }),
  };
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;api&#34;&gt;API&lt;/h2&gt;
&lt;h3 id=&#34;key-value-methods&#34;&gt;Key value methods&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th style=&#34;text-align: left&#34;&gt;Method&lt;/th&gt;
              &lt;th style=&#34;text-align: left&#34;&gt;Redis command&lt;/th&gt;
              &lt;th style=&#34;text-align: left&#34;&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-set/&#34;&gt;&lt;code&gt;Client.set(key, value, expiration)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/set&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;SET&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Set &lt;code&gt;key&lt;/code&gt; to hold &lt;code&gt;value&lt;/code&gt;, with a time to live equal to &lt;code&gt;expiration&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-get/&#34;&gt;&lt;code&gt;Client.get(key)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/get&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;GET&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Get the value of &lt;code&gt;key&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-getset/&#34;&gt;&lt;code&gt;Client.getSet(key, value)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/getset&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;GETSET&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Atomically sets &lt;code&gt;key&lt;/code&gt; to &lt;code&gt;value&lt;/code&gt; and returns the old value stored at &lt;code&gt;key&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-del/&#34;&gt;&lt;code&gt;Client.del(keys)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/del&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;DEL&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Removes the specified keys.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-getdel/&#34;&gt;&lt;code&gt;Client.getDel(key)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/getdel&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;GETDEL&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Get the value of &lt;code&gt;key&lt;/code&gt; and delete the key.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-exists/&#34;&gt;&lt;code&gt;Client.exists(keys)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/exists&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;EXISTS&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Returns the number of &lt;code&gt;key&lt;/code&gt; arguments that exist.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-incr/&#34;&gt;&lt;code&gt;Client.incr(key)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/incr&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;INCR&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Increments the number stored at &lt;code&gt;key&lt;/code&gt; by one.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-incrby/&#34;&gt;&lt;code&gt;Client.incrBy(key, increment)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/incrby&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;INCRBY&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Increments the number stored at &lt;code&gt;key&lt;/code&gt; by &lt;code&gt;increment&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-decr/&#34;&gt;&lt;code&gt;Client.decr(key)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/decr&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;DECR&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Decrements the number stored at &lt;code&gt;key&lt;/code&gt; by one.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-decrby/&#34;&gt;&lt;code&gt;Client.decrBy(key, decrement)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/decrby&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;DECRBY&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Decrements the number stored at &lt;code&gt;key&lt;/code&gt; by &lt;code&gt;decrement&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-randomkey/&#34;&gt;&lt;code&gt;Client.randomKey()&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/randomkey&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;RANDOMKEY&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Returns a random key&amp;rsquo;s value.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-mget/&#34;&gt;&lt;code&gt;Client.mget(keys)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/mget&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;MGET&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Returns the values of all specified keys.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-expire/&#34;&gt;&lt;code&gt;Client.expire(key, seconds)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/expire&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;EXPIRE&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Sets a timeout on key, after which the key will automatically be deleted.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-ttl/&#34;&gt;&lt;code&gt;Client.ttl(key)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/ttl&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;TTL&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Returns the remaining time to live of a key that has a timeout.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-persist/&#34;&gt;&lt;code&gt;Client.persist(key)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/persist&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;PERSIST&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Removes the existing timeout on key.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;list-methods&#34;&gt;List methods&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th style=&#34;text-align: left&#34;&gt;Method&lt;/th&gt;
              &lt;th style=&#34;text-align: left&#34;&gt;Redis command&lt;/th&gt;
              &lt;th style=&#34;text-align: left&#34;&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-lpush/&#34;&gt;&lt;code&gt;Client.lpush(key, values)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/lpush&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;LPSUH&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Inserts all the specified values at the head of the list stored at &lt;code&gt;key&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-rpush/&#34;&gt;&lt;code&gt;Client.rpush(key, values)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/rpush&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;RPUSH&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Inserts all the specified values at the tail of the list stored at &lt;code&gt;key&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-lpop/&#34;&gt;&lt;code&gt;Client.lpop(key)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/lpop&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;LPOP&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Removes and returns the first element of the list stored at &lt;code&gt;key&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-rpop/&#34;&gt;&lt;code&gt;Client.rpop(key)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/rpop&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;RPOP&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Removes and returns the last element of the list stored at &lt;code&gt;key&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-lrange/&#34;&gt;&lt;code&gt;Client.lrange(key, start, stop)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/lrange&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;LRANGE&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Returns the specified elements of the list stored at &lt;code&gt;key&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-lindex/&#34;&gt;&lt;code&gt;Client.lindex(key, start, stop)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/lindex&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;LINDEX&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Returns the specified element of the list stored at &lt;code&gt;key&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-lset/&#34;&gt;&lt;code&gt;Client.lset(key, index, element)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/lset&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;LSET&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Sets the list element at &lt;code&gt;index&lt;/code&gt; to &lt;code&gt;element&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-lrem/&#34;&gt;&lt;code&gt;Client.lrem(key, count, value)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/lrem&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;LREM&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Removes the first &lt;code&gt;count&lt;/code&gt; occurrences of &lt;code&gt;value&lt;/code&gt; from the list stored at &lt;code&gt;key&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-llen/&#34;&gt;&lt;code&gt;Client.llen(key)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/llen&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;LLEN&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Returns the length of the list stored at &lt;code&gt;key&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;hash-methods&#34;&gt;Hash methods&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th style=&#34;text-align: left&#34;&gt;Method&lt;/th&gt;
              &lt;th style=&#34;text-align: left&#34;&gt;Redis command&lt;/th&gt;
              &lt;th style=&#34;text-align: left&#34;&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-hset/&#34;&gt;&lt;code&gt;Client.hset(key, field, value)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/hset&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;HSET&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Sets the specified field in the hash stored at &lt;code&gt;key&lt;/code&gt; to &lt;code&gt;value&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-hsetnx/&#34;&gt;&lt;code&gt;Client.hsetnx(key, field, value)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/hsetnx&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;HSETNX&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Sets the specified field in the hash stored at &lt;code&gt;key&lt;/code&gt; to &lt;code&gt;value&lt;/code&gt;, only if &lt;code&gt;field&lt;/code&gt; does not yet exist.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-hget/&#34;&gt;&lt;code&gt;Client.hget(key, field)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/hget&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;HGET&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Returns the value associated with &lt;code&gt;field&lt;/code&gt; in the hash stored at &lt;code&gt;key&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-hdel/&#34;&gt;&lt;code&gt;Client.hdel(key, fields)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/hdel&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;HDEL&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Deletes the specified fields from the hash stored at &lt;code&gt;key&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-hgetall/&#34;&gt;&lt;code&gt;Client.hgetall(key)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/hgetall&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;HGETALL&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Returns all fields and values of the hash stored at &lt;code&gt;key&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-hkeys/&#34;&gt;&lt;code&gt;Client.hkeys(key)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/hkeys&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;HKEYS&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Returns all fields of the hash stored at &lt;code&gt;key&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-hvals/&#34;&gt;&lt;code&gt;Client.hvals(key)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/hvals&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;HVALS&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Returns all values of the hash stored at &lt;code&gt;key&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-hlen/&#34;&gt;&lt;code&gt;Client.hlen(key)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/hlen&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;HLEN&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Returns the number of fields in the hash stored at &lt;code&gt;key&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-hincrby/&#34;&gt;&lt;code&gt;Client.hincrby(key, field, increment)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/hincrby&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;HINCRBY&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Increments the integer value of &lt;code&gt;field&lt;/code&gt; in the hash stored at &lt;code&gt;key&lt;/code&gt; by &lt;code&gt;increment&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;set-methods&#34;&gt;Set methods&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th style=&#34;text-align: left&#34;&gt;Method&lt;/th&gt;
              &lt;th style=&#34;text-align: left&#34;&gt;Redis command&lt;/th&gt;
              &lt;th style=&#34;text-align: left&#34;&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-sadd/&#34;&gt;&lt;code&gt;Client.sadd(key, members)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/sadd&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;SADD&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Adds the specified members to the set stored at &lt;code&gt;key&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-srem/&#34;&gt;&lt;code&gt;Client.srem(key, members)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/srem&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;SREM&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Removes the specified members from the set stored at &lt;code&gt;key&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-sismember/&#34;&gt;&lt;code&gt;Client.sismember(key, member)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/sismember&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;SISMEMBER&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Returns if member is a member of the set stored at &lt;code&gt;key&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-smembers/&#34;&gt;&lt;code&gt;Client.smembers(key)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/smembers&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;SMEMBERS&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Returns all the members of the set values stored at &lt;code&gt;keys&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-srandmember/&#34;&gt;&lt;code&gt;Client.srandmember(key)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/srandmember&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;SRANDMEMBER&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Returns a random element from the set value stored at &lt;code&gt;key&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-spop/&#34;&gt;&lt;code&gt;Client.spop(key)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;strong&gt;&lt;a href=&#34;https://redis.io/commands/spop&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;SPOP&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Removes and returns a random element from the set value stored at &lt;code&gt;key&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;miscellaneous&#34;&gt;Miscellaneous&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th style=&#34;text-align: left&#34;&gt;Method&lt;/th&gt;
              &lt;th style=&#34;text-align: left&#34;&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/client-sendcommand/&#34;&gt;&lt;code&gt;Client.sendCommand(command, args)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Send a command to the Redis server.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;!-- md-k6:skipall --&gt;
]]></content><description>&lt;h1 id="client">Client&lt;/h1>
&lt;p>&lt;code>Client&lt;/code> is a &lt;a href="https://redis.io" target="_blank" rel="noopener noreferrer">Redis&lt;/a> client to interact with a Redis server, sentinel, or cluster. It exposes a promise-based API, which users can interact with in an asynchronous manner.&lt;/p></description></item><item><title>Options</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-x-redis/redis-options/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-x-redis/redis-options/</guid><content><![CDATA[&lt;h1 id=&#34;redis-options&#34;&gt;Redis options&lt;/h1&gt;
&lt;p&gt;You can configure the 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-experimental/redis/client/&#34;&gt;Redis Client&lt;/a&gt; by using a Redis connection URL as demonstrated in the 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/#usage&#34;&gt;client documentation&lt;/a&gt;, or by using an &lt;a href=&#34;#options&#34;&gt;Options&lt;/a&gt; object to access more advanced configuration.&lt;/p&gt;
&lt;h2 id=&#34;options&#34;&gt;Options&lt;/h2&gt;
&lt;p&gt;The configuration for the overall Redis client, including authentication and connection settings.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Option Name&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;socket&lt;/td&gt;
              &lt;td&gt;&lt;a href=&#34;#socket-connection-options&#34;&gt;SocketOptions&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;The configuration of the connection socket used to connect to the Redis server.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;username&lt;/td&gt;
              &lt;td&gt;String (optional)&lt;/td&gt;
              &lt;td&gt;Username for client authentication.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;password&lt;/td&gt;
              &lt;td&gt;String (optional)&lt;/td&gt;
              &lt;td&gt;Password for client authentication.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;clientName&lt;/td&gt;
              &lt;td&gt;String (optional)&lt;/td&gt;
              &lt;td&gt;Name for the client connection.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;database&lt;/td&gt;
              &lt;td&gt;Number (optional)&lt;/td&gt;
              &lt;td&gt;Database ID to select after connecting.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;masterName&lt;/td&gt;
              &lt;td&gt;String (optional)&lt;/td&gt;
              &lt;td&gt;Master instance name for Sentinel.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;sentinelUsername&lt;/td&gt;
              &lt;td&gt;String (optional)&lt;/td&gt;
              &lt;td&gt;Username for Sentinel authentication.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;sentinelPassword&lt;/td&gt;
              &lt;td&gt;String (optional)&lt;/td&gt;
              &lt;td&gt;Password for Sentinel authentication.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;cluster&lt;/td&gt;
              &lt;td&gt;&lt;a href=&#34;#redis-cluster-options&#34;&gt;ClusterOptions&lt;/a&gt; (optional)&lt;/td&gt;
              &lt;td&gt;The configuration for Redis Cluster connections.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;socket-connection-options&#34;&gt;Socket Connection Options&lt;/h3&gt;
&lt;p&gt;Socket-level settings for connecting to a Redis server.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Option Name&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;host&lt;/td&gt;
              &lt;td&gt;String&lt;/td&gt;
              &lt;td&gt;IP address or hostname of the Redis server.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;port&lt;/td&gt;
              &lt;td&gt;Number (optional)&lt;/td&gt;
              &lt;td&gt;Port number of the Redis server.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;tls&lt;/td&gt;
              &lt;td&gt;&lt;a href=&#34;#tls-configuration-options&#34;&gt;TLSOptions&lt;/a&gt; (optional)&lt;/td&gt;
              &lt;td&gt;The configuration for TLS/SSL.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;dialTimeout&lt;/td&gt;
              &lt;td&gt;Number (optional, default is &lt;em&gt;5&lt;/em&gt; (seconds))&lt;/td&gt;
              &lt;td&gt;Timeout for establishing a connection, in seconds.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;readTimeout&lt;/td&gt;
              &lt;td&gt;Number (optional, default is &lt;em&gt;3&lt;/em&gt; (seconds))&lt;/td&gt;
              &lt;td&gt;Timeout for socket reads, in seconds. A value of &lt;code&gt;-1&lt;/code&gt; disables the timeout.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;writeTimeout&lt;/td&gt;
              &lt;td&gt;Number (optional, default is &lt;code&gt;readTimeout&lt;/code&gt;)&lt;/td&gt;
              &lt;td&gt;Timeout for socket writes, in seconds. A value of &lt;code&gt;-1&lt;/code&gt; disables the timeout.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;poolSize&lt;/td&gt;
              &lt;td&gt;Number (optional, default is &lt;em&gt;10&lt;/em&gt; (per CPU))&lt;/td&gt;
              &lt;td&gt;Number of socket connections in the pool per CPU.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;minIdleConns&lt;/td&gt;
              &lt;td&gt;Number (optional, default is &lt;em&gt;0&lt;/em&gt; (idle connections are not closed by default))&lt;/td&gt;
              &lt;td&gt;Minimum number of idle connections in the pool.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;maxConnAge&lt;/td&gt;
              &lt;td&gt;Number (optional, default is &lt;em&gt;0&lt;/em&gt; (no maximum idle time))&lt;/td&gt;
              &lt;td&gt;Maximum time before closing a connection.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;poolTimeout&lt;/td&gt;
              &lt;td&gt;Number (optional, &lt;code&gt;readTimeout &#43; 1&lt;/code&gt;)&lt;/td&gt;
              &lt;td&gt;Timeout for acquiring a connection from the pool.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;idleTimeout&lt;/td&gt;
              &lt;td&gt;Number (optional, &lt;code&gt;readTimeout &#43; 1&lt;/code&gt;)&lt;/td&gt;
              &lt;td&gt;Timeout for idle connections in the pool.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;idleCheckFrequency&lt;/td&gt;
              &lt;td&gt;Number (optional, default is &lt;em&gt;1&lt;/em&gt; (minute))&lt;/td&gt;
              &lt;td&gt;Frequency of idle connection checks, in minutes. A value of &lt;code&gt;-1&lt;/code&gt; disables the checks.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h4 id=&#34;tls-configuration-options&#34;&gt;TLS Configuration Options&lt;/h4&gt;
&lt;p&gt;Options for establishing a secure TLS connection.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Option Name&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;ca&lt;/td&gt;
              &lt;td&gt;ArrayBuffer[]&lt;/td&gt;
              &lt;td&gt;Array of CA certificates.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;cert&lt;/td&gt;
              &lt;td&gt;ArrayBuffer (optional)&lt;/td&gt;
              &lt;td&gt;Client certificate for mutual TLS.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;key&lt;/td&gt;
              &lt;td&gt;ArrayBuffer (optional)&lt;/td&gt;
              &lt;td&gt;Private key associated with the client certificate.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;redis-cluster-options&#34;&gt;Redis Cluster Options&lt;/h3&gt;
&lt;p&gt;Options for behavior in a Redis Cluster setup.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Option Name&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;maxRedirects&lt;/td&gt;
              &lt;td&gt;Number (optional, default is &lt;em&gt;3&lt;/em&gt; retries)&lt;/td&gt;
              &lt;td&gt;Maximum number of command redirects.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;readOnly&lt;/td&gt;
              &lt;td&gt;Boolean (optional)&lt;/td&gt;
              &lt;td&gt;Enables read-only mode for replicas.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;routeByLatency&lt;/td&gt;
              &lt;td&gt;Boolean (optional)&lt;/td&gt;
              &lt;td&gt;Route read commands by latency.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;routeRandomly&lt;/td&gt;
              &lt;td&gt;Boolean (optional)&lt;/td&gt;
              &lt;td&gt;Random routing for read commands.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;nodes&lt;/td&gt;
              &lt;td&gt;String[] or &lt;a href=&#34;#socket-connection-options&#34;&gt;SocketOptions&lt;/a&gt;[]&lt;/td&gt;
              &lt;td&gt;List of cluster nodes as URLs or &lt;a href=&#34;#socket-connection-options&#34;&gt;SocketOptions&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="redis-options">Redis options&lt;/h1>
&lt;p>You can configure the
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-experimental/redis/client/">Redis Client&lt;/a> by using a Redis connection URL as demonstrated in the
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-x-redis/client/#usage">client documentation&lt;/a>, or by using an &lt;a href="#options">Options&lt;/a> object to access more advanced configuration.&lt;/p></description></item></channel></rss>