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/getAll.md
getAll
ts
function getAll<T>(objectStore): Promise<T[]>;Defined in: packages/db/src/indexed-db-wrapper.ts:370
Retrieves all items from an object store.
Uses the native getAll() method for efficient bulk retrieval.
Type Parameters#
T#
T
The type of items in the object store
Parameters#
objectStore#
IDBObjectStore
The IDBObjectStore to read from
Returns#
Promise<T[]>
A promise that resolves to an array of all items in the store
Example#
ts
await executeTransaction(db, 'todos', 'readonly', async (tx, stores) => {
const allTodos = await getAll<Todo>(stores.todos)
console.log('All todos:', allTodos)
})