Re: [w3c/IndexedDB] boolean should be a valid key (#76)

It would be natural to allow index for all the basic types: number, string, array and boolean. It is a little of a surprise for many users that booleans are not indexable. There are use cases also for indexable nulls and undefined as well, particularly when using the index for sorting. But backward compability would break if starting to index undefined or null. And there is many use cases where undefined should not be indexed because its also an optimization to having the posibility to not index every object in the table.

If ever null or undefined where to be indexed, I think this should be an opt-in flag when creating the index. For primary keys (Object stores) these types would not make sense.

Boolean index would not be as ground-breaking as null/undefined imho. IDB2.0 added support for binary keys without an opt-in flag and that did (in theory) break backward compatibility as well.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/issues/76#issuecomment-502998907

Received on Tuesday, 18 June 2019 08:17:30 UTC