Search…
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.
1
@transform('test__expression_transform', {
2
environment: 'development',
3
if: { $gte: [ '$RANDOM', 0.5] }
4
})
5
class TestTransform {
6
result(data) {
7
return 'replaced-result'
8
}
9
each(object, memo, { cursor }) {
10
return 'replaced-each'
11
}
12
}
Copied!
Last modified 1mo ago
Copy link