> ## Documentation Index
> Fetch the complete documentation index at: https://ngquct-docs-fix-500-query-results.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Redis

> Browse keys by namespace, manage TTLs, and run Redis commands directly from the editor

The sidebar splits keys into folders at every `:`, and each key gets a grid row with its type, TTL, length, and value. The editor takes Redis commands, one per statement, and passes them through as written. Redis needs no plugin: its hiredis-based driver is part of the app, and it reaches standalone servers, Sentinel-managed primaries, and Redis Cluster.

## Quick setup

<Steps>
  <Step title="Create Connection">
    Click **Create Connection…**, select **Redis**, and enter host, port, password, and database index
  </Step>

  <Step title="Test Connection">
    Click **Test Connection**, then **Save & Connect**
  </Step>
</Steps>

## Connection settings

| Field               | Default      | Notes                                                                                  |
| ------------------- | ------------ | -------------------------------------------------------------------------------------- |
| **Connection Mode** | `Standalone` | `Sentinel` for a Sentinel-managed primary, `Cluster` for a sharded cluster             |
| **Host**            | `localhost`  | Standalone only                                                                        |
| **Port**            | `6379`       | Standalone only                                                                        |
| **Username**        | -            | Redis 6 ACL user, sent as `AUTH username password`. Leave empty for `requirepass` auth |
| **Password**        | -            | Leave empty for local dev                                                              |
| **Database Index**  | `0`          | 0-15 stepper, in the Advanced section                                                  |
| **Key Separator**   | `:`          | What the sidebar splits key names on (Advanced)                                        |

No minimum server version. ACL users need Redis 6, a Sentinel ACL user needs 6.2, and Cluster mode reads routing tips from Redis 7 where they exist.

The sidebar then lists one entry per database, `db0` upward, counted from the server's own `CONFIG GET databases` (16 if it does not answer). Click one to browse it in place, which is also how the database index changes after connecting.

## Connection URL

```text theme={null}
redis://:password@host:6379/0
rediss://:password@host:6380/0
```

`rediss://` connects with TLS. See [Connection URL Reference](/connections/urls).

## Connection modes

### Standalone

The default. One server, named by Host and Port.

### Sentinel

For a deployment fronted by [Redis Sentinel](https://redis.io/docs/latest/operate/oss_and_stack/management/sentinel/). The quorum says which node is primary and the data connection opens there; a failover is read from the quorum on the next health check and the connection moves itself. A demoted primary keeps answering `role:master` and keeps accepting writes for several seconds, and those writes are lost, so the quorum is the only signal worth trusting.

| Field                  | Notes                                                                               |
| ---------------------- | ----------------------------------------------------------------------------------- |
| **Sentinel Nodes**     | One or more `host:port` entries. Port defaults to `26379`                           |
| **Primary Group Name** | The name after `sentinel monitor` in `sentinel.conf`, usually `mymaster`            |
| **Sentinel Username**  | Under Authentication. Only when Sentinel has its own ACL user                       |
| **Sentinel Password**  | Under Authentication. Only when Sentinel has its own password. Kept in the Keychain |

Host and Port are ignored here. Username and Password under Authentication belong to the primary; Sentinel is a separate plane with its own. The rest of the quorum is discovered at connect and remembered, so a lookup still works once the node you listed goes down. If none can be reached, or none monitors the group you named, the error lists the addresses tried and the groups they do monitor.

### Cluster

For a sharded [Redis Cluster](https://redis.io/docs/latest/operate/oss_and_stack/management/scaling/). The shard map is read with `CLUSTER SHARDS`, or `CLUSTER SLOTS` on Redis 6; a connection opens to every primary and each command goes to the shard that owns its key.

| Field                  | Notes                                                                                                             |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **Cluster Seed Nodes** | One or more `host:port` entries. Any reachable member is enough, the rest are discovered. Port defaults to `6379` |

`DBSIZE` is summed across shards, browsing merges their keys into one tree, and `MGET`, `MSET`, `DEL`, `EXISTS`, `TOUCH` and `UNLINK` are split per shard and recombined. A `MOVED` re-points the slot and retries, an `ASK` retries against the importing node, and one command follows at most five redirects. What Cluster mode cannot do is under [Limitations](#limitations).

The wrong mode is caught at connect: Standalone against a cluster member, or any data mode against a Sentinel port, names the field to change.

## Amazon ElastiCache (IAM)

Set **Authentication** to an AWS IAM mode (Access Key, Profile, or SSO). A short-lived IAM token becomes the Redis password and the username is your IAM-enabled Redis user. Enter the AWS region and the cache name (replication group ID), and turn TLS on, which ElastiCache IAM requires. Profiles resolve from `~/.aws/config` and `~/.aws/credentials`, `credential_process`, SSO, and assumed roles included.

## Browsing keys

`user:1` and `user:2` sit under a `user` folder, nested as deep as the key goes (`app:cache:session:1`). Change the separator in Advanced settings.

<Frame caption="Keys grouped by namespace with type-aware values">
  <img className="block dark:hidden" src="https://mintcdn.com/ngquct-docs-fix-500-query-results/HJY892UtvXUv1PFn/images/redis-key-browser.png?fit=max&auto=format&n=HJY892UtvXUv1PFn&q=85&s=c0723f4a33edf4795e7538b008aeab7c" alt="Redis keys grouped by namespace in the sidebar with values in the data grid" width="1560" height="960" data-path="images/redis-key-browser.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/ngquct-docs-fix-500-query-results/HJY892UtvXUv1PFn/images/redis-key-browser-dark.png?fit=max&auto=format&n=HJY892UtvXUv1PFn&q=85&s=3d48d75e09e7cfa1cb838f9908250266" alt="Redis keys grouped by namespace in the sidebar with values in the data grid" width="1560" height="960" data-path="images/redis-key-browser-dark.png" />
</Frame>

The grid columns are **Key**, **Type**, **TTL**, **Length**, and **Value**. Value is a preview for everything but a string; Length is what Redis reports, so the two together say how much is missing.

| Type       | Value column                        | Length column      |
| ---------- | ----------------------------------- | ------------------ |
| String     | The entire value, however long      | `STRLEN`, in bytes |
| Hash       | First 100 fields, as a JSON object  | `HLEN`             |
| List       | First 100 elements, as a JSON array | `LLEN`             |
| Set        | First 100 members, as a JSON array  | `SCARD`            |
| Sorted set | First 100 `[member, score]` pairs   | `ZCARD`            |
| Stream     | Newest 5 entries, as `[id, fields]` | `XLEN`             |

A value that is not valid UTF-8, such as a gzip or MessagePack payload, opens in the hex editor instead of as text.

### Editing

Editing a **Key** cell runs `RENAME`. Editing a **TTL** cell runs `EXPIRE`, or `PERSIST` when you set it to `-1`; in that column `-1` means no expiry and `-2` means the key is gone. Editing a **Value** cell runs `SET`, and only on a string, since a preview of a hash or list is not the whole structure.

Change the other types with a command: `HSET myhash field1 "value1"` rewrites one field and leaves the rest alone. Adding a row does follow the type you pick, generating `HSET`, `RPUSH`, `SADD`, `ZADD`, or `SET`.

### Filtering

Toggle the filter bar to search keys by pattern. Patterns are Redis glob (`*` any sequence, `?` one character, `[ae]` a character set) and case-sensitive, as in `redis-cli`. The type scope narrows to String, Hash, List, Set, Sorted Set, or Stream. Matching runs server-side with `SCAN MATCH` and `SCAN TYPE`.

## Redis CLI

Each statement is one command; separate several with `;`. Commands the driver does not recognize go through too, and only the result formatting is type-aware. Arguments are quoted the way `redis-cli` quotes them, so `"` and `'` both work and `\xHH` writes a raw byte; unbalanced quotes are rejected rather than guessed at. Redis has no comment syntax and none is stripped, so a `--` or `#` line is sent to the server and fails.

```redis theme={null}
SET mykey "hello" EX 60
HGETALL myhash; LRANGE mylist 0 -1
SCAN 0 MATCH user:* COUNT 100
```

## SSL/TLS

Set this in the **SSL/TLS** pane. Upstash, Redis Cloud and the like require TLS; `rediss://` turns it on when importing a URL.

| Mode                       | hiredis behavior                   | Use for                                     |
| -------------------------- | ---------------------------------- | ------------------------------------------- |
| **Disabled**               | Plain TCP                          | Local dev                                   |
| **Preferred**              | TLS, do not verify peer            | Same as Required here; there is no fallback |
| **Required (skip verify)** | TLS, do not verify peer            | Self-signed certs, Upstash, untrusted CAs   |
| **Verify CA**              | TLS, verify peer with your CA cert | Private PKI; supply the CA path             |
| **Verify Identity**        | Same as Verify CA                  | Redis does no separate hostname check       |

New connections default to **Disabled**. SNI is sent in every TLS mode.

## Limitations

* No transactions in Cluster mode. Grid saves run their statements one at a time. Group keys under one hash tag if they must move together.
* Cluster mode serves database 0 only. The Database Index field is hidden and the sidebar shows a single `db0`.
* A command whose keys span hash slots, such as `RENAME`, `SMOVE`, or the `*STORE` commands, is refused in Cluster mode before it is sent. Give the keys a shared hash tag, like `{user}:1` and `{user}:2`.
* A key that is not valid UTF-8 never appears in the grid or the tree. Reach it from the CLI; values have no such limit.
* Pub/Sub has no grid support. `PUBLISH` runs in the CLI, and there is no subscriber view.
* The sidebar tree loads at most 50,000 keys and a filter scans at most 10,000 matches. Narrow the pattern, or `SCAN` from the CLI.
* Values and TTLs cannot be filtered on. Redis has no server-side primitive for either; filter by key pattern and type only.
* No import. Export works as it does elsewhere.

## Troubleshooting

**Connection refused**: check Redis is running (`brew services start redis`), the port matches `redis.conf`, and the `bind` directive covers the address you are using.

**WRONGPASS invalid username-password pair or user is disabled.**: with Username empty, `AUTH password` is checked against the `default` user, and an ACL user's password fails that. Fill in Username to authenticate as that user.

One ACL trap produces the same error: `>password` sets a password, `#hash` sets a SHA-256 hash, and a 64-character hex string is valid for both, so `ACL SETUSER myuser on #<64-hex>` is accepted where `>` was meant. `ACL LIST` prints passwords as hashes, so a value copied from there is a hash, not a password.

**Timeout**: verify host and port, check the network and firewall, and allow your IP on a cloud-hosted Redis.

**Sentinel or Cluster over SSH**: a tunnel forwards one local port to one remote address, and the addresses Sentinel and Cluster hand back are the server's own. Over a tunnel only the first host in the list is used, as a standalone node, so failover and shard routing are unavailable.

**Slow key list**: `KEYS` blocks the server on a large keyspace. Browse by namespace instead, and use `SCAN` in the CLI when you need a pattern. Check memory pressure with `INFO memory`.
