Skip to content

driver-mongodb 是 { field: {} } 唯一还在作答的后端:#5240 拍板拒收、#5327 已闸四家,mongodb 仍译成「字段深等于空文档」 #5376

Closed

Description

@os-zhuang

同步 PR #5323 到当前 main(#5239 的接力单)时逐条复核其散文论断,发现其中「{ field: {} } 尚未在任何后端设闸」已过时:#5327 已按 #5240 的拍板在 driver-sql / driver-sqlite-wasm / driver-memory / formula 四家落闸(INVALID_FILTER / 400,消息点名位置)。driver-mongodb 是第五家,不在 #5240 的「四后端」范围里,今天仍在作答。按 PD #10 立单,unassigned。

现场

packages/plugins/driver-mongodb/src/mongodb-filter.ts,translateCondition 的字段路径:值是对象但没有任何 $ 键时走「Nested object — treat as exact match」,于是:

translateFilter({ stage: {} })   =>   { "stage": {} }

MongoDB 把 { stage: {} } 读作字段深等于空文档 —— 与 driver-memory 修复前 mingo 的读法同款(#5327 的实现评论里实测过:特意播的 a: {} 行会被选中)。也就是说这不是 FALSE,是另一个 filter,只在正常数据上看着像 FALSE。

PR #5323(合入后)的 reduceFilterKey 刻意把带字段键的节点一律判 'clause'、译文逐字节不变 —— 它当时的注释写明「不替 #5240 做裁决」;拍板(取拒收)与四家落闸都发生在其 base 之后。同步轮已把注释校订为指向本单,归约判定未动。

建议(照抄先例即可)

与 #5327 在 driver-sql 的落法同构:闸门放在归约的校验遍历(reduceFilterKey,与 assertFilterNode 并列),不是发射器 —— 发射器会被布尔单位元整体短路,{ $or: [ { a: {} }, {} ] } 在发射器侧永远见不到 { a: {} },拒不拒收取决于兄弟节点(#5327 PR 正文的原论证)。消息首句照抄 driver-sql 的 emptyFieldConstraintError,一况一词(#5240)。

判定本身不改:字段键仍是 'clause',这是加一条拒收,不是重分类幸存形状。

关联

未验证

未跑真 mongod(本容器取不到 mongodb-memory-server 二进制);{ stage: {} } 的译文由 translateFilter 纯函数实测,服务端读法引自 MongoDB 文档语义与 #5327 对 mingo 的实测同款,未在真服务端复测。

Activity

  1. added 3 commits that reference this issue on Aug 5, 2026
  2. os-zhuang commented on Aug 5, 2026

    @os-zhuang
    ContributorAuthor

    分诊(backlog sweep,主 backlog 代扫):挂 pm:queue + domain:engine。理由:落点 packages/plugins/driver-mongodb(driver-* 属 engine 域);{ field: {} } 的语义已有维护者裁决(#5240 拒收)且四家后端已闸(#5327),本单是把既有裁决铺到最后一个后端——restore-invariant 形状,免升级直接入队。⚠️ 与 #5346 同包,认领时跨轮串行。不构成认领。会话:session_01N3uGFF8teXbpgtbEJ1aYXu


    Generated by Claude Code

  3. added
    pm:on-holdDecision made, deliberately deferred — no dispatch, no nag; restart condition in the hold comment
    and removed
    pm:queueReady for the PM dispatch loop
    on Aug 5, 2026
  4. os-zhuang commented on Aug 5, 2026

    @os-zhuang
    ContributorAuthor

    转 pm:on-hold(2026-08-05,维护者裁决,锚点 #5499):driver-mongodb 暂无客户,团队聚焦,投入冻结(撤销今晨入队分诊——彼时按 restore-invariant 判据入队,现被更高层的资源裁决覆盖)。重启条件:出现真实客户需求时由维护者解冻,届时本单(把 #5240 的拒收裁决铺到 mongodb)应为解冻后首批。不派发、不催。会话:session_01N3uGFF8teXbpgtbEJ1aYXu


    Generated by Claude Code

  5. added
    pm:dispatchedDispatched to a dev agent by /pm-dispatch
    and removed
    pm:on-holdDecision made, deliberately deferred — no dispatch, no nag; restart condition in the hold comment
    on Aug 11, 2026
  6. self-assigned this
    on Aug 11, 2026
  7. huangyiirene commented on Aug 11, 2026

    @huangyiirene
    Collaborator

    Claim: PM loop round 2 (drivers seat, post-unfreeze batch 1)
    Session: session_013ZU38vNzLXCscgdFZjKd53
    Branch: claude/issue-5346-mongodb-filter-refusals (shared with #5346 — the two cards name each other as same-batch, same file, same envelope; one dev, one PR, Fixes #5346 + Fixes #5376)
    Worktree: objectstack-issue-5346
    Domain: domain:drivers
    File surface: packages/drivers/driver-mongodb/src/mongodb-filter.ts (region: classifyFilterKey — the code comment at that site names this card as its tracker), packages/drivers/driver-mongodb/src/mongodb-filter-*.test.ts, .changeset/*
    Container & model: M, mode:cloud, model: opus
    Serial constraints cleared: same as #5346's claim comment (this is one card).

    Authorization: maintainer unfroze driver-mongodb 2026-08-11 (verbatim on #5499, comment 5249019855). The 2026-08-05 hold comment on this card wrote 「届时本单(把 #5240 的拒收裁决铺到 mongodb)应为解冻后首批」 — this is that first batch. Premise re-verified by the PM on origin/main @ 76d74ecb4: classifyFilterKey still classifies { field: {} } as 'clause' and the emitter still answers it as exact-match-on-empty-document; the site's own comment says "tracked by #5376".


    Generated by Claude Code

  8. huangyiirene commented on Aug 11, 2026

    @huangyiirene
    Collaborator

    ACCEPT — PR #7528. Full review verdict on #5346 (comment 5249044449's thread); this card's { field: {} } gate landed in classifyFilterKey with the walk-position argument measured ({ $or: [ { a: {} }, {} ] } translated to match-all pre-fix, now refused naming filter.$or[0].stage-style positions), sibling wording verbatim, code+status asserted. The 2026-08-05 hold comment's 「解冻后首批」 is hereby delivered.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpm:dispatchedDispatched to a dev agent by /pm-dispatch

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions