queryItems()function
queryItems(items: Iterable<T>, query: Query<T>): Iterable<T>
| Param | Type | |
|---|---|---|
items | Iterable<T> | The iterable of data items to query. required |
query | Query<T> | The query to apply (filters, sort order, and limit). required |
| Return | |
|---|---|
Iterable<T> | Iterable of items matching the query, in sorted and limited order. |
Query a set of data items using a query.
- Filters, then sorts, then limits the items according to the query.
Examples
Array.from(queryItems(items, { name: "Alice", $limit: 1 })) // matching items