DB Docs
API Reference
- Core API Reference
- Collection
- createCollection
- liveQueryCollectionOptions
- createLiveQueryCollection
- createOptimisticAction
- createTransaction
- Electric DB Collection
- electricCollectionOptions
- Query DB Collection
- queryCollectionOptions
- RxDB DB Collection
- rxdbCollectionOptions
- PowerSync Collection
- powerSyncCollectionOptions
- createIndexedDB
- indexedDBCollectionOptions
- React Hooks
- useLiveQuery
AI/LLM: This documentation page is available in plain markdown format at/db/latest/docs/reference/functions/toBooleanPredicate.md
toBooleanPredicate
ts
function toBooleanPredicate(result): boolean;Defined in: packages/db/src/query/compiler/evaluators.ts:85
Converts a 3-valued logic result to a boolean for use in WHERE/HAVING filters. In SQL, UNKNOWN (null) values in WHERE clauses exclude rows, matching false behavior.
Parameters#
result#
The 3-valued logic result: true, false, or null (UNKNOWN)
boolean | null
Returns#
boolean
true only if result is explicitly true, false otherwise
Truth table:
- true → true (include row)
- false → false (exclude row)
- null (UNKNOWN) → false (exclude row, matching SQL behavior)