Hi everyone,I want to subtract 7 days from "ctx.execution_time" and transform it to a string, so my "transform" is as this:
"transform": {
"script": {
"inline": "ctx.metadata.t1 = ctx.execution_time.minusDays(7).toString('yyyy-MM-dd HH:mm:ss.SSS')",
"lang": "painless"
}
}
when i run the watch, it gives me the error:
"transform": {
"type": "script",
"status": "failure",
"reason": "ScriptException[runtime error]; nested: IllegalArgumentException[Unable to find dynamic method [minusDays] with [1] arguments for class [org.joda.time.DateTime].]; "
}
but I check joda API with Java, the "minusDays" method exists in DateTime class. So, how should i write the transform? Thanks.