File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1
1
import Base from " ../ParsingOptionsBase.mdx" ;
2
2
3
+ ### Duplicate Keys
4
+
5
+ If the parser encounters a duplicate key in an event, it will transparently
6
+ upgrade the field to be a list of values instead. If the values are of different
7
+ type, conversions to a common type will be attempted, such as to a common number
8
+ type. Ultimately values will be stringified if they do not share a common type.
9
+
10
+ For a simple example, consider this JSON file:
11
+ ``` json title="Example JSON with duplicate key" {2}
12
+ { "key" : 7 }
13
+ { "key" : 0.0 , "key" : 1 }
14
+ { "key" : 42 }
15
+ ```
16
+ The event with a duplicate key has the respective value upgraded to a list:
17
+ ``` tql {2}
18
+ { key: 7 }
19
+ { key: [0.0, 1.0] }
20
+ { key: 42 }
21
+ ```
22
+
3
23
### ` merge = bool (optional) `
4
24
5
25
Merges all incoming events into a single schema\* that converges over time. This
@@ -8,4 +28,6 @@ to huge schemas filled with nulls and imprecise results. Use with caution.
8
28
9
29
\* : In selector mode, only events with the same selector are merged.
10
30
31
+ In merging mode, a repeated key will always overwrite the previous value.
32
+
11
33
<Base />
You can’t perform that action at this time.
0 commit comments