src code

class method SpahQL.QueryRunner.evalAssertion

SpahQL.QueryRunner.evalAssertion(primaryToken, secondaryToken, comparisonOperator, rootData, scopeData, scopePath) → Boolean result
  • primaryToken (Object) – A selection query or set literal token as delivered by the query parser.
  • secondaryToken (Object) – A selection query or set literal token as delivered by the query parser. May be null.
  • comparisonOperator (String) – The comparison operator that will be used to compare the primary and secondary result sets.
  • rootData (Object) – A root data context for any selection queries that appear in the literal
  • scopeData (Object) – A scoped data context for the scope at which selection queries in the set will be evaluated.
  • scopePath (String) – An optional path indicating the scope to which this query has been restricted.

Executes an assertion query. If the secondary token is null, then the primary token will be evaluated and the assertion will be successful (returning true) if the primary resultset contains one or more “truthy” values (i.e. if it is not simply full of nulls and/or false values). If the secondary token is provided, then the two tokens will be evaluated and their result sets compared using the provided operator.