Skip to content

Feature request: JMESPath built-in functions #2206

Closed
@dreamorosi

Description

@dreamorosi

Use case

As part of the JMESPath utility we need to implement the logic needed to support all the built-in functions (i.e. avg, max, min, ceil, etc.) defined in the JMESPath specification.

Solution/User Experience

Customers should be able to use these functions in their expressions like:

const payload = {
  grades: [1, 5, 2, 10],
};

const maxGrade = search('max(grades)', payload); // 10
const minGrade = search('min(grades)', payload); // 1
const avgGrade = search('avg(grades)', payload); // 4.5
const roundedUpAvgGrade = search('ceil(avg(grades))', payload); // 5
const roundedDownAvgGrade = search('floor(avg(grades))', payload); // 4
// ...

All the built-in functions defined in the spec should be supported.

All types, classes, and functions should be documented and exposed to customers via API docs.

Alternative solutions

No response

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

Metadata

Metadata

Assignees

Labels

completedThis item is complete and has been merged/shippedfeature-requestThis item refers to a feature request for an existing or new utilityjmespathThis item relates to the JMESPath Utility

Type

No type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions