Dexie Logo
Documentation

Collection.eachPrimaryKey()

Since 1.4.0

Syntax

collection.eachPrimaryKey(callback)

Parameters

callback: Functionfunction (primaryKey) { }

Callback Parameters

key: string | Date | number | ArrayFound key

Return Value

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').eachPrimaryKey(function (primaryKey) {
    // This callback will be called in the firstName order and provide
    // the primary key of the object it refers to.
});

© 2014-2025 Awarica AB

Made with love for great people.

Read Terms & Conditions and Privacy Policy.