DB Docs
API Reference
- Core API Reference
- Collection
- createCollection
- liveQueryCollectionOptions
- createLiveQueryCollection
- createOptimisticAction
- createTransaction
- Electric DB Collection
- electricCollectionOptions
- Query DB Collection
- queryCollectionOptions
- RxDB DB Collection
- rxdbCollectionOptions
- PowerSync Collection
- powerSyncCollectionOptions
- createIndexedDB
- indexedDBCollectionOptions
- React Hooks
- useLiveQuery
AI/LLM: This documentation page is available in plain markdown format at/db/latest/docs/reference/functions/getAllKeys.md
getAllKeys
ts
function getAllKeys(objectStore): Promise<IDBValidKey[]>;Defined in: packages/db/src/indexed-db-wrapper.ts:396
Retrieves all keys from an object store.
Uses the native getAllKeys() method for efficient bulk key retrieval.
Parameters#
objectStore#
IDBObjectStore
The IDBObjectStore to read keys from
Returns#
Promise<IDBValidKey[]>
A promise that resolves to an array of all keys in the store
Example#
ts
await executeTransaction(db, 'todos', 'readonly', async (tx, stores) => {
const allKeys = await getAllKeys(stores.todos)
console.log('All keys:', allKeys)
})