-
-
Notifications
You must be signed in to change notification settings - Fork 648
Collection.sortBy()
Same as toArray() but with manual sorting applied to the array.
collection.sortBy(keyPath)
keyPath: String | Name of a property or sub property to use for sorting. |
Items in a Collection is naturally sorted by the index or primary key that was used in the where() clause. However, if you need sorting on another property than the index, you can use this method to do so. Also, if Collection.or() has been used, the Collection is no longer sorted unless you use this method.
If callback is omitted and operation succeeds, returned Promise will resolve with the result of the operation, calling any Promise.then() callback.
If callback is specified and operation succeeds, given callback will be called and the returned Promise will resolve with the return value of given callback.
If operation fails, returned promise will reject, calling any Promise.catch() callback.
Dexie.js - minimalistic and bullet proof indexedDB library