Skip to content
Please update to the latest release 0.77.2 to address Multiple CVEs.

eval

Function
Arg Description Type
func Lambda function to evaluate e.g. x=>1+1 where x will be the current scope. Lambda (required)
args An array of elements to use as args for the lambda function. If not provided we pass the scope Any

Description

Evaluate a vql lambda function on the current scope.

This allows you to use a string as a VQL function - the string will be parsed at runtime as a VQL expression and then evaluated.

You can access previously defined variables or functions within the scope.

Note that when eval calls the function, the current scope will be passed as the first parameter to the lambda.

Example

LET AddTwo(x) = x + 2

SELECT eval(func="x=>AddTwo(x=1)") AS Three FROM scope()