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/extractValue.md
extractValue
ts
function extractValue(expr): any;Defined in: packages/db/src/query/expression-helpers.ts:130
Extracts the value from a Value expression. Returns undefined for non-value expressions.
Parameters#
expr#
BasicExpression
The expression to extract from
Returns#
any
The extracted value
Example#
ts
const val = extractValue(someExpression)
// Returns: 'electronics'