---
title: convert
description: |
  The `convert` command is a **semantic keyword** that indicates type conversion
  is taking place. It has no effect on query execution and exists purely to make
  transformations more readable and self-documenting.

  !!! note
      The `convert` keyword is optional and does not change functionality. Use it
      when you want to make type changes explicit in your query.
url: https://coralogix.com/docs/dataprime/language-reference/commands-reference/convert/
product: dataengine
feature: DataPrime Language
feature_id: dataprime-language
feature_identifier: dataengine/dataprime-language
last_updated: '2026-10-21'
---

# `convert`

## Description

The `convert` command is a **semantic keyword** that indicates type conversion is taking place. It has no effect on query execution and exists purely to make transformations more readable and self-documenting.

Note

The `convert` keyword is optional and does not change functionality. Use it when you want to make type changes explicit in your query.

## Syntax

```
(conv|convert) [datatypes] <keypath1>:<datatype1>, <keypath2>:<datatype2>, ...
```

## Example

**Use case: Make type conversions explicit for readability**

Suppose a dataset contains values like `status_code` stored as strings. You want to treat them as numeric values for sorting or comparison. Using `convert` signals the intended type conversion for clarity.

### Example data

```
{ "status_code": "200", "path": "/home" },

{ "status_code": "404", "path": "/error" }
```

### Example query

```
convert datatypes status_code:number
```

### Example output

```
  { "status_code": 200, "path": "/home" },

  { "status_code": 404, "path": "/error" }
```

While this transformation would happen the same way without `convert`, the keyword improves readability and communicates the intent to other users or maintainers of the query.
