Return a collection of all items in table where the property is set to an ordered by given indexed property. Objects where the property is not set to an will not be included in the result.
Collection
Returns an unfiltered collection sorted by the index or primary key given by index
. Note that index
can only be an indexed property or the primary key. If you want to sort by an un-indexed property, then use Collection.sortBy() instead.
In current version of Dexie (v3.0), it is not possible to do:
... and there is a simple reason for that: No database can do this query easily as it can only operate on one B-tree at a time. However, most databases yet supports, but involving set matching of primary keys and a full index scans on the ordered query.
Even though current version of Dexie (v3.0) does not have orderBy() on Collections, the feature may be introduced in a future version, and can already be accomplished without using sortBy() - see .
See the sample in Table.offset().
Collection.sortBy()