v0.7.0
Removed
- BREAKING: Removed the
distinctfind option — thedistinct()free function,FindOptions::distinct(), andFindPlan::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 theorsub-plan union, which now deduplicates unconditionally because anoris a set union by definition. The flag's sole remaining effect was to paper over the duplicate defect fixed below. Callers passingdistinct()can drop it without any change in results.
Fixed
findno longer returns a document more than once from anorfilter when the document satisfies more than one branch. Two separate defects both produced duplicates:- When any branch of the
orwas not index-backed, the planner intended to discard the per-branch sub-plans and run the wholeoras a single full scan, but only dropped a borrowed handle to them — the sub-plans stayed on theFindPlanand were executed in addition to the full scan. A document matching two branches came out twice, sofield("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 theorruns 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. Anoris a set union by definition, so the union is now always deduplicated byNitriteId.
- When any branch of the
Full Changelog: v0.6.0...v0.7.0