evaluateJSONataExpression need a msg... I don't understand why msg is needed, and i haven't.
The code above won't works... somebody can explai me how to use evaluateJSONataExpression without msg or if they are a function on node object for create msg ?
There are two parts here - prepareJSONataExpression and then evaluateJSONataExpression.
The prepare step takes two arguments:
the JSONata expression (as a string)
the node evaluating the expression. This is needed so if the $flowContext/$globalContext functions are used, it knows what node to use to access context.
The evaluate step is where the expression is actually run. It takes two arguments:
the prepared expression (as returned by prepareJSONataExpression)
the object to evaluate the expression against - usually a message, but it can be whatever object you want the expression to evaluate against.
In your case, what sort of expression does node.ignoredFiles contain? It's hard to say what you should use as the second arg to evaluate without knowing what sort of expression you want the user to provide.
evaluateJSONataExpression check every properties of msg ?
My Jsonata expr
`$not($contains(file, /(.*)\.(jpe?g)$/))`
The goal it's to exclude filename on pattern. The input accept regex of course, but since my input need return true or false (i.e. don't treat this new file cause name doesn't satisfy the jsonata expr or the regex) i want use jsonata too