Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

findIndexForField.md

44 lines759 Bytes

Function: findIndexForField()

function findIndexForField<TKey>(
   collection, 
   fieldPath, 
   compareOptions?): 
  | IndexInterface<TKey>
  | undefined;

Defined in: packages/db/src/utils/index-optimization.ts:37

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

| IndexInterface<TKey> | undefined