{"id":5460,"date":"2023-05-01T11:52:14","date_gmt":"2023-05-01T11:52:14","guid":{"rendered":"https:\/\/info.documotor.com\/?page_id=5460"},"modified":"2023-05-01T12:04:13","modified_gmt":"2023-05-01T12:04:13","slug":"list-of-built-in-functions","status":"publish","type":"page","link":"https:\/\/info.documotor.com\/?page_id=5460","title":{"rendered":"List of Built-in Functions"},"content":{"rendered":"\n<p>While there are some extensions made to the JMESPath query language in DocuMotor, a lot of functionality is documented at <a rel=\"noreferrer noopener\" href=\"http:\/\/jmespath.org\" target=\"_blank\">jmespath.org<\/a>. <\/p>\n\n\n\n<p>You can find information on each specific function by following the links below.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>JMESPath<\/strong><\/td><td><strong>Reference<\/strong><\/td><td><strong>Output<\/strong><\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#abs\">abs<\/a><\/td><td><code>number abs(number $value)<\/code><\/td><td>Returns the absolute value of the provided argument.<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#avg\">avg<\/a><\/td><td><code>number avg(array[number] $elements)<\/code><\/td><td>Returns the average of the elements in the provided array.<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#contains\">contains<\/a><\/td><td><code>boolean contains(array|string $subject, any $search)<\/code><\/td><td>Returns&nbsp;<code>true<\/code>&nbsp;if the given&nbsp;<code>$subject<\/code>&nbsp;contains the provided&nbsp;<code>$search<\/code>&nbsp;string.<br>If&nbsp;<code>$subject<\/code>&nbsp;is an array, this function returns true if one of the elements in the array is equal to the provided&nbsp;<code>$search<\/code>&nbsp;value.<br>If the provided&nbsp;<code>$subject<\/code>&nbsp;is a string, this function returns true if the string contains the provided&nbsp;<code>$search<\/code>&nbsp;argument.<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#ceil\">ceil<\/a><\/td><td><code>number ceil(number $value)<\/code><\/td><td>Returns the next highest integer value by rounding up if necessary.<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#ends_with\">ends_with<\/a><\/td><td><code>boolean ends_with(string $subject, string $prefix)<\/code><\/td><td>Returns&nbsp;<code>true<\/code>&nbsp;if the&nbsp;<code>$subject<\/code>&nbsp;ends with the&nbsp;<code>$prefix<\/code>, otherwise this function returns&nbsp;<code>false<\/code>.<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#floor\">floor<\/a><\/td><td><code>number floor(number $value)<\/code><\/td><td>Returns the next lowest integer value by rounding down if necessary.<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#join\">join<\/a><\/td><td><code>string join(string $glue, array[string] $stringsarray)<\/code><\/td><td>Returns all of the elements from the provided&nbsp;<code>$stringsarray<\/code>&nbsp;array joined together using the&nbsp;<code>$glue<\/code>&nbsp;argument as a separator between each.<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#keys\">keys<\/a><\/td><td><code>array keys(object $obj)<\/code><\/td><td>Returns an array containing the keys of the provided object. Note that because JSON hashes are inheritently unordered, the keys associated with the provided object&nbsp;<code>obj<\/code>&nbsp;are inheritently unordered. Implementations are not required to return keys in any specific order.<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#length\">length<\/a><\/td><td><code>number length(string|array|object $subject)<\/code><\/td><td>Returns the length of the given argument using the following types rules:<br>string: returns the number of code points in the string<br>array: returns the number of elements in the array<br>object: returns the number of key-value pairs in the object<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#map\">map<\/a><\/td><td><code>array[any] map(expression<strong>-&gt;<\/strong>any<strong>-&gt;<\/strong>any expr, array[any] elements)<\/code><\/td><td>Apply the&nbsp;<code>expr<\/code>&nbsp;to every element in the&nbsp;<code>elements<\/code>&nbsp;array and return the array of results. An&nbsp;<code>elements<\/code>&nbsp;of length N will produce a return array of length N.<br>Unlike a projection, (<code>[*].bar<\/code>),&nbsp;<code>map()<\/code>&nbsp;will include the result of applying the&nbsp;<code>expr<\/code>&nbsp;for every element in the&nbsp;<code>elements<\/code>&nbsp;array, even if the result if&nbsp;<code>null<\/code>.<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#max\">max<\/a><\/td><td><code>number max(array[number]|array[string] $collection)<\/code><\/td><td>Returns the highest found number in the provided array argument.<br>An empty array will produce a return value of null.<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#max_by\">max_by<\/a><\/td><td><code>max_by(array elements, expression<strong>-&gt;<\/strong>number<strong>|<\/strong>expression<strong>-&gt;<\/strong>string expr)<\/code><\/td><td>Return the maximum element in an array using the expression&nbsp;<code>expr<\/code>&nbsp;as the comparison key. The entire maximum element is returned. <\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#merge\">merge<\/a><\/td><td><code>object merge([object *argument, [, object $...]])<\/code><\/td><td>Accepts 0 or more objects as arguments, and returns a single object with subsequent objects merged. Each subsequent object\u2019s key\/value pairs are added to the preceding object. This function is used to combine multiple objects into one. You can think of this as the first object being the base object, and each subsequent argument being overrides that are applied to the base object.<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#min\">min<\/a><\/td><td><code>number min(array[number]|array[string] $collection)<\/code><\/td><td>Returns the lowest found number in the provided&nbsp;<code>$collection<\/code>&nbsp;argument.<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#min_by\">min_by<\/a><\/td><td><code>min_by(array elements, expression<strong>-&gt;<\/strong>number<strong>|<\/strong>expression<strong>-&gt;<\/strong>string expr)<\/code><\/td><td>Return the minimum element in an array using the expression&nbsp;<code>expr<\/code>&nbsp;as the comparison key. The entire maximum element is returned. <\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#not_null\">not_null<\/a><\/td><td><code>any not_null([any $argument [, any $...]])<\/code><\/td><td>Returns the first argument that does not resolve to&nbsp;<code>null<\/code>. This function accepts one or more arguments, and will evaluate them in order until a non null argument is encounted. If all arguments values resolve to&nbsp;<code>null<\/code>, then a value of&nbsp;<code>null<\/code>&nbsp;is returned.<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#reverse\">reverse<\/a><\/td><td><code>array reverse(string|array $argument)<\/code><\/td><td>Reverses the order of the&nbsp;<code>$argument<\/code>.<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#sort\">sort<\/a><\/td><td><code>array sort(array[number]|array[string] $list)<\/code><\/td><td>This function accepts an array&nbsp;<code>$list<\/code>&nbsp;argument and returns the sorted elements of the&nbsp;<code>$list<\/code>&nbsp;as an array.<br>The array must be a list of strings or numbers. Sorting strings is based on code points. Locale is not taken into account.<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#sort_by\">sort_by<\/a><\/td><td><code>sort_by(array elements, expression<strong>-&gt;<\/strong>number<strong>|<\/strong>expression<strong>-&gt;<\/strong>string expr)<\/code><\/td><td>Sort an array using an expression&nbsp;<code>expr<\/code>&nbsp;as the sort key. For each element in the array of&nbsp;<code>elements<\/code>, the&nbsp;<code>expr<\/code>&nbsp;expression is applied and the resulting value is used as the key used when sorting the&nbsp;<code>elements<\/code>.<br>If the result of evaluating the&nbsp;<code>expr<\/code>&nbsp;against the current array element results in type other than a&nbsp;<code>number<\/code>&nbsp;or a&nbsp;<code>string<\/code>, an&nbsp;<code>invalid-type<\/code>&nbsp;error will occur.<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#starts_with\">starts_with<\/a><\/td><td><code>boolean starts_with(string $subject, string $prefix)<\/code><\/td><td>Returns&nbsp;<code>true<\/code>&nbsp;if the&nbsp;<code>$subject<\/code>&nbsp;starts with the&nbsp;<code>$prefix<\/code>, otherwise this function returns&nbsp;<code>false<\/code>.<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#sum\">sum<\/a><\/td><td><code>number sum(array[number] $collection)<\/code><\/td><td>Returns the sum of the provided array argument.<br>An empty array will produce a return value of 0.<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#to_array\">to_array<\/a><\/td><td><code>array to_array(any $arg)<\/code><\/td><td>array &#8211; Returns the passed in value.<br>number\/string\/object\/boolean &#8211; Returns a one element array containing the passed in argument.<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#to_string\">to_string<\/a><\/td><td><code>string to_string(any $arg)<\/code><\/td><td>string &#8211; Returns the passed in value.<br>number\/array\/object\/boolean &#8211; The JSON encoded value of the object. The JSON encoder should emit the encoded JSON value without adding any additional new lines.<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#to_number\">to_number<\/a><\/td><td><code>number to_number(any $arg)<\/code><\/td><td>string &#8211; Returns the parsed number. Any string that conforms to the\u00a0<code>json-number<\/code>\u00a0production is supported. <br>number &#8211; Returns the passed in value.<br>array &#8211; null<br>object &#8211; null<br>boolean &#8211; null<br>null &#8211; null<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#type\">type<\/a><\/td><td><code>string type(array|object|string|number|boolean|null $subject)<\/code><\/td><td>Returns the JavaScript type of the given&nbsp;<code>$subject<\/code>&nbsp;argument as a string value.<br>The return value MUST be one of the following:<br>number<br>string<br>boolean<br>array<br>object<br>null<\/td><\/tr><tr><td><a href=\"https:\/\/jmespath.org\/specification.html#values\">values<\/a><\/td><td><code>array values(object $obj)<\/code><\/td><td>Returns the values of the provided object. Note that because JSON hashes are inheritently unordered, the values associated with the provided object&nbsp;<code>obj<\/code>&nbsp;are inheritently unordered. Implementations are not required to return values in any specific order. <\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>While there are some extensions made to the JMESPath query language in DocuMotor, a lot of functionality is documented at jmespath.org. You can find information on each specific function by following the links below. JMESPath Reference Output abs number abs(number $value) Returns the absolute value of the provided argument. avg number avg(array[number] $elements) Returns the [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"parent":2252,"menu_order":60,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/5460"}],"collection":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5460"}],"version-history":[{"count":5,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/5460\/revisions"}],"predecessor-version":[{"id":5474,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/5460\/revisions\/5474"}],"up":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/2252"}],"wp:attachment":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5460"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}