-
-
Notifications
You must be signed in to change notification settings - Fork 668
Collection.uniqueKeys()
David Fahlander edited this page May 13, 2014
·
5 revisions
collection.uniqueKeys(callback)
callback: Function | function (keysArray) { } | optional |
keysArray: Array | Array of unique keys |
Retrieves an array of all unique indexes in the collection.
db.friends.orderBy('firstName').uniqueKeys(function (keysArray) {
// keysArray is now all firstNames without duplicates even if having multiple
// friends with same name.
});
// Not possible to use keys(), uniqueKeys(), eachKey() or eachUniqueKey() when
// Collection instance is based on the primary key:
db.friends.orderBy(':id').uniqueKeys() // Will fail!
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