From b59e8171edf830734e46f3b1cbf09107a39aaebc Mon Sep 17 00:00:00 2001 From: Alex Luong Date: Tue, 16 Dec 2025 20:10:21 +0700 Subject: [PATCH] chore: filter syntax & schema --- .../FilterSyntaxModal/FilterSyntaxModal.tsx | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/internal/portal/src/common/FilterSyntaxModal/FilterSyntaxModal.tsx b/internal/portal/src/common/FilterSyntaxModal/FilterSyntaxModal.tsx index 5f4630e0..780b514c 100644 --- a/internal/portal/src/common/FilterSyntaxModal/FilterSyntaxModal.tsx +++ b/internal/portal/src/common/FilterSyntaxModal/FilterSyntaxModal.tsx @@ -11,17 +11,21 @@ Only events matching the filter will be delivered. Filters use JSON to define ma ## Event Structure -Events contain two top-level properties that can be filtered: +Events have five top-level properties that can be filtered: -- \`data\` — The event payload +- \`id\` — The event ID +- \`topic\` — The event topic +- \`time\` — Event timestamp (RFC3339 format) - \`metadata\` — Additional event information +- \`data\` — The event payload -Your filter should specify one or both of these at the top level: +Your filter should specify one or more of these at the top level: \`\`\`json { + "topic": "order.created", "data": { - "type": "order.created" + "status": "paid" }, "metadata": { "source": "api" @@ -121,6 +125,17 @@ Use operators for complex matching: } \`\`\` +**Example:** Match events within a time range + +\`\`\`json +{ + "time": { + "$gte": "2025-01-01T00:00:00Z", + "$lt": "2025-02-01T00:00:00Z" + } +} +\`\`\` + ## Combining Operators Multiple operators on the same field are combined with AND: