public bool MatchCriteria(ScriptRunner.SingleRun run, DocumentsOperationContext context, object document, ref BlittableJsonReaderObject transformResult)
        {
            using (var result = run.Run(context, "execute", new[] { document }))
            {
                var resultAsBool = result.BooleanValue;
                if (resultAsBool != null)
                {
                    return(resultAsBool.Value);
                }

                transformResult = result.TranslateToObject(context);
                return(transformResult != null);
            }
        }