Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(cohorts): clarify cohort filter shape to stop LLMs emitting bad test_account_filters (#58788)

Thomas Obermüllera45c16a9d5ca
diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.json
index 75e1793beab7..406bf5105325 100644
--- a/frontend/src/queries/schema.json
+++ b/frontend/src/queries/schema.json
@@ -1090,13 +1090,13 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
diff --git a/frontend/src/queries/schema/schema-assistant-queries.ts b/frontend/src/queries/schema/schema-assistant-queries.ts
index dc5abc3def74..8d8257107313 100644
--- a/frontend/src/queries/schema/schema-assistant-queries.ts
+++ b/frontend/src/queries/schema/schema-assistant-queries.ts
@@ -173,14 +173,17 @@ export type AssistantGroupPropertyFilter = AssistantBasePropertyFilter & {
export interface AssistantCohortPropertyFilter {
/**
* Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort.
- * Example: `{ type: "cohort", key: "id", value: 42, operator: "in" }`
+ * Use `operator: "in"` to include cohort members, or `operator: "not_in"` to exclude them.
+ * Examples:
+ * - Include: `{ type: "cohort", key: "id", value: 42, operator: "in" }`
+ * - Exclude: `{ type: "cohort", key: "id", value: 42, operator: "not_in" }`
*/
type: PropertyFilterType.Cohort
key: 'id'
/** The cohort ID to filter by. */
value: integer
/** @default in */
- operator: PropertyOperator.In
+ operator: PropertyOperator.In | PropertyOperator.NotIn
}
export type AssistantElementPropertyFilter = AssistantBasePropertyFilter & {
diff --git a/posthog/cdp/test/test_filters.py b/posthog/cdp/test/test_filters.py
index e3aefaa50d1f..2b6a2d5c4007 100644
--- a/posthog/cdp/test/test_filters.py
+++ b/posthog/cdp/test/test_filters.py
@@ -433,7 +433,7 @@ class TestCohortInlining(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):
],
}
)
- self.team.test_account_filters = [{"type": "cohort", "key": "id", "value": cohort.pk, "negation": True}]
+ self.team.test_account_filters = [{"type": "cohort", "key": "id", "value": cohort.pk, "operator": "not_in"}]
self.team.save()
result = compile_filters_bytecode({"filter_test_accounts": True}, self.team)
@@ -603,8 +603,8 @@ class TestCohortInlining(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):
is_static=False,
)
self.team.test_account_filters = [
- {"type": "cohort", "key": "id", "value": test_users_cohort.pk, "negation": True},
- {"type": "cohort", "key": "id", "value": internal_users_cohort.pk, "negation": True},
+ {"type": "cohort", "key": "id", "value": test_users_cohort.pk, "operator": "not_in"},
+ {"type": "cohort", "key": "id", "value": internal_users_cohort.pk, "operator": "not_in"},
]
self.team.save()
@@ -644,7 +644,7 @@ class TestCohortInlining(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):
is_static=False,
)
# "not in cohort" = exclude anyone whose email matches either domain
- self.team.test_account_filters = [{"type": "cohort", "key": "id", "value": cohort.pk, "negation": True}]
+ self.team.test_account_filters = [{"type": "cohort", "key": "id", "value": cohort.pk, "operator": "not_in"}]
self.team.save()
result = compile_filters_bytecode({"filter_test_accounts": True}, self.team)
diff --git a/posthog/cdp/test/test_site_functions.py b/posthog/cdp/test/test_site_functions.py
index 578c943c14cf..1d29384f5dc9 100644
--- a/posthog/cdp/test/test_site_functions.py
+++ b/posthog/cdp/test/test_site_functions.py
@@ -253,7 +253,7 @@ class TestSiteFunctions(TestCase):
)
self.team.test_account_filters = [
- {"key": "id", "type": "cohort", "value": cohort.id, "negation": True},
+ {"key": "id", "type": "cohort", "value": cohort.id, "operator": "not_in"},
]
self.team.save()
@@ -322,7 +322,7 @@ class TestSiteFunctions(TestCase):
)
self.team.test_account_filters = [
- {"key": "id", "type": "cohort", "value": cohort.id, "negation": True},
+ {"key": "id", "type": "cohort", "value": cohort.id, "operator": "not_in"},
]
self.team.save()
diff --git a/posthog/migrations/1156_cohort_team_filters_help_text.py b/posthog/migrations/1156_cohort_team_filters_help_text.py
new file mode 100644
index 000000000000..a975b511c430
--- /dev/null
+++ b/posthog/migrations/1156_cohort_team_filters_help_text.py
@@ -0,0 +1,27 @@
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("posthog", "1155_sharingconfiguration_interviewee_context"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="cohort",
+ name="filters",
+ field=models.JSONField(
+ blank=True,
+ help_text='Filters for the cohort. The `negation` field shown below is specific to\n cohort definitions (the inner sub-filters that build a cohort). Property filters used\n *outside* cohort definitions — e.g. on `team.test_account_filters`, insight filters, or\n feature flag conditions — must use `operator: "in"`/`"not_in"` for cohort exclusion and\n do NOT accept `negation`.\n\n Examples:\n\n # Behavioral filter (performed event)\n {\n "properties": {\n "type": "OR",\n "values": [{\n "type": "OR",\n "values": [{\n "key": "address page viewed",\n "type": "behavioral",\n "value": "performed_event",\n "negation": false,\n "event_type": "events",\n "time_value": "30",\n "time_interval": "day"\n }]\n }]\n }\n }\n\n # Person property filter\n {\n "properties": {\n "type": "OR",\n "values": [{\n "type": "AND",\n "values": [{\n "key": "promoCodes",\n "type": "person",\n "value": ["1234567890"],\n "negation": false,\n "operator": "exact"\n }]\n }]\n }\n }\n\n # Cohort filter (inner — within a cohort definition)\n {\n "properties": {\n "type": "OR",\n "values": [{\n "type": "AND",\n "values": [{\n "key": "id",\n "type": "cohort",\n "value": 8814,\n "negation": false\n }]\n }]\n }\n }',
+ null=True,
+ ),
+ ),
+ migrations.AlterField(
+ model_name="team",
+ name="test_account_filters",
+ field=models.JSONField(
+ default=list,
+ help_text='Filters used to identify internal/test users. Each entry is a property filter.\n\n Supported entry types and the exact shape each accepts:\n\n # Person property — match (or exclude) by a person property\n {"key": "email", "type": "person", "value": "@example.com", "operator": "icontains"}\n\n # Event property — match by an event property\n {"key": "$host", "type": "event", "value": "localhost", "operator": "icontains"}\n\n # Cohort membership — match (or exclude) members of a cohort.\n # Use operator "in" for inclusion and "not_in" for exclusion. Do NOT use a\n # `negation` field here — `negation` is specific to cohort *definitions*\n # (the inner sub-filters that build a cohort) and is rejected by the\n # property-filter schema.\n {"key": "id", "type": "cohort", "value": 8814, "operator": "not_in"}\n\n Common operators: "exact", "is_not", "icontains", "not_icontains", "regex",\n "not_regex", "gt", "lt", "gte", "lte", "is_set", "is_not_set", "in", "not_in".',
+ ),
+ ),
+ ]
diff --git a/posthog/migrations/max_migration.txt b/posthog/migrations/max_migration.txt
index 38e6b0d3ed4a..5eb0a9f7bbcb 100644
--- a/posthog/migrations/max_migration.txt
+++ b/posthog/migrations/max_migration.txt
@@ -1 +1 @@
-1155_sharingconfiguration_interviewee_context
+1156_cohort_team_filters_help_text
diff --git a/posthog/models/cohort/cohort.py b/posthog/models/cohort/cohort.py
index 00f33ee23505..eada5cf7fb1d 100644
--- a/posthog/models/cohort/cohort.py
+++ b/posthog/models/cohort/cohort.py
@@ -127,7 +127,13 @@ class Cohort(FileSystemSyncMixin, RootTeamMixin, models.Model):
filters = models.JSONField(
null=True,
blank=True,
- help_text="""Filters for the cohort. Examples:
+ help_text="""Filters for the cohort. The `negation` field shown below is specific to
+ cohort definitions (the inner sub-filters that build a cohort). Property filters used
+ *outside* cohort definitions — e.g. on `team.test_account_filters`, insight filters, or
+ feature flag conditions — must use `operator: "in"`/`"not_in"` for cohort exclusion and
+ do NOT accept `negation`.
+
+ Examples:
# Behavioral filter (performed event)
{
@@ -165,7 +171,7 @@ class Cohort(FileSystemSyncMixin, RootTeamMixin, models.Model):
}
}
- # Cohort filter
+ # Cohort filter (inner — within a cohort definition)
{
"properties": {
"type": "OR",
diff --git a/posthog/models/team/team.py b/posthog/models/team/team.py
index e73fecb807bc..b0e7ff67a044 100644
--- a/posthog/models/team/team.py
+++ b/posthog/models/team/team.py
@@ -497,7 +497,32 @@ class Team(UUIDTClassicModel):
# This is not a manual setting. It's updated automatically to reflect if the team uses site apps or not.
inject_web_apps = models.BooleanField(null=True)
- test_account_filters = field_access_control(models.JSONField(default=list), "project", "admin")
+ test_account_filters = field_access_control(
+ models.JSONField(
+ default=list,
+ help_text="""Filters used to identify internal/test users. Each entry is a property filter.
+
+ Supported entry types and the exact shape each accepts:
+
+ # Person property — match (or exclude) by a person property
+ {"key": "email", "type": "person", "value": "@example.com", "operator": "icontains"}
+
+ # Event property — match by an event property
+ {"key": "$host", "type": "event", "value": "localhost", "operator": "icontains"}
+
+ # Cohort membership — match (or exclude) members of a cohort.
+ # Use operator "in" for inclusion and "not_in" for exclusion. Do NOT use a
+ # `negation` field here — `negation` is specific to cohort *definitions*
+ # (the inner sub-filters that build a cohort) and is rejected by the
+ # property-filter schema.
+ {"key": "id", "type": "cohort", "value": 8814, "operator": "not_in"}
+
+ Common operators: "exact", "is_not", "icontains", "not_icontains", "regex",
+ "not_regex", "gt", "lt", "gte", "lte", "is_set", "is_not_set", "in", "not_in".""",
+ ),
+ "project",
+ "admin",
+ )
test_account_filters_default_checked = field_access_control(
models.BooleanField(null=True, blank=True), "project", "admin"
)
diff --git a/posthog/schema.py b/posthog/schema.py
index 613870e56154..3e5698ec0971 100644
--- a/posthog/schema.py
+++ b/posthog/schema.py
@@ -135,6 +135,11 @@ class AssistantBaseMultipleBreakdownFilter(BaseModel):
property: str = Field(..., description="Property name from the plan to break down by.")
+class Operator(StrEnum):
+ IN_ = "in"
+ NOT_IN = "not_in"
+
+
class YAxisPosition(StrEnum):
LEFT = "left"
RIGHT = "right"
@@ -5339,13 +5344,15 @@ class AssistantCohortPropertyFilter(BaseModel):
extra="forbid",
)
key: Literal["id"] = "id"
- operator: Literal["in"] = "in"
+ operator: Operator | None = Operator.IN_
type: Literal["cohort"] = Field(
default="cohort",
description=(
"Filter events by cohort membership. Use this to narrow down results to"
- ' persons belonging to a specific cohort. Example: `{ type: "cohort", key:'
- ' "id", value: 42, operator: "in" }`'
+ ' persons belonging to a specific cohort. Use `operator: "in"` to include'
+ ' cohort members, or `operator: "not_in"` to exclude them. Examples:\n-'
+ ' Include: `{ type: "cohort", key: "id", value: 42, operator: "in" }`\n-'
+ ' Exclude: `{ type: "cohort", key: "id", value: 42, operator: "not_in" }`'
),
)
value: int = Field(..., description="The cohort ID to filter by.")
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index f86769a42fd1..243ce7de5a1f 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -30160,6 +30160,25 @@ export namespace Schemas {
app_urls?: (string | null)[];
anonymize_ips?: boolean;
completed_snippet_onboarding?: boolean;
+ /** Filters used to identify internal/test users. Each entry is a property filter.
+
+ Supported entry types and the exact shape each accepts:
+
+ # Person property — match (or exclude) by a person property
+ {"key": "email", "type": "person", "value": "@example.com", "operator": "icontains"}
+
+ # Event property — match by an event property
+ {"key": "$host", "type": "event", "value": "localhost", "operator": "icontains"}
+
+ # Cohort membership — match (or exclude) members of a cohort.
+ # Use operator "in" for inclusion and "not_in" for exclusion. Do NOT use a
+ # `negation` field here — `negation` is specific to cohort *definitions*
+ # (the inner sub-filters that build a cohort) and is rejected by the
+ # property-filter schema.
+ {"key": "id", "type": "cohort", "value": 8814, "operator": "not_in"}
+
+ Common operators: "exact", "is_not", "icontains", "not_icontains", "regex",
+ "not_regex", "gt", "lt", "gte", "lte", "is_set", "is_not_set", "in", "not_in". */
test_account_filters?: unknown;
/** @nullable */
test_account_filters_default_checked?: boolean | null;
@@ -35230,6 +35249,25 @@ export namespace Schemas {
app_urls?: (string | null)[];
anonymize_ips?: boolean;
completed_snippet_onboarding?: boolean;
+ /** Filters used to identify internal/test users. Each entry is a property filter.
+
+ Supported entry types and the exact shape each accepts:
+
+ # Person property — match (or exclude) by a person property
+ {"key": "email", "type": "person", "value": "@example.com", "operator": "icontains"}
+
+ # Event property — match by an event property
+ {"key": "$host", "type": "event", "value": "localhost", "operator": "icontains"}
+
+ # Cohort membership — match (or exclude) members of a cohort.
+ # Use operator "in" for inclusion and "not_in" for exclusion. Do NOT use a
+ # `negation` field here — `negation` is specific to cohort *definitions*
+ # (the inner sub-filters that build a cohort) and is rejected by the
+ # property-filter schema.
+ {"key": "id", "type": "cohort", "value": 8814, "operator": "not_in"}
+
+ Common operators: "exact", "is_not", "icontains", "not_icontains", "regex",
+ "not_regex", "gt", "lt", "gte", "lte", "is_set", "is_not_set", "in", "not_in". */
test_account_filters?: unknown;
/** @nullable */
test_account_filters_default_checked?: boolean | null;
diff --git a/services/mcp/src/tools/generated/query-wrappers.ts b/services/mcp/src/tools/generated/query-wrappers.ts
index 642f2c361a12..1b7a7306158b 100644
--- a/services/mcp/src/tools/generated/query-wrappers.ts
+++ b/services/mcp/src/tools/generated/query-wrappers.ts
@@ -199,11 +199,11 @@ const AssistantGroupPropertyFilter = z.union([
const AssistantCohortPropertyFilter = z.object({
key: z.literal('id').default('id'),
- operator: z.literal('in').default('in'),
+ operator: z.enum(['in', 'not_in']).default('in'),
type: z
.literal('cohort')
.describe(
- 'Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: "cohort", key: "id", value: 42, operator: "in" }`'
+ 'Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: "in"` to include cohort members, or `operator: "not_in"` to exclude them. Examples:\n- Include: `{ type: "cohort", key: "id", value: 42, operator: "in" }`\n- Exclude: `{ type: "cohort", key: "id", value: 42, operator: "not_in" }`'
)
.default('cohort'),
value: integer.describe('The cohort ID to filter by.'),
diff --git a/services/mcp/src/tools/generated/replay.ts b/services/mcp/src/tools/generated/replay.ts
index dfe489e62fa2..f6afd6ad693a 100644
--- a/services/mcp/src/tools/generated/replay.ts
+++ b/services/mcp/src/tools/generated/replay.ts
@@ -308,11 +308,11 @@ const AssistantGroupPropertyFilter = z.union([
const AssistantCohortPropertyFilter = z.object({
key: z.literal('id').default('id'),
- operator: z.literal('in').default('in'),
+ operator: z.enum(['in', 'not_in']).default('in'),
type: z
.literal('cohort')
.describe(
- 'Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: "cohort", key: "id", value: 42, operator: "in" }`'
+ 'Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: "in"` to include cohort members, or `operator: "not_in"` to exclude them. Examples:\n- Include: `{ type: "cohort", key: "id", value: 42, operator: "in" }`\n- Exclude: `{ type: "cohort", key: "id", value: 42, operator: "not_in" }`'
)
.default('cohort'),
value: integer.describe('The cohort ID to filter by.'),
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-funnel.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-funnel.json
index c09bffae2cce..83bbf51262a2 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-funnel.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-funnel.json
@@ -483,14 +483,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
@@ -1012,14 +1012,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
@@ -1556,14 +1556,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
@@ -2187,14 +2187,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
@@ -2825,14 +2825,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-lifecycle-actors.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-lifecycle-actors.json
index 649ee3703850..82ab0e71bc58 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-lifecycle-actors.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-lifecycle-actors.json
@@ -405,14 +405,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
@@ -961,14 +961,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
@@ -1515,14 +1515,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-lifecycle.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-lifecycle.json
index f016e9deb47a..50169c8210fc 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-lifecycle.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-lifecycle.json
@@ -379,14 +379,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
@@ -908,14 +908,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
@@ -1442,14 +1442,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-llm-trace.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-llm-trace.json
index 84c49bdd94ee..0a757dafb87a 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-llm-trace.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-llm-trace.json
@@ -320,14 +320,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-llm-traces-list.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-llm-traces-list.json
index 9239a08a8c04..b693a3907adb 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-llm-traces-list.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-llm-traces-list.json
@@ -358,14 +358,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-paths.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-paths.json
index d33ae3b3afec..ff14b1b37058 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-paths.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-paths.json
@@ -431,14 +431,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-retention.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-retention.json
index a5778accf9d0..139b6243e1fa 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-retention.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-retention.json
@@ -344,14 +344,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
@@ -918,14 +918,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
@@ -1449,14 +1449,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
@@ -1989,14 +1989,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
@@ -2520,14 +2520,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-session-recordings-list.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-session-recordings-list.json
index 7771a8eada61..8686c1bf7691 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-session-recordings-list.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-session-recordings-list.json
@@ -361,14 +361,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-stickiness.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-stickiness.json
index 84b5f29a616f..2028922c5e28 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-stickiness.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-stickiness.json
@@ -371,14 +371,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
@@ -999,14 +999,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
@@ -1632,14 +1632,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-trends-actors.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-trends-actors.json
index 401215374a2a..8483af46edb8 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-trends-actors.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-trends-actors.json
@@ -493,14 +493,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
@@ -1165,14 +1165,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
@@ -1839,14 +1839,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
@@ -2707,14 +2707,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
@@ -3480,14 +3480,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-trends.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-trends.json
index bad1bffa6f52..7150658583f3 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-trends.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/v2/query-trends.json
@@ -444,14 +444,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
@@ -1075,14 +1075,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
@@ -1715,14 +1715,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
@@ -2563,14 +2563,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
@@ -3311,14 +3311,14 @@
"type": "string"
},
"operator": {
- "const": "in",
"default": "in",
+ "enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
- "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Example: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`",
+ "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {