API version: 0.3.0

---

# Expr Lang playground

The playground evaluates [Expr Lang](/reference/formats-and-languages/expr-lang.md) expressions in the browser. It runs
the same code as the API, compiled to WebAssembly: the same version of Expr Lang, the same handling of numbers and the
same functions, including the [geo functions](/reference/formats-and-languages/expr-lang/geo-functions.md). Nothing is
sent to a server.

_The interactive playground is available in the HTML version of this page._

## Input types

- **Element**: paste an element as the API returns it, e.g. the response of [`GET /<uuid>`](/api/get-element.md). The
  expression gets the variables of [schema rules](/reference/schemas/rules.md) for the creation of the element:
  `operation` (`create`), `elementType`, `document` (the data without internal properties), `previous` (empty),
  `changes`, `user` (`{"id": null}`) and `file` (`null`). Values of geo properties are GeoJSON, as in rules; request
  them with `Prefer: geometry=geojson`, which is the default.
- **Raw JSON**: a JSON object whose members are the variables, like the `parameters` of
  [search expressions](/guide/search/parameters-and-expressions.md).

JSON files can be loaded with the button or dropped onto the input. **Copy link** puts the expression and the input
into the address, so that it can be shared; the examples of the Expr pages open the playground this way.

## Differences to the API

- Evaluations are stopped after 3 seconds. Expr Lang has no loops, and its memory budget stops expressions which
  allocate too much, but nested closures over lists, e.g. `all(list, {all(list, {all(list, {true})})})` for a long
  list, can run for a long time. The API limits the runtime of expressions with
  `expression.timeoutInMilliseconds`, see [configuration](/reference/configuration.md).
- The search function `sleep` is not available, and the limit of positions per call of a geo function is the default
  of 1,000.
- The input is used as written. The API turns values of geo properties which were written as
  [WKT](/reference/formats-and-languages/geojson.md#wkt) into GeoJSON before rules see them; in the playground, a WKT
  string stays a string, and the geo functions fail on it. Write geo values as GeoJSON, or convert them in the
  expression with [`geoFromWkt`](/reference/formats-and-languages/expr-lang/geo-functions.md#geofromwkt).
- Rules see the exact numbers of the schema: properties of the type `number` are floats, also whole ones. The playground
  reads the input with the JSON parser of the browser, which does not keep the difference between `52` and `52.0`:
  whole numbers are integers, also when written as `52.0`, so e.g. `type(document.latitude)` returns `int` instead of
  `float`.

---

Home: [Ember Nexus API docs](/index.md)

Full site map: [llms.txt](/llms.txt)

Previous: [Geo functions](/reference/formats-and-languages/expr-lang/geo-functions.md)

Next: [Cypher grammar](/reference/formats-and-languages/cypher-grammar.md)
