Collection.eachUniqueKey()

Syntax

collection.eachUniqueKey(callback)

Parameters

callback: Functionfunction (key, cursor) { }

Callback Parameters

key: ObjectFound key
cursor: IDBCursorThe cursor of the object being iterated.

Return Value

Promise

Remarks

When iteration finish, returned Promise will resolve with undefined, calling any Promise.then() callback.

If operation fails, returned promise will be rejected, calling any Promise.catch() callback.

Sample

db.friends.orderBy('firstName').eachUniqueKey(function (firstName) {
    // This callback will be called once for each unique firstName in DB no matter
    // if having multiple friends with same name.
});

Table of Contents