Skip to content

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.