diff --git a/content/commands/bf.add.md b/content/commands/bf.add.md index 12043ab394..77484a548b 100644 --- a/content/commands/bf.add.md +++ b/content/commands/bf.add.md @@ -51,12 +51,10 @@ is an item to add. ## Examples -{{< highlight bash >}} -redis> BF.ADD bf item1 -(integer) 1 -redis> BF.ADD bf item1 -(integer) 0 -{{< / highlight >}} +{{% redis-cli %}} +BF.ADD bf item1 +BF.ADD bf item1 +{{% /redis-cli %}} ## Redis Software and Redis Cloud compatibility diff --git a/content/commands/bf.card.md b/content/commands/bf.card.md index 7db8d6bbb9..1273cbae82 100644 --- a/content/commands/bf.card.md +++ b/content/commands/bf.card.md @@ -43,14 +43,11 @@ is key name for a Bloom filter. ## Examples -{{< highlight bash >}} -redis> BF.ADD bf1 item_foo -(integer) 1 -redis> BF.CARD bf1 -(integer) 1 -redis> BF.CARD bf_new -(integer) 0 -{{< / highlight >}} +{{% redis-cli %}} +BF.ADD bf1 item_foo +BF.CARD bf1 +BF.CARD bf_new +{{% /redis-cli %}} ## Redis Software and Redis Cloud compatibility diff --git a/content/commands/bf.exists.md b/content/commands/bf.exists.md index b5dec0aa9b..6c1ffa5c02 100644 --- a/content/commands/bf.exists.md +++ b/content/commands/bf.exists.md @@ -50,14 +50,11 @@ is an item to check. ## Examples -{{< highlight bash >}} -redis> BF.ADD bf item1 -(integer) 1 -redis> BF.EXISTS bf item1 -(integer) 1 -redis> BF.EXISTS bf item2 -(integer) 0 -{{< / highlight >}} +{{% redis-cli %}} +BF.ADD bf item1 +BF.EXISTS bf item1 +BF.EXISTS bf item2 +{{% /redis-cli %}} ## Redis Software and Redis Cloud compatibility diff --git a/content/commands/bf.info.md b/content/commands/bf.info.md index 5937c41430..b03f7c51f0 100644 --- a/content/commands/bf.info.md +++ b/content/commands/bf.info.md @@ -86,23 +86,11 @@ Return the expansion rate. ## Examples -{{< highlight bash >}} -redis> BF.ADD bf1 observation1 -(integer) 1 -redis> BF.INFO bf1 - 1) Capacity - 2) (integer) 100 - 3) Size - 4) (integer) 240 - 5) Number of filters - 6) (integer) 1 - 7) Number of items inserted - 8) (integer) 1 - 9) Expansion rate -10) (integer) 2 -redis> BF.INFO bf1 CAPACITY -1) (integer) 100 -{{< / highlight >}} +{{% redis-cli %}} +BF.ADD bf1 observation1 +BF.INFO bf1 +BF.INFO bf1 CAPACITY +{{% /redis-cli %}} ## Redis Software and Redis Cloud compatibility diff --git a/content/commands/bf.insert.md b/content/commands/bf.insert.md index b722a4bc97..49e8eb5f44 100644 --- a/content/commands/bf.insert.md +++ b/content/commands/bf.insert.md @@ -121,21 +121,21 @@ Otherwise, use an `expansion` of `1` to reduce memory consumption. The default v Add three items to a filter, then create the filter with default parameters if it does not already exist. -{{< highlight bash >}} +{{% redis-cli %}} BF.INSERT filter ITEMS foo bar baz -{{< / highlight >}} +{{% /redis-cli %}} Add one item to a filter, then create the filter with a capacity of 10000 if it does not already exist. -{{< highlight bash >}} +{{% redis-cli %}} BF.INSERT filter CAPACITY 10000 ITEMS hello -{{< / highlight >}} +{{% /redis-cli %}} Add two items to a filter, then return error if the filter does not already exist. -{{< highlight bash >}} +{{% redis-cli %}} BF.INSERT filter NOCREATE ITEMS foo bar -{{< / highlight >}} +{{% /redis-cli %}} ## Redis Software and Redis Cloud compatibility diff --git a/content/commands/bf.madd.md b/content/commands/bf.madd.md index 9e340d8c08..28d4dbf289 100644 --- a/content/commands/bf.madd.md +++ b/content/commands/bf.madd.md @@ -57,12 +57,9 @@ One or more items to add. ## Examples -{{< highlight bash >}} -redis> BF.MADD bf item1 item2 item2 -1) (integer) 1 -2) (integer) 1 -3) (integer) 0 -{{< / highlight >}} +{{% redis-cli %}} +BF.MADD bf item1 item2 item2 +{{% /redis-cli %}} ## Redis Software and Redis Cloud compatibility diff --git a/content/commands/bf.mexists.md b/content/commands/bf.mexists.md index 109af8cfa0..1935ec8f1c 100644 --- a/content/commands/bf.mexists.md +++ b/content/commands/bf.mexists.md @@ -52,15 +52,10 @@ One or more items to check. ## Examples -{{< highlight bash >}} -redis> BF.MADD bf item1 item2 -1) (integer) 1 -2) (integer) 1 -redis> BF.MEXISTS bf item1 item2 item3 -1) (integer) 1 -2) (integer) 1 -3) (integer) 0 -{{< / highlight >}} +{{% redis-cli %}} +BF.MADD bf item1 item2 +BF.MEXISTS bf item1 item2 item3 +{{% /redis-cli %}} ## Redis Software and Redis Cloud compatibility diff --git a/content/commands/bf.reserve.md b/content/commands/bf.reserve.md index 3cbbbc9b3b..8ad76923c1 100644 --- a/content/commands/bf.reserve.md +++ b/content/commands/bf.reserve.md @@ -97,25 +97,21 @@ Otherwise, you use an `expansion` of `1` to reduce memory consumption. The defau ## Examples -{{< highlight bash >}} -redis> BF.RESERVE bf 0.01 1000 -OK -{{< / highlight >}} - -{{< highlight bash >}} -redis> BF.RESERVE bf 0.01 1000 -(error) ERR item exists -{{< / highlight >}} - -{{< highlight bash >}} -redis> BF.RESERVE bf_exp 0.01 1000 EXPANSION 2 -OK -{{< / highlight >}} - -{{< highlight bash >}} -redis> BF.RESERVE bf_non 0.01 1000 NONSCALING -OK -{{< / highlight >}} +{{% redis-cli %}} +BF.RESERVE bf 0.01 1000 +{{% /redis-cli %}} + +{{% redis-cli %}} +BF.RESERVE bf 0.01 1000 +{{% /redis-cli %}} + +{{% redis-cli %}} +BF.RESERVE bf_exp 0.01 1000 EXPANSION 2 +{{% /redis-cli %}} + +{{% redis-cli %}} +BF.RESERVE bf_non 0.01 1000 NONSCALING +{{% /redis-cli %}} ## Redis Software and Redis Cloud compatibility diff --git a/content/commands/bf.scandump.md b/content/commands/bf.scandump.md index 08c95996ce..83b46246d0 100644 --- a/content/commands/bf.scandump.md +++ b/content/commands/bf.scandump.md @@ -53,29 +53,17 @@ Iterator value; either 0 or the iterator from a previous invocation of this comm ## Examples -{{< highlight bash >}} -redis> BF.RESERVE bf 0.1 10 -OK -redis> BF.ADD bf item1 -1) (integer) 1 -redis> BF.SCANDUMP bf 0 -1) (integer) 1 -2) "\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x05\x00\x00\x00\x02\x00\x00\x00\b\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x9a\x99\x99\x99\x99\x99\xa9?J\xf7\xd4\x9e\xde\xf0\x18@\x05\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x00" -redis> BF.SCANDUMP bf 1 -1) (integer) 9 -2) "\x01\b\x00\x80\x00\x04 \x00" -redis> BF.SCANDUMP bf 9 -1) (integer) 0 -2) "" -redis> DEL bf -(integer) 1 -redis> BF.LOADCHUNK bf 1 "\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x05\x00\x00\x00\x02\x00\x00\x00\b\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x9a\x99\x99\x99\x99\x99\xa9?J\xf7\xd4\x9e\xde\xf0\x18@\x05\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x00" -OK -redis> BF.LOADCHUNK bf 9 "\x01\b\x00\x80\x00\x04 \x00" -OK -redis> BF.EXISTS bf item1 -(integer) 1 -{{< / highlight >}} +{{% redis-cli %}} +BF.RESERVE bf 0.1 10 +BF.ADD bf item1 +BF.SCANDUMP bf 0 +BF.SCANDUMP bf 1 +BF.SCANDUMP bf 9 +DEL bf +BF.LOADCHUNK bf 1 "\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x05\x00\x00\x00\x02\x00\x00\x00\b\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x9a\x99\x99\x99\x99\x99\xa9?J\xf7\xd4\x9e\xde\xf0\x18@\x05\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x00" +BF.LOADCHUNK bf 9 "\x01\b\x00\x80\x00\x04 \x00" +BF.EXISTS bf item1 +{{% /redis-cli %}} Python code: {{< highlight bash >}} diff --git a/content/commands/cf.add.md b/content/commands/cf.add.md index 593ff97160..1e1219929a 100644 --- a/content/commands/cf.add.md +++ b/content/commands/cf.add.md @@ -59,12 +59,10 @@ The filter attempts to `Cuckoo` swap items up to `maxIterations` times. ## Examples -{{< highlight bash >}} -redis> CF.ADD cf item1 -(integer) 1 -redis> CF.ADD cf item1 -(integer) 1 -{{< / highlight >}} +{{% redis-cli %}} +CF.ADD cf item1 +CF.ADD cf item1 +{{% /redis-cli %}} ## Redis Software and Redis Cloud compatibility diff --git a/content/commands/cf.addnx.md b/content/commands/cf.addnx.md index 404d7dd46c..de972d599d 100644 --- a/content/commands/cf.addnx.md +++ b/content/commands/cf.addnx.md @@ -58,12 +58,10 @@ is an item to add. ## Examples -{{< highlight bash >}} -redis> CF.ADDNX cf item -(integer) 1 -redis> CF.ADDNX cf item -(integer) 0 -{{< / highlight >}} +{{% redis-cli %}} +CF.ADDNX cf item +CF.ADDNX cf item +{{% /redis-cli %}} ## Redis Software and Redis Cloud compatibility diff --git a/content/commands/cf.count.md b/content/commands/cf.count.md index 1fc47528a0..4b2b098778 100644 --- a/content/commands/cf.count.md +++ b/content/commands/cf.count.md @@ -50,16 +50,11 @@ is an item to check. ## Examples -{{< highlight bash >}} -redis> CF.INSERT cf ITEMS item1 item2 item2 -1) (integer) 1 -2) (integer) 1 -3) (integer) 1 -redis> CF.COUNT cf item1 -(integer) 1 -redis> CF.COUNT cf item2 -(integer) 2 -{{< / highlight >}} +{{% redis-cli %}} +CF.INSERT cf ITEMS item1 item2 item2 +CF.COUNT cf item1 +CF.COUNT cf item2 +{{% /redis-cli %}} ## Redis Software and Redis Cloud compatibility diff --git a/content/commands/cf.del.md b/content/commands/cf.del.md index 02e4af0226..ec68b5b8c5 100644 --- a/content/commands/cf.del.md +++ b/content/commands/cf.del.md @@ -58,22 +58,14 @@ checked on all `sub-filters`. ## Examples -{{< highlight bash >}} -redis> CF.INSERT cf ITEMS item1 item2 item2 -1) (integer) 1 -2) (integer) 1 -3) (integer) 1 -redis> CF.DEL cf item1 -(integer) 1 -redis> CF.DEL cf item1 -(integer) 0 -redis> CF.DEL cf item2 -(integer) 1 -redis> CF.DEL cf item2 -(integer) 1 -redis> CF.DEL cf item2 -(integer) 0 -{{< / highlight >}} +{{% redis-cli %}} +CF.INSERT cf ITEMS item1 item2 item2 +CF.DEL cf item1 +CF.DEL cf item1 +CF.DEL cf item2 +CF.DEL cf item2 +CF.DEL cf item2 +{{% /redis-cli %}} ## Redis Software and Redis Cloud compatibility diff --git a/content/commands/cf.exists.md b/content/commands/cf.exists.md index 94aebff95f..4a2b207217 100644 --- a/content/commands/cf.exists.md +++ b/content/commands/cf.exists.md @@ -50,14 +50,11 @@ is an item to check. ## Examples -{{< highlight bash >}} -redis> CF.ADD cf item1 -(integer) 1 -redis> CF.EXISTS cf item1 -(integer) 1 -redis> CF.EXISTS cf item2 -(integer) 0 -{{< / highlight >}} +{{% redis-cli %}} +CF.ADD cf item1 +CF.EXISTS cf item1 +CF.EXISTS cf item2 +{{% /redis-cli %}} ## Redis Software and Redis Cloud compatibility diff --git a/content/commands/cf.info.md b/content/commands/cf.info.md index 37322c2c94..70f00a1a7a 100644 --- a/content/commands/cf.info.md +++ b/content/commands/cf.info.md @@ -40,25 +40,9 @@ is key name for a cuckoo filter. ## Examples -{{< highlight bash >}} -redis> CF.INFO cf - 1) Size - 2) (integer) 1080 - 3) Number of buckets - 4) (integer) 512 - 5) Number of filter - 6) (integer) 1 - 7) Number of items inserted - 8) (integer) 0 - 9) Number of items deleted -10) (integer) 0 -11) Bucket size -12) (integer) 2 -13) Expansion rate -14) (integer) 1 -15) Max iteration -16) (integer) 20 -{{< / highlight >}} +{{% redis-cli %}} +CF.INFO cf +{{% /redis-cli %}} ## Redis Software and Redis Cloud compatibility diff --git a/content/commands/cf.insert.md b/content/commands/cf.insert.md index 24e224fea5..2960924dfb 100644 --- a/content/commands/cf.insert.md +++ b/content/commands/cf.insert.md @@ -86,26 +86,18 @@ This option is mutually exclusive with `CAPACITY`. ## Examples -{{< highlight bash >}} -redis> CF.INSERT cf CAPACITY 1000 ITEMS item1 item2 -1) (integer) 1 -2) (integer) 1 -{{< / highlight >}} - -{{< highlight bash >}} -redis> CF.INSERT cf1 CAPACITY 1000 NOCREATE ITEMS item1 item2 -(error) ERR not found -{{< / highlight >}} - -{{< highlight bash >}} -redis> CF.RESERVE cf2 2 BUCKETSIZE 1 EXPANSION 0 -OK -redis> CF.INSERT cf2 ITEMS 1 1 1 1 -1) (integer) 1 -2) (integer) 1 -3) (integer) -1 -4) (integer) -1 -{{< / highlight >}} +{{% redis-cli %}} +CF.INSERT cf CAPACITY 1000 ITEMS item1 item2 +{{% /redis-cli %}} + +{{% redis-cli %}} +CF.INSERT cf1 CAPACITY 1000 NOCREATE ITEMS item1 item2 +{{% /redis-cli %}} + +{{% redis-cli %}} +CF.RESERVE cf2 2 BUCKETSIZE 1 EXPANSION 0 +CF.INSERT cf2 ITEMS 1 1 1 1 +{{% /redis-cli %}} ## Redis Software and Redis Cloud compatibility diff --git a/content/commands/cf.insertnx.md b/content/commands/cf.insertnx.md index b749b56ab1..b4e0e9b7e9 100644 --- a/content/commands/cf.insertnx.md +++ b/content/commands/cf.insertnx.md @@ -93,23 +93,17 @@ This option is mutually exclusive with `CAPACITY`. ## Examples -{{< highlight bash >}} -redis> CF.INSERTNX cf CAPACITY 1000 ITEMS item1 item2 -1) (integer) 1 -2) (integer) 1 -{{< / highlight >}} - -{{< highlight bash >}} -redis> CF.INSERTNX cf CAPACITY 1000 ITEMS item1 item2 item3 -1) (integer) 0 -2) (integer) 0 -3) (integer) 1 -{{< / highlight >}} - -{{< highlight bash >}} -redis> CF.INSERTNX cf_new CAPACITY 1000 NOCREATE ITEMS item1 item2 -(error) ERR not found -{{< / highlight >}} +{{% redis-cli %}} +CF.INSERTNX cf CAPACITY 1000 ITEMS item1 item2 +{{% /redis-cli %}} + +{{% redis-cli %}} +CF.INSERTNX cf CAPACITY 1000 ITEMS item1 item2 item3 +{{% /redis-cli %}} + +{{% redis-cli %}} +CF.INSERTNX cf_new CAPACITY 1000 NOCREATE ITEMS item1 item2 +{{% /redis-cli %}} ## Details diff --git a/content/commands/cf.mexists.md b/content/commands/cf.mexists.md index 3fe567ded8..44d607d80b 100644 --- a/content/commands/cf.mexists.md +++ b/content/commands/cf.mexists.md @@ -52,15 +52,10 @@ One or more items to check. ## Examples -{{< highlight bash >}} -redis> CF.INSERT cf ITEMS item1 item2 -1) (integer) 1 -2) (integer) 1 -redis> CF.MEXISTS cf item1 item2 item3 -1) (integer) 1 -2) (integer) 1 -3) (integer) 0 -{{< / highlight >}} +{{% redis-cli %}} +CF.INSERT cf ITEMS item1 item2 +CF.MEXISTS cf item1 item2 item3 +{{% /redis-cli %}} ## Redis Software and Redis Cloud compatibility diff --git a/content/commands/cf.reserve.md b/content/commands/cf.reserve.md index 544d67d06e..a4823a06f1 100644 --- a/content/commands/cf.reserve.md +++ b/content/commands/cf.reserve.md @@ -108,16 +108,11 @@ Expansion is rounded to the next `2^n` number. ## Examples -{{< highlight bash >}} -redis> CF.RESERVE cf 1000 -OK - -redis> CF.RESERVE cf 1000 -(error) ERR item exists - -redis> CF.RESERVE cf_params 1000 BUCKETSIZE 8 MAXITERATIONS 20 EXPANSION 2 -OK -{{< / highlight >}} +{{% redis-cli %}} +CF.RESERVE cf 1000 +CF.RESERVE cf 1000 +CF.RESERVE cf_params 1000 BUCKETSIZE 8 MAXITERATIONS 20 EXPANSION 2 +{{% /redis-cli %}} ## Redis Software and Redis Cloud compatibility diff --git a/content/commands/cf.scandump.md b/content/commands/cf.scandump.md index 5d1ae3bfa1..b2ec1e128a 100644 --- a/content/commands/cf.scandump.md +++ b/content/commands/cf.scandump.md @@ -53,29 +53,17 @@ Iterator value; either 0 or the iterator from a previous invocation of this comm ## Examples -{{< highlight bash >}} -redis> CF.RESERVE cf 8 -OK -redis> CF.ADD cf item1 -(integer) 1 -redis> CF.SCANDUMP cf 0 -1) (integer) 1 -2) "\x01\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14\x00\x01\x008\x9a\xe0\xd8\xc3\x7f\x00\x00" -redis> CF.SCANDUMP cf 1 -1) (integer) 9 -2) "\x00\x00\x00\x00\a\x00\x00\x00" -redis> CF.SCANDUMP cf 9 -1) (integer) 0 -2) (nil) -redis> DEL bf -(integer) 1 -redis> CF.LOADCHUNK cf 1 "\x01\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14\x00\x01\x008\x9a\xe0\xd8\xc3\x7f\x00\x00" -OK -redis> CF.LOADCHUNK cf 9 "\x00\x00\x00\x00\a\x00\x00\x00" -OK -redis> CF.EXISTS cf item1 -(integer) 1 -{{< / highlight >}} +{{% redis-cli %}} +CF.RESERVE cf 8 +CF.ADD cf item1 +CF.SCANDUMP cf 0 +CF.SCANDUMP cf 1 +CF.SCANDUMP cf 9 +DEL bf +CF.LOADCHUNK cf 1 "\x01\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14\x00\x01\x008\x9a\xe0\xd8\xc3\x7f\x00\x00" +CF.LOADCHUNK cf 9 "\x00\x00\x00\x00\a\x00\x00\x00" +CF.EXISTS cf item1 +{{% /redis-cli %}} Python code: {{< highlight bash >}} diff --git a/content/commands/digest.md b/content/commands/digest.md index b05b1d8fa2..5fbb61f7ed 100644 --- a/content/commands/digest.md +++ b/content/commands/digest.md @@ -58,12 +58,10 @@ The name of the key. ## Examples -```bash -> SET key1 "Hello world" -OK -> DIGEST key1 -"b6acb9d84a38ff74" -``` +{{% redis-cli %}} +SET key1 "Hello world" +DIGEST key1 +{{% /redis-cli %}} ## Details diff --git a/content/commands/hexpiretime.md b/content/commands/hexpiretime.md index 6167da85a9..ccf5afb0f1 100644 --- a/content/commands/hexpiretime.md +++ b/content/commands/hexpiretime.md @@ -77,16 +77,11 @@ The hash fields to retrieve the expiration time for. `numfields` is the number o ## Examples -``` -redis> HSET mykey field1 "hello" field2 "world" -(integer) 2 -redis> HEXPIRE mykey 300 FIELDS 2 field1 field2 -1) (integer) 1 -2) (integer) 1 -redis> HEXPIRETIME mykey FIELDS 2 field1 field2 -1) (integer) 1715705914 -2) (integer) 1715705914 -``` +{{% redis-cli %}} +HSET mykey field1 "hello" field2 "world" +HEXPIRE mykey 300 FIELDS 2 field1 field2 +HEXPIRETIME mykey FIELDS 2 field1 field2 +{{% /redis-cli %}} ## Redis Software and Redis Cloud compatibility