StoreSearch

Properties

2
isStoreSearch: Boolean= truereadonly
Identifies an object as an instance of StoreSearch class, or subclass thereof.
isStoreSearch: Boolean= truereadonlystatic
Identifies an object as an instance of StoreSearch class, or subclass thereof.

Functions

6

Finds the first record for which the specified function returns true

ParameterTypeDescription
fnfunction

Comparison function, called with record as parameter

searchAllRecordsBoolean

True to ignore any applied filters when searching

Returns: Model -

Record or undefined if none found

store.find(record => record.color === 'blue');

Find occurrences of the specified value in the specified field on all locally available records in the store

ParameterTypeDescription
fieldString

The record field to search in

value*

Value to search for

distinctBoolean

True to only return distinct matches, no duplicates

searchAllRecordsBoolean

True to ignore any applied filters when searching

Returns: StoreSearchResult[] -

Array of hits, in the format { index: x, data: record }

Finds the first record for which the specified field has the specified value

ParameterTypeDescription
fieldNameString

Field name

value*

Value to find

searchAllRecordsBoolean

True to ignore any applied filters when searching

Returns: Model -

Record or undefined if none found

Searches the Store records using the passed function.

ParameterTypeDescription
fnfunction

A function that is called for each record. Return true to indicate a match

searchAllRecordsBoolean

True to ignore any applied filters when searching

Returns: Model[] -

An array of the matching Records

Returns true if the supplied function returns true for any record in the store

ParameterTypeDescription
fnfunction

A function that should return true to indicate a match

searchAllRecordsBoolean

True to ignore any applied filters when searching

Returns: Boolean -
store.some(record => record.age > 95); // true if any record has age > 95

Typedefs

1

Format returned by Store#findByField().

ParameterTypeDescription
indexNumber

Index of the record in the store

dataModel

The record