Skip to content

v0.7.0

Choose a tag to compare

@anidotnet anidotnet released this 07 Aug 06:49
· 36 commits to main since this release

Removed

  • BREAKING: Removed the distinct find option — the distinct() free function, FindOptions::distinct(), and FindPlan::distinct(). It had no effect on the result set. A find never returns the same document twice, and the only place the flag was ever read was the or sub-plan union, which now deduplicates unconditionally because an or is a set union by definition. The flag's sole remaining effect was to paper over the duplicate defect fixed below. Callers passing distinct() can drop it without any change in results.

Fixed

  • find no longer returns a document more than once from an or filter when the document satisfies more than one branch. Two separate defects both produced duplicates:
    • When any branch of the or was not index-backed, the planner intended to discard the per-branch sub-plans and run the whole or as a single full scan, but only dropped a borrowed handle to them — the sub-plans stayed on the FindPlan and were executed in addition to the full scan. A document matching two branches came out twice, so field("x").eq(1).or(field("y").eq(2)) over a two-document collection reported three rows. Sub-plans are now attached only once every branch is known to be index-backed (or resolvable by _id); otherwise the or runs purely as a full scan.
    • When every branch was index-backed, the union of the per-branch scans was only deduplicated if the caller passed the distinct() find option, which defaulted to off. An or is a set union by definition, so the union is now always deduplicated by NitriteId.

Full Changelog: v0.6.0...v0.7.0