> For the complete documentation index, see [llms.txt](https://docs.medable.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.medable.com/cortex-api/expressions/transforms.md).

# Transforms

Declares transforms by name for use in policies, views, cursors, etc.

For backwards compatibility (cortex < 2.13.0), any transform not assigned a name takes on the export property of the library in which it is defined. A transform can extend require('runtime.transform').Transform or not. If it does, the transform can tweak the default limits for the each() cycle in the constructor.

```javascript
    @transform('test__expression_transform', {
        environment: 'development',
        if: { $gte: [ '$$RANDOM', 0.5] }
      })
      class TestTransform {
        result(data) {
          return 'replaced-result'
        }
        each(object, memo, { cursor }) {   
          return 'replaced-each'
        }
      }
```
