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/extractFieldPath.md
extractFieldPath
ts
function extractFieldPath(expr): FieldPath | null;Defined in: packages/db/src/query/expression-helpers.ts:110
Extracts the field path from a PropRef expression. Returns null for non-ref expressions.
Parameters#
expr#
BasicExpression
The expression to extract from
Returns#
FieldPath | null
The field path array, or null
Example#
ts
const field = extractFieldPath(someExpression)
// Returns: ['product', 'category']