Skip to content

Commit 7ca77c1

Browse files
committed
tweak docs slightly to reflect redis field string type, not literal string
1 parent 2bd6cb3 commit 7ca77c1

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

internal/impl/redis/input_scan.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,20 @@ const (
4444
func redisScanInputConfig() *service.ConfigSpec {
4545
spec := service.NewConfigSpec().
4646
Stable().
47-
Summary(`Scans the set of keys in the current selected database and gets their values, using the Scan and Get commands.`).
47+
Summary(`Scans the set of keys in the current selected database and emits Redis string or hash values.`).
4848
Description(`Optionally, iterates only elements matching a blob-style pattern. For example:
4949
- ` + "`*foo*`" + ` iterates only keys which contain ` + "`foo`" + ` in it.
5050
- ` + "`foo*`" + ` iterates only keys starting with ` + "`foo`" + `.
5151
52-
This input generates a message for each key value pair in the following format:
52+
By default this input treats matched keys as Redis string data type keys, reads them with GET, and generates a message
53+
for each key value pair in the following format:
5354
5455
` + "```json" + `
5556
{"key":"foo","value":"bar"}
5657
` + "```" + `
5758
58-
When ` + "`data_type`" + ` is set to ` + "`hash`" + ` this input treats matched keys as Redis hashes. It uses HSCAN to
59-
iterate over each field and its value.
59+
When ` + "`data_type`" + ` is set to ` + "`hash`" + ` this input treats matched keys as Redis hash data type keys. It uses HSCAN
60+
to iterate over each field and its value.
6061
6162
By default, ` + "`value_format`" + ` is ` + "`structured`" + ` in order to preserve the original ` + "`redis_scan`" + ` message shape
6263
of ` + "`{\"key\":\"...\",\"value\":\"...\"}`" + `. Set it to ` + "`raw`" + ` to emit Redis values as raw message payloads.
@@ -79,7 +80,7 @@ Raw messages set Redis identity fields as metadata, using ` + "`redis_key`" + `
7980
Example("*4*").
8081
Default("")).
8182
Field(service.NewStringEnumField(dataTypeFieldName, redisScanDataTypeString, redisScanDataTypeHash).
82-
Description("The Redis data type to read for each matched key. When set to `hash`, matched keys are scanned with HSCAN and each hash field value is emitted as an individual message.").
83+
Description("The Redis data type to read for each matched key. `string` reads matched keys with GET. `hash` scans matched keys with HSCAN and emits each hash field value as an individual message.").
8384
Default(redisScanDataTypeString)).
8485
Field(service.NewStringEnumField(valueFormatFieldName, redisScanValueFormatStructured, redisScanValueFormatRaw).
8586
Description("The Bento message shape to emit for Redis values. The `structured` format preserves the original redis_scan key/value object shape, while `raw` emits Redis values as message payloads and stores Redis identity in metadata.").

website/docs/components/inputs/redis_scan.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ categories: ["Services"]
1515
import Tabs from '@theme/Tabs';
1616
import TabItem from '@theme/TabItem';
1717

18-
Scans the set of keys in the current selected database and gets their values, using the Scan and Get commands.
18+
Scans the set of keys in the current selected database and emits Redis string or hash values.
1919

2020

2121
<Tabs defaultValue="common" values={[
@@ -70,14 +70,15 @@ Optionally, iterates only elements matching a blob-style pattern. For example:
7070
- `*foo*` iterates only keys which contain `foo` in it.
7171
- `foo*` iterates only keys starting with `foo`.
7272

73-
This input generates a message for each key value pair in the following format:
73+
By default this input treats matched keys as Redis string data type keys, reads them with GET, and generates a message
74+
for each key value pair in the following format:
7475

7576
```json
7677
{"key":"foo","value":"bar"}
7778
```
7879

79-
When `data_type` is set to `hash` this input treats matched keys as Redis hashes. It uses HSCAN to discover fields,
80-
and fetches each field value with HGET.
80+
When `data_type` is set to `hash` this input treats matched keys as Redis hash data type keys. It uses HSCAN
81+
to iterate over each field and its value.
8182

8283
By default, `value_format` is `structured` in order to preserve the original `redis_scan` message shape
8384
of `{"key":"...","value":"..."}`. Set it to `raw` to emit Redis values as raw message payloads.
@@ -309,7 +310,7 @@ match: '*4*'
309310

310311
### `data_type`
311312

312-
The Redis data type to read for each matched key. When set to `hash`, matched keys are scanned with HSCAN and each hash field value is emitted as an individual message.
313+
The Redis data type to read for each matched key. `string` reads matched keys with GET. `hash` scans matched keys with HSCAN and emits each hash field value as an individual message.
313314

314315

315316
Type: `string`

0 commit comments

Comments
 (0)