Skip to content

Commit c9156e5

Browse files
authored
Update docs for additional_metadata re: filtering semantics (#3670)
1 parent 10fdade commit c9156e5

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

frontend/docs/pages/v1/additional-metadata.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,24 @@ For example, you can filter events by the `source` metadata keys to quickly find
7373

7474
![Blocks](/addl-meta.gif)
7575

76+
## Filtering Semantics
77+
78+
When filtering **runs** with `additional_metadata`, Hatchet returns runs that match **any** of the provided pairs (logical `OR`), not all of them.
79+
80+
<Callout type="info">
81+
For example, filtering runs with `{ first_name: "john", last_name: "doe" }`
82+
returns runs whose metadata matches *either* `first_name: "john"` *or*
83+
`last_name: "doe"`, not only runs that match both.
84+
</Callout>
85+
86+
Event filtering behaves differently: filtering **events** with multiple `additional_metadata` pairs requires all pairs to match (logical `AND`), since events use `JSONB` containment under the hood.
87+
88+
<Callout type="info">
89+
For example, filtering events with `{ first_name: "john", last_name: "doe" }`
90+
returns only events whose metadata matches *both* `first_name: "john"` *and*
91+
`last_name: "doe"`.
92+
</Callout>
93+
7694
## Use Cases
7795

7896
Some common use cases for additional metadata include:

0 commit comments

Comments
 (0)