Type Casting¶
Fields can declare expected types for automatic value casting:
age = F("age", int)
price = F("price", float)
# Values are stored as-is but cast on access
expr = age == "42" # value stored as string
casted = expr.casted_value() # returns integer 42
Custom cast functions are also supported:
Casting applies automatically in:
- Serialization deserialization
- Evaluation
- Backend visitors (MongoDB, etc.)