query.orNull() function
Matches a value, or no value at all.
Signature:
export function orNull(value: string | string[]): Partial<FindOptions>;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
value |
string | string[] |
Value, or values, to accept alongside |
Returns:
Partial<FindOptions>
A where fragment for one column.
Remarks
For the filter that means "these, and the rows where it is not set": the result is an OR over null and what you pass. Without it a null in a where clause compares rather than tests, and matches nothing.