Selaa lähdekoodia

docs: correct my own null guidance - exists:true is NOT the guard

I told a consumer an hour ago that field:exists:true was "strictly better"
than a pair of bounds for excluding nulls from a range filter, and they
thanked me for an operator they had not known about and put it in a spec. It
is wrong: a field holding an explicit null EXISTS, so exists excludes only
the absent case, which was never the problem.

The database answered the question I had referred to them, and it corrects
more than that one point. The ordering is EMERGENT, not specified: values
order by type, null < boolean < number < string, and an absent field returns
false for every range operator and for ne. So both directions over-match -
year:lte:2025 matches null AND a boolean true, and year:gte:2025 matches the
STRING "1900", because strings sort above every number.

A pair of bounds does fix the null case, since the gte half rejects what the
lte half admits. It does NOT fix the string case. The only robust guard
against a wrong type being stored at all is a collection schema, which makes
database 2.16.0's schema support the real remedy for this class rather than a
cleverer filter - and connects this to task #62.

Also recorded: sort and filter disagree about an absent field. Sort places it
after everything ascending; a filter never matches it. They agree on null.

Documented as emergent rather than as a guarantee, at the database's explicit
request, since their owner has yet to decide whether comparisons should
require matching kinds the way SQL NULL does.
fszontagh 1 kuukausi sitten
vanhempi
sitoutus
7ee124b183
1 muutettua tiedostoa jossa 10 lisäystä ja 1 poistoa
  1. 10 1
      api/llms.txt

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 10 - 1
api/llms.txt


Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä