Skip to content

Commit 9cb41aa

Browse files
authored
DOC-4423: add TCEs for various command pages (#1037)
1 parent d3e7f9f commit 9cb41aa

File tree

13 files changed

+155
-7
lines changed

13 files changed

+155
-7
lines changed

content/commands/auth/index.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ The AUTH command authenticates the current connection in two cases:
5151
Redis versions prior of Redis 6 were only able to understand the one argument
5252
version of the command:
5353

54-
AUTH <password>
54+
{{< clients-example cmds_cnxmgmt auth1 >}}
55+
AUTH "temp-pass"
56+
{{< /clients-example >}}
5557

5658
This form just authenticates against the password set with `requirepass`.
5759
In this configuration Redis will deny any command executed by the just
@@ -62,7 +64,9 @@ Otherwise, an error is returned and the clients needs to try a new password.
6264

6365
When Redis ACLs are used, the command should be given in an extended way:
6466

65-
AUTH <username> <password>
67+
{{< clients-example cmds_cnxmgmt auth2 >}}
68+
AUTH "test-user" "strong_password"
69+
{{< /clients-example >}}
6670

6771
In order to authenticate the current connection with one of the connections
6872
defined in the ACL list (see [`ACL SETUSER`]({{< relref "/commands/acl-setuser" >}})) and the official [ACL guide]({{< relref "/operate/oss_and_stack/management/security/acl" >}}) for more information.

content/commands/flushall/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ It is possible to use one of the following modifiers to dictate the flushing mod
6262
* `ASYNC`: flushes the databases asynchronously
6363
* `SYNC`: flushes the databases synchronously
6464

65+
{{< clients-example cmds_servermgmt flushall >}}
66+
FLUSHALL SYNC
67+
{{< /clients-example >}}
68+
6569
## Notes
6670

6771
* An asynchronous `FLUSHALL` command only deletes keys that were present at the time the command was invoked. Keys created during an asynchronous flush will be unaffected.

content/commands/hgetall/index.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,20 @@ of the reply is twice the size of the hash.
5353

5454
## Examples
5555

56+
{{< clients-example cmds_hash hgetall >}}
57+
redis> HSET myhash field1 "Hello"
58+
(integer) 1
59+
redis> HSET myhash field2 "World"
60+
(integer) 1
61+
redis> HGETALL myhash
62+
1) "field1"
63+
2) "Hello"
64+
3) "field2"
65+
4) "World"
66+
{{< /clients-example >}}
67+
68+
Give these commands a try in the interactive console:
69+
5670
{{% redis-cli %}}
5771
HSET myhash field1 "Hello"
5872
HSET myhash field2 "World"

content/commands/hvals/index.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ Returns all values in the hash stored at `key`.
5151

5252
## Examples
5353

54+
{{< clients-example cmds_hash hvals >}}
55+
redis> HSET myhash field1 "Hello"
56+
(integer) 1
57+
redis> HSET myhash field2 "World"
58+
(integer) 1
59+
redis> HVALS myhash
60+
1) "Hello"
61+
2) "World"
62+
{{< /clients-example >}}
63+
64+
Give these commands a try in the interactive console:
65+
5466
{{% redis-cli %}}
5567
HSET myhash field1 "Hello"
5668
HSET myhash field2 "World"

content/commands/info/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ It can also take the following values:
6868

6969
When no parameter is provided, the `default` option is assumed.
7070

71+
{{< clients-example cmds_servermgmt info >}}
72+
INFO
73+
{{< /clients-example >}}
74+
75+
Give these commands a try in the interactive console:
76+
7177
{{% redis-cli %}}
7278
INFO
7379
{{% /redis-cli %}}

content/commands/llen/index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ An error is returned when the value stored at `key` is not a list.
5151

5252
## Examples
5353

54+
{{< clients-example cmds_list llen >}}
55+
redis> LPUSH mylist "World"
56+
(integer) 1
57+
redis> LPUSH mylist "Hello"
58+
(integer) 2
59+
redis> LLEN mylist
60+
(integer) 2
61+
{{< /clients-example >}}
62+
63+
Give these commands a try in the interactive console:
64+
5465
{{% redis-cli %}}
5566
LPUSH mylist "World"
5667
LPUSH mylist "Hello"

content/commands/lpop/index.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,21 @@ to `count` elements, depending on the list's length.
6565

6666
## Examples
6767

68+
{{< clients-example cmds_list lpop >}}
69+
redis> RPUSH mylist "one" "two" "three" "four" "five"
70+
(integer) 5
71+
redis> LPOP mylist
72+
"one"
73+
redis> LPOP mylist 2
74+
1) "two"
75+
2) "three"
76+
redis> LRANGE mylist 0 -1
77+
1) "four"
78+
2) "five"
79+
{{< /clients-example>}}
80+
81+
Give these commands a try in the interactive console:
82+
6883
{{% redis-cli %}}
6984
RPUSH mylist "one" "two" "three" "four" "five"
7085
LPOP mylist

content/commands/lpush/index.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,20 @@ So for instance the command `LPUSH mylist a b c` will result into a list
6969
containing `c` as first element, `b` as second element and `a` as third element.
7070

7171
## Examples
72+
{{< clients-example cmds_list lpush >}}
73+
redis> LPUSH mylist "world"
74+
(integer) 1
75+
redis> LPUSH mylist "hello"
76+
(integer) 2
77+
redis> LRANGE mylist 0 -1
78+
1) "hello"
79+
2) "world"
80+
{{< /clients-example >}}
81+
82+
Give these commands a try in the interactive console:
7283

7384
{{% redis-cli %}}
7485
LPUSH mylist "world"
7586
LPUSH mylist "hello"
7687
LRANGE mylist 0 -1
7788
{{% /redis-cli %}}
78-

content/commands/lrange/index.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,29 @@ the last element of the list.
8080

8181
## Examples
8282

83+
{{< clients-example cmds_list lrange >}}
84+
redis> RPUSH mylist "one"
85+
(integer) 1
86+
redis> RPUSH mylist "two"
87+
(integer) 2
88+
redis> RPUSH mylist "three"
89+
(integer) 3
90+
redis> LRANGE mylist 0 0
91+
1) "one"
92+
redis> LRANGE mylist -3 2
93+
1) "one"
94+
2) "two"
95+
3) "three"
96+
redis> LRANGE mylist -100 100
97+
1) "one"
98+
2) "two"
99+
3) "three"
100+
redis> LRANGE mylist 5 10
101+
(empty array)
102+
{{< /clients-example >}}
103+
104+
Give these commands a try in the interactive console:
105+
83106
{{% redis-cli %}}
84107
RPUSH mylist "one"
85108
RPUSH mylist "two"
@@ -89,4 +112,3 @@ LRANGE mylist -3 2
89112
LRANGE mylist -100 100
90113
LRANGE mylist 5 10
91114
{{% /redis-cli %}}
92-

content/commands/rpop/index.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,24 @@ to `count` elements, depending on the list's length.
6565

6666
## Examples
6767

68+
{{< clients-example cmds_list rpop >}}
69+
redis> RPUSH mylist "one" "two" "three" "four" "five"
70+
(integer) 5
71+
redis> RPOP mylist
72+
"five"
73+
redis> RPOP mylist 2
74+
1) "four"
75+
2) "three"
76+
redis> LRANGE mylist 0 -1
77+
1) "one"
78+
2) "two"
79+
{{< /clients-example >}}
80+
81+
Give these commands a try in the interactive console:
82+
6883
{{% redis-cli %}}
6984
RPUSH mylist "one" "two" "three" "four" "five"
7085
RPOP mylist
7186
RPOP mylist 2
7287
LRANGE mylist 0 -1
7388
{{% /redis-cli %}}
74-

0 commit comments

Comments
 (0)