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

Being only two possible values, boolean data type is not a good key by itself. But query do involve boolean value. For examples, we want to count numbers of records in which a field value is false or true. In this case, full table scan is required. A workaround like shadow field defeat the original argument (that boolean is not a good key).

Boolean value is also useful in compound index. It is not possible now.

[Key comparison](https://www.w3.org/TR/IndexedDB/#key-construct) can be defined that all number values are greater then all boolean values. Should modification could work without breaking existing database.

Indexing boolean value is such a [common gotcha](http://stackoverflow.com/questions/13672906/indexeddb-boolean-index) in indexeddb usage. 

Since boolean is a primitive data type, all other nontrivial data types are valid key, why not boolean? For consistency sake, boolean should be a valid key.

 

---
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

Received on Monday, 2 May 2016 00:14:26 UTC