Skip to content

QueryClause

One condition of a search, which a clause function returns for the words it understands. A clause has two parts, and both are optional. narrow uses an index to reduce the rows to check, and test checks one row.

narrow?(lookup): Iterable<string, any, any> | undefined;

Gives the ids of a set of rows that includes every row that can satisfy the condition. It may include rows that do not satisfy it, because test removes them. Returning undefined means that the condition cannot narrow the rows.

Parameter Type Description
lookup QueryLookup what the clause can look up in the indexes

Iterable<string, any, any> | undefined

the ids of the rows to check, or undefined


test?(row, view): boolean;

Checks whether one row satisfies the condition.

Parameter Type Description
row RowView the row to check
view StateView the state of the library

boolean

true when the row satisfies the condition