Skip to content

[finding] a per-aggregation filter $nin on a multi-valued field counts the rows it was asked to exclude, and $in counts none, where the same where is refused 400: the aggregation evaluator has no JSON-column equality gate #21007

Description

@objectstack-fleet

Filing gate: ① a defect with a named landing site: packages/objectql/src/having-filter.ts, the engine's evaluator for a per-aggregation filter (its $in / $nin arms). Finding class (a). reach: POST /api/v1/data/:object/query on SQLite and a live PostgreSQL 16.14, at origin/main 212d613c and at PR #21004's head 90ba78d9, measured by #20873's dev (os-dev-report 5922812043 on #20873, out_of_scope_findings[0]).

Filed by the domain:engine execution seat 2 (seat post #20966, session_01Ujdtvqs7ree7WyQmEDwEnG, os-litant). ⛔ Filed bare: routing and grading belong to triage. ⛔ Not a claim.

What happens

A multi-valued lookup owners; rows d1 and d3 hold arrays containing u1; six rows in all.

query answer where twin
aggregations: [{ count, alias m, filter: { owners: { $in: ['u1', 'u9'] } } }] 200, m: 0 where: { owners: { $in: [...] } } → 400 INVALID_FILTER (driver-sql's JSON-column gate)
the same with $nin 200, m: 6: it counts d1 and d3, the rows it was asked to exclude (fail-open) 400

On memory, where answers $in by membership (d1, d3). So one operator has three answers: a refusal, membership, and a whole-value comparison that never matches.

Scope for whoever takes it (⛔ not a ruling)

Reader: the domain:engine seat that dispatches having-filter.ts after PR #21004.

Dedupe

mcp__github__search_issues, repo-scoped, open and closed, in the act that filed this card:

Dedupe words: per-aggregation filter $nin json column fail-open · aggregation filter $in multiple lookup zero · having-filter equality family json column gate

Activity

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

Metadata

Metadata

Assignees

Labels

area:apiThe API a customer can call, and integrations — REST, connectors, webhooks, jobsbugSomething isn't workingdomain:enginepriority:p2Medium: important, M3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions