Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions content/commands/del.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,6 @@ A key is ignored if it does not exist.
(integer) 2
{{< /clients-example >}}

Give these commands a try in the interactive console:

{{% redis-cli %}}
SET key1 "Hello"
SET key2 "World"
DEL key1 key2 key3
{{% /redis-cli %}}

## Redis Software and Redis Cloud compatibility

| Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
Expand Down
20 changes: 5 additions & 15 deletions content/commands/exists.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,13 @@ The user should be aware that if the same existing key is mentioned in the argum
## Examples

{{< clients-example set="cmds_generic" step="exists" description="Foundational: Check if one or more keys exist using EXISTS (returns count of existing keys, useful for conditional logic)" difficulty="beginner" >}}
SET key1 "Hello"
EXISTS key1
EXISTS nosuchkey
SET key2 "World"
EXISTS key1 key2 nosuchkey
> SET key1 "Hello"
> EXISTS key1
> EXISTS nosuchkey
> SET key2 "World"
> EXISTS key1 key2 nosuchkey
{{< /clients-example >}}

Give these commands a try in the interactive console:

{{% redis-cli %}}
SET key1 "Hello"
EXISTS key1
EXISTS nosuchkey
SET key2 "World"
EXISTS key1 key2 nosuchkey
{{% /redis-cli %}}

## Redis Software and Redis Cloud compatibility

| Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
Expand Down
14 changes: 0 additions & 14 deletions content/commands/expire.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,20 +158,6 @@ are now fixed.
(integer) 10
{{< /clients-example >}}

Give these commands a try in the interactive console:

{{% redis-cli %}}
SET mykey "Hello"
EXPIRE mykey 10
TTL mykey
SET mykey "Hello World"
TTL mykey
EXPIRE mykey 10 XX
TTL mykey
EXPIRE mykey 10 NX
TTL mykey
{{% /redis-cli %}}

## Pattern: Navigation session

Imagine you have a web service and you are interested in the latest N pages
Expand Down
17 changes: 8 additions & 9 deletions content/commands/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,14 @@ only handles string values.

## Examples

{{% redis-cli %}}
GET nonexisting
SET mykey "Hello"
GET mykey
{{% /redis-cli %}}

### Code examples

{{< clients-example set="set_and_get" step="get" description="Foundational: Retrieve the string value of a key using GET (returns nil if key doesn't exist)" difficulty="beginner" />}}
{{< clients-example set="set_and_get" step="get" description="Foundational: Retrieve the string value of a key using GET (returns nil if key doesn't exist)" difficulty="beginner" >}}
> GET nonexisting
(nil)
> SET mykey "Hello"
"OK"
> GET mykey
"Hello"
{{< /clients-example >}}

## Redis Software and Redis Cloud compatibility

Expand Down
14 changes: 3 additions & 11 deletions content/commands/hdel.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,14 @@ If `key` does not exist, it is treated as an empty hash and this command returns
## Examples

{{< clients-example set="cmds_hash" step="hdel" description="Foundational: Delete one or more fields from a hash using HDEL (returns count of deleted fields, ignores non-existent fields)" difficulty="beginner" >}}
HSET myhash field1 "foo"
> HSET myhash field1 "foo"
(integer) 1
HDEL myhash field1
> HDEL myhash field1
(integer) 1
HDEL myhash field2
> HDEL myhash field2
(integer) 0
{{< /clients-example >}}

Give these commands a try in the interactive console:

{{% redis-cli %}}
HSET myhash field1 "foo"
HDEL myhash field1
HDEL myhash field2
{{% /redis-cli %}}

## Redis Software and Redis Cloud compatibility

| Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
Expand Down
17 changes: 4 additions & 13 deletions content/commands/hexpire.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,26 +120,17 @@ Starting with Redis 8, Redis Search has enhanced behavior when handling expiring
## Examples

{{< clients-example set="cmds_hash" step="hexpire" description="Field expiration: Set TTL on individual hash fields using HEXPIRE with conditional options (NX, XX, GT, LT) when you need fine-grained control over field lifecycle" difficulty="intermediate" >}}
HEXPIRE no-key 20 NX FIELDS 2 field1 field2
> HEXPIRE no-key 20 NX FIELDS 2 field1 field2
(nil)
HSET mykey field1 "hello" field2 "world"
> HSET mykey field1 "hello" field2 "world"
(integer) 2
HEXPIRE mykey 10 FIELDS 3 field1 field2 field3
> HEXPIRE mykey 10 FIELDS 3 field1 field2 field3
1) (integer) 1
2) (integer) 1
3) (integer) -2
HGETALL mykey
> HGETALL mykey
{{< /clients-example >}}

Give these commands a try in the interactive console:

{{% redis-cli %}}
HEXPIRE no-key 20 NX FIELDS 2 field1 field2
HSET mykey field1 "hello" field2 "world"
HEXPIRE mykey 10 FIELDS 3 field1 field2 field3
HGETALL mykey
{{% /redis-cli %}}

## Redis Software and Redis Cloud compatibility

| Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
Expand Down
8 changes: 0 additions & 8 deletions content/commands/hget.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,6 @@ Returns the value associated with `field` in the hash stored at `key`.
(nil)
{{< /clients-example >}}

Give these commands a try in the interactive console:

{{% redis-cli %}}
HSET myhash field1 "foo"
HGET myhash field1
HGET myhash field2
{{% /redis-cli %}}

## Redis Software and Redis Cloud compatibility

| Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
Expand Down
8 changes: 0 additions & 8 deletions content/commands/hgetall.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@ redis> HGETALL myhash
4) "World"
{{< /clients-example >}}

Give these commands a try in the interactive console:

{{% redis-cli %}}
HSET myhash field1 "Hello"
HSET myhash field2 "World"
HGETALL myhash
{{% /redis-cli %}}

## Redis Software and Redis Cloud compatibility

| Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
Expand Down
8 changes: 0 additions & 8 deletions content/commands/hmget.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,6 @@ a non-existing `key` will return a list of `nil` values.
>
{{< /clients-example >}}

Give these commands a try in the interactive console:

{{% redis-cli %}}
HSET myhash field1 "Hello"
HSET myhash field2 "World"
HMGET myhash field1 field2 nofield
{{% /redis-cli %}}

## Redis Software and Redis Cloud compatibility

| Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
Expand Down
11 changes: 0 additions & 11 deletions content/commands/hset.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,6 @@ If `key` doesn't exist, a new key holding a hash is created.
6) "World"
{{< /clients-example >}}

Give these commands a try in the interactive console:

{{% redis-cli %}}
HSET myhash field1 "Hello"
HGET myhash field1
HSET myhash field2 "Hi" field3 "World"
HGET myhash field2
HGET myhash field3
HGETALL myhash
{{% /redis-cli %}}

## Redis Software and Redis Cloud compatibility

| Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
Expand Down
8 changes: 0 additions & 8 deletions content/commands/hvals.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,6 @@ redis> HVALS myhash
2) "World"
{{< /clients-example >}}

Give these commands a try in the interactive console:

{{% redis-cli %}}
HSET myhash field1 "Hello"
HSET myhash field2 "World"
HVALS myhash
{{% /redis-cli %}}

## Redis Software and Redis Cloud compatibility

| Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
Expand Down
8 changes: 0 additions & 8 deletions content/commands/incr.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,6 @@ representation of the integer.
"11"
{{< /clients-example >}}

Give this command a try in the interactive console:

{{% redis-cli %}}
SET mykey "10"
INCR mykey
GET mykey
{{% /redis-cli %}}

## Pattern: Counter

The counter pattern is the most obvious thing you can do with Redis atomic
Expand Down
8 changes: 1 addition & 7 deletions content/commands/info.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,9 @@ It can also take the following values:
When no parameter is provided, the `default` option is assumed.

{{< clients-example set="cmds_servermgmt" step="info" description="Foundational: Get server information and statistics using INFO (supports optional section filtering, returns key-value pairs)" difficulty="beginner" >}}
INFO
> INFO
{{< /clients-example >}}

Give these commands a try in the interactive console:

{{% redis-cli %}}
INFO
{{% /redis-cli %}}

## Notes

Please note depending on the version of Redis some of the fields have been
Expand Down
8 changes: 0 additions & 8 deletions content/commands/keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,6 @@ To use pattern with hash tag, see [Hash tags]({{< relref "operate/oss_and_stack/
3) "firstname"
{{< /clients-example >}}

Give these commands a try in the interactive console:
{{% redis-cli %}}
MSET firstname Jack lastname Stuntman age 35
KEYS *name*
KEYS a??
KEYS *
{{% /redis-cli %}}

## Redis Software and Redis Cloud compatibility

| Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
Expand Down
8 changes: 0 additions & 8 deletions content/commands/llen.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,6 @@ redis> LLEN mylist
(integer) 2
{{< /clients-example >}}

Give these commands a try in the interactive console:

{{% redis-cli %}}
LPUSH mylist "World"
LPUSH mylist "Hello"
LLEN mylist
{{% /redis-cli %}}

## Redis Software and Redis Cloud compatibility

| Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
Expand Down
9 changes: 0 additions & 9 deletions content/commands/lpop.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,6 @@ redis> LRANGE mylist 0 -1
2) "five"
{{< /clients-example>}}

Give these commands a try in the interactive console:

{{% redis-cli %}}
RPUSH mylist "one" "two" "three" "four" "five"
LPOP mylist
LPOP mylist 2
LRANGE mylist 0 -1
{{% /redis-cli %}}

## Redis Software and Redis Cloud compatibility

| Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
Expand Down
8 changes: 0 additions & 8 deletions content/commands/lpush.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,6 @@ redis> LRANGE mylist 0 -1
2) "world"
{{< /clients-example >}}

Give these commands a try in the interactive console:

{{% redis-cli %}}
LPUSH mylist "world"
LPUSH mylist "hello"
LRANGE mylist 0 -1
{{% /redis-cli %}}

## Redis Software and Redis Cloud compatibility

| Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
Expand Down
12 changes: 0 additions & 12 deletions content/commands/lrange.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,6 @@ redis> LRANGE mylist 5 10
(empty array)
{{< /clients-example >}}

Give these commands a try in the interactive console:

{{% redis-cli %}}
RPUSH mylist "one"
RPUSH mylist "two"
RPUSH mylist "three"
LRANGE mylist 0 0
LRANGE mylist -3 2
LRANGE mylist -100 100
LRANGE mylist 5 10
{{% /redis-cli %}}

## Redis Software and Redis Cloud compatibility

| Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
Expand Down
8 changes: 0 additions & 8 deletions content/commands/mget.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,6 @@ Because of this, the operation never fails.
3) (nil)
{{< /clients-example >}}

Give these commands a try in the interactive console:

{{% redis-cli %}}
SET key1 "Hello"
SET key2 "World"
MGET key1 key2 nonexisting
{{% /redis-cli %}}

## Redis Software and Redis Cloud compatibility

| Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
Expand Down
9 changes: 0 additions & 9 deletions content/commands/rpop.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,6 @@ redis> LRANGE mylist 0 -1
2) "two"
{{< /clients-example >}}

Give these commands a try in the interactive console:

{{% redis-cli %}}
RPUSH mylist "one" "two" "three" "four" "five"
RPOP mylist
RPOP mylist 2
LRANGE mylist 0 -1
{{% /redis-cli %}}

## Redis Software and Redis Cloud compatibility

| Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
Expand Down
8 changes: 0 additions & 8 deletions content/commands/rpush.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,6 @@ redis> LRANGE mylist 0 -1
2) "world"
{{< /clients-example >}}

Give these commands a try in the interactive console:

{{% redis-cli %}}
RPUSH mylist "hello"
RPUSH mylist "world"
LRANGE mylist 0 -1
{{% /redis-cli %}}

## Redis Software and Redis Cloud compatibility

| Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
Expand Down
8 changes: 0 additions & 8 deletions content/commands/sadd.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,6 @@ redis> SMEMBERS myset
2) "World"
{{< /clients-example >}}

Give these commands a try in the interactive console:

{{% redis-cli %}}
SADD myset "Hello" "World"
SADD myset "World"
SMEMBERS myset
{{% /redis-cli %}}

## Redis Software and Redis Cloud compatibility

| Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
Expand Down
Loading
Loading