You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add expandjson operation to parse JSON strings in record fields
New transform operation that expands string fields containing JSON into
parsed JSON values. Supports --key for specific fields, auto-detection
of all JSON-like strings, and --recursive for nested JSON expansion.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Copy file name to clipboardExpand all lines: docs/reference/collate.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,19 +19,22 @@ Take records, grouped together by --keys, and compute statistics (like average,
19
19
|`--key` / `-k``<keys>`| Comma-separated list of key fields for grouping. May be a key spec or key group. |
20
20
|`--aggregator` / `-a``<aggregators>`| Colon-separated aggregator specification in the form [<fieldname>=]<aggregator>[,<arguments>]. |
21
21
|`--dlaggregator` / `-A``<name>=<expression>`| Domain language aggregator in the form name=expression. The expression is evaluated as JavaScript to produce an aggregator. |
22
-
|`--mr-agg``<string>`| MapReduce aggregator: specify 4 times for name, map snippet, reduce snippet, and squish snippet. |
23
-
|`--ii-agg``<string>`| InjectInto aggregator: specify 4 times for name, initial snippet, combine snippet, and squish snippet. |
24
-
|`--dlkey``<name>=<expression>`| Domain language key: name=expression where the expression evaluates as a valuation. |
Expand JSON strings embedded in record fields into actual JSON values.
4
+
5
+
## Synopsis
6
+
7
+
```bash
8
+
recs expandjson [options] [files...]
9
+
```
10
+
11
+
## Description
12
+
13
+
Expand JSON strings embedded in record fields into actual JSON values. When a field contains a string that is valid JSON (object, array, etc.), this operation parses it and replaces the string with the parsed structure. With no --key options, all top-level string fields that look like JSON are expanded.
14
+
15
+
## Options
16
+
17
+
| Flag | Description |
18
+
|------|-------------|
19
+
|`--key` / `-k``<key>`| Key containing a JSON string to expand. May be a keyspec. May be specified multiple times for multiple keys. |
20
+
|`--recursive` / `-r`| Recursively expand JSON strings found in nested values after initial expansion. |
21
+
22
+
## Examples
23
+
24
+
### Expand a metadata field containing a JSON string
Copy file name to clipboardExpand all lines: docs/reference/multiplex.md
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,10 +17,15 @@ Take records, grouped together by --keys, and run a separate operation instance
17
17
| Flag | Description |
18
18
|------|-------------|
19
19
|`--key` / `-k``<keys>`| Comma-separated list of key fields for grouping. May be a key spec or key group. |
20
+
|`--dlkey` / `-K``<name>=<expression>`| Domain language key: name=expression where the expression evaluates as a valuation. |
20
21
|`--line-key` / `-L``<key>`| Use the value of this key as line input for the nested operation (rather than the entire record). Use with recs-from* operations generally. |
21
-
|`--adjacent`| Only group together adjacent records. Avoids spooling records into memory. |
22
-
|`--size``<number>`| Number of running clumps to keep. |
22
+
|`--adjacent`/ `-1`| Only group together adjacent records. Avoids spooling records into memory. |
23
+
|`--size`/ `--sz` / `-n``<number>`| Number of running clumps to keep. |
23
24
|`--cube`| Enable cube mode. |
25
+
|`--clumper` / `-c``<spec>`| Clumper specification (e.g. keylru,field,size or keyperfect,field). |
26
+
|`--dlclumper``<expression>`| Domain language clumper specification. |
27
+
|`--list-clumpers`| List available clumpers and exit. |
28
+
|`--show-clumper``<name>`| Show details of a specific clumper and exit. |
recs\-expandjson \- Expand JSON strings embedded in record fields into actual JSON values
5
+
6
+
.SH SYNOPSIS
7
+
.Brecsexpandjson[options][files...]
8
+
9
+
.SH DESCRIPTION
10
+
Expand JSON strings embedded in record fields into actual JSON values. When a field contains a string that is valid JSON (object, array, etc.), this operation parses it and replaces the string with the parsed structure. With no \-\-key options, all top\-level string fields that look like JSON are expanded.
11
+
.PP
12
+
13
+
.SH OPTIONS
14
+
.TP
15
+
\fB--key\fR, \fB-k\fR\fI<key>\fR
16
+
Key containing a JSON string to expand. May be a keyspec. May be specified multiple times for multiple keys.
17
+
.TP
18
+
\fB--recursive\fR, \fB-r\fR
19
+
Recursively expand JSON strings found in nested values after initial expansion.
0 commit comments