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/findIndexForField.md
findIndexForField
ts
function findIndexForField<TKey>(
collection,
fieldPath,
compareOptions?): IndexReader<TKey> | undefined;Defined in: packages/db/src/utils/index-optimization.ts:45
Finds an index that matches a given field path
Type Parameters#
TKey#
TKey extends string | number
Parameters#
collection#
CollectionLike<any, TKey>
fieldPath#
string[]
compareOptions?#
CompareOptions
Returns#
IndexReader<TKey> | undefined