From 2f2451c0d36e33183217e7689f5c25748a6fefb5 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <209825114+claude[bot]@users.noreply.github.com> Date: Mon, 31 Aug 2026 02:08:22 +0000 Subject: [PATCH] =?UTF-8?q?docs(skills):=20$exists=20means=20HAS=20A=20VAL?= =?UTF-8?q?UE=20=E2=80=94=20retire=20the=20MongoDB=20$exists=20claim=20(#1?= =?UTF-8?q?3539)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GOVERNED SURFACE — published, customer-facing skill text. Both rows taught key-presence, and `objectstack-query/SKILL.md` named the mapping outright: "MongoDB `$exists`". Since 9dac1ae017 (PR #13529) `driver-mongodb`'s translateFilter never emits MongoDB's `$exists` — it lowers the operator to `{$ne: null}` / `{$eq: null}` — so a customer following that line writes a filter whose behaviour differs from the promise on any null-valued field. Established from code and from an executed test, not from another document: - mongodb-filter.ts `case '$exists'` puts `$ne: null` / `$eq: null`; - sql-driver.ts `case '$exists'` compiles whereNotNull / whereNull; - objectql having-filter.ts evaluates `value !== undefined && value !== null`; - 14/14 green in driver-mongodb/src/mongodb-exists-has-value-translation.test.ts, which pins `translateFilter({name: {$exists: true}})` to `{name: {$ne: null}}`. Written to the published token ratchet rather than around it: both files carry zero headroom, so the correction is byte-neutral-or-shrinking rather than an added warning. SKILL.md 22208 -> 22207 bytes, filters.md 8593 -> 8596; both files unchanged in tokens and lines, bundle total unchanged at 186751. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC --- skills/objectstack-query/SKILL.md | 2 +- skills/objectstack-query/rules/filters.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/skills/objectstack-query/SKILL.md b/skills/objectstack-query/SKILL.md index f68b4f46b1..34e0d0142d 100644 --- a/skills/objectstack-query/SKILL.md +++ b/skills/objectstack-query/SKILL.md @@ -154,7 +154,7 @@ The simplest filter — field equals value: | Operator | Purpose | SQL / NoSQL | |:---------|:--------|:------------| | `$null` | Is null check | `IS NULL` / `IS NOT NULL` | -| `$exists` | Field exists (NoSQL) | MongoDB `$exists` | +| `$exists` | Has a value | `IS NOT NULL` / `IS NULL` | ```typescript { where: { deleted_at: { $null: true } } } diff --git a/skills/objectstack-query/rules/filters.md b/skills/objectstack-query/rules/filters.md index 08c6b428a5..30db6c49a7 100644 --- a/skills/objectstack-query/rules/filters.md +++ b/skills/objectstack-query/rules/filters.md @@ -20,7 +20,7 @@ Comprehensive guide for building ObjectStack query filters. | String | `$startsWith` | `LIKE ?%` | `{ code: { $startsWith: 'PRJ-' } }` | | String | `$endsWith` | `LIKE %?` | `{ file: { $endsWith: '.pdf' } }` | | Null | `$null` | `IS NULL` / `IS NOT NULL` | `{ deleted_at: { $null: true } }` | -| Existence | `$exists` | (NoSQL) `$exists` | `{ metadata: { $exists: true } }` | +| Null | `$exists` | `IS NOT NULL` / `IS NULL` | `{ metadata: { $exists: true } }` | ## Implicit Equality (Shorthand)