Skip to content

boolean should be a valid key #76

Open
@yathit

Description

@yathit

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions