This module implements
the QueryAdapter
interface to use the JSON Query query language
as part of JM2MP projection documents.
This module only supports @jsonquerylang/jsonquery 4.x version.
The JSON Query query language supports two syntaxes:
- String: textual representation with specific syntax for built-in functions composition.
- Array: structured list of JSON values composing function calls used as query.
This JSONQuery's
QueryAdapter
accepts both syntaxes in $path to navigate/locate any JSON value
from source documents.
By compliance with JM2MP, the
QueryAdapter
created by
createJsonQueryAdapter
maintains the expected behaviour:
undefined: returnsnull(absorption).- Any runtime error found: raises
EvaluationError
wrapping the original
cause. nullinput: returnsnullwithout running JSONQuery library.
Source
Methods
static
createJsonQueryAdapter() → {Promise.<module:jm2mp/adapters/registry.QueryAdapter>}
It creates a new QueryAdapter dynamically loading @jsonquerylang/jsonquery version 4.x.
Returns
-
Promise.<module:jm2mp/adapters/registry.QueryAdapter>