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/walkExpression.md
walkExpression
ts
function walkExpression(expr, visitor): void;Defined in: packages/db/src/query/expression-helpers.ts:153
Generic expression tree walker that visits each node in the expression. Useful for implementing custom parsing logic.
Parameters#
expr#
The expression to walk
BasicExpression<any> | null | undefined
visitor#
(node) => void
Visitor function called for each node
Returns#
void
Example#
ts
walkExpression(whereExpr, (node) => {
if (node.type === 'func' && node.name === 'eq') {
console.log('Found equality comparison')
}
})