Skip to content

v6.10.1

Choose a tag to compare

@58bits 58bits released this 22 Oct 06:02
· 4 commits to develop since this release

Bug Fixes

  • @byline/core: where operator objects now apply every operator. In 6.10.0 and earlier, an operator object with more than one operator silently used only the first one. find({ where: { price: { $gte: 10, $lte: 20 } } }) compiled to price >= 10, and { publicationDate: { $gt: 0, $gte: 20200000, $lte: 20201231 } } compiled to publicationDate > 0, so callers got the whole dated set while believing a range was applied. Every operator in the object now applies, ANDed together, at every scope: top-level fields, the reserved status / path / id keys, relation sub-wheres, and the $some / $every / $none quantifiers. The QueryPredicate and FilterOperators types already allowed several operators per object and are unchanged.

    Behaviour change: if you relied on the truncation, for example by passing a range whose later bound was wrong, those queries now return fewer rows. Single-operator objects, bare values, and $and / $or workarounds such as { $and: [{ f: { $gte: A } }, { f: { $lte: B } }] } behave exactly as before.

  • @byline/core: Input the parser cannot honour is now rejected rather than dropped. The following now throw ERR_VALIDATION (invalid where clause for '<collection>': …) instead of compiling to nothing: an empty operator object ({ views: {} }), including one whose operators are all undefined; an unknown operator ({ views: { $gte: 10, $bogus: 1 } }), even when its value is undefined; an array where a value or operator object belongs; and an $and / $or value that is not an array. Operators set to undefined alongside real ones are skipped, matching how the parser already skips undefined keys.

  • @byline/core: Top-level status operator objects now filter. { status: { $in: ['draft', 'published'] } } at the top level of where was silently ignored, because only a bare string was honoured there. It now compiles to a document-column filter. A bare string keeps its existing form.

  • @byline/core: Strict beforeRead predicates accept multi-operator objects. Security predicates previously required exactly one operator per object. They now accept several and validate every one, so a hook can return a range such as { views: { $gte: 10, $lte: 20 } }.

Chores

  • monorepo: Migrated the repository's Biome configuration to 2.6, turned off Biome's markdown and YAML handling, and disabled the unsafe auto-fixes that had been rewriting non-null assertions during release lint. Removed a stale apps/webapp/pnpm-lock.yaml that the root workspace lockfile supersedes.
  • monorepo: Corrected the operator list in the client SDK guide, which listed $startsWith and $endsWith (neither exists) and omitted $nin, and documented how multi-operator objects behave.

All other @byline/* packages bumped to 6.10.1 in lockstep with no behavioural changes this cycle.