JSON Model-to-Model Projection (JM2MP) Documentation

JSON Model-to-Model Projection (JM2MP) Documentation

Module

jm2mp/adapters/jsonquery

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: returns null (absorption).
  • Any runtime error found: raises EvaluationError wrapping the original cause.
  • null input: returns null without running JSONQuery library.

Source

Methods