JMESPath is a query language for JSON which is used for extracting and transforming from a JSON document. DocuMotor uses JMESPath as its primary tool for treating input JSON data which is why it is essential to get comfortable with it in order to configure a DocuMotor template.
In this section you can read about general JMESPath concepts. The structure of this section is visible as the sub-menu to the left. The structure is designed to start with the very fundamentals, and slowly add more concepts.
If this is your first encounter with JMESPath, reading all the articles from top to bottom, should serve as a good foundation before heading into the DocuMotor-specific JMESPath extensions described in the Data Transformation section.
In this section
Key/Value Pairs describes the fundamental presentation of data, and gives an example of how to join two keys: firstName
and lastName
.
Arrays and Objects explains how data can be arranged in arrays or objects.
Context Operators describes and exemplifies the use of @
, $
, Parent
and |
. These are all operators, used in data transformation to alter the current scope of data and refer to the context.
Comparison Operators lists the available comparison operators. ==
, >
and !=
for instance.
Truthy Values lists scenarios where data is considered to be “falsy”. (ie. empty strings)
List of Built-in Functions lists all the available functions that are all native to JMESPath, and thus not extensions like functions described in the Data Transformation section. Each function links externally to the official JMESPath documentation, jmespath.org.
jmespath.org
Besides the documentation you can find here on this site, on how to use DocuMotor, the query language DocuMotor’s transformation is based on, is JMESPath. This query language is documented at jmespath.org. This page provides specifications for JMESPath while also giving some tutorials on some simple transformations. However, DocuMotor has extended functionality JMESPath and in some cases altered. Therefore, it is recommended to use info.documotor.com as your primary learning source, but the tutorials from jmespath.org can be used as a supplement for training transformations or if you want to read the specification for JMESPath.