# toRawType

Source: https://taxilang.org/docs/language/stdlib/toRawType

**Full name:** `taxi.stdlib.toRawType`

## Signature

```taxi
declare extension function toRawType(source: Any):Any
```

## Description

Removes the semantic typing from a scalar value, returning it typed as its raw primitive.

Useful when you need to compare values by their raw content while ignoring their semantic type.

- For a scalar value: strips the semantic type, returning the underlying primitive.
- For an array of scalars: strips the semantic type from each element.

Not supported on objects or arrays of objects.

```taxi
find { order: Order } as {
   rawId: String = order.id.toRawType()
}
```

## Examples

Strips the semantic type from a typed scalar, returning the raw primitive value.

Schema:

```taxi
type OrderId inherits String
```

Query:

```taxi
given {
   orderId: OrderId = 'ORD-001'
}
find {
   rawId: String = orderId.toRawType()
}
```

Result:

```json
{
  "rawId": "ORD-001"
}
```
