jmes v0.3.0 JMES View Source

JMES implements JMESPath, a query language for JSON.

It passes the official compliance tests.

See jmespath.org.

Link to this section Summary

Functions

Evaluates a JMESPath expression against some data

Link to this section Types

Link to this section Functions

Link to this function

search(expr, data) View Source
search(ast() | expr(), any()) :: {:ok, any()} | error()

Evaluates a JMESPath expression against some data.

The expression can be a string, a charlist, or an Abstract Syntax Tree (see JMES.Parser.parse/1).

Options

  • underscore: if true, underscore identifiers in the expression (default false)

Examples

iex> JMES.search("[name, age]", %{"name" => "Alice", "age" => 28, "place" => "wonderland"})
{:ok, ["Alice", 28]}
Link to this function

search(expr, data, opts) View Source
search(ast(), any(), keyword()) :: {:ok, any()} | error()
search(expr(), any(), keyword()) :: {:ok, any()} | error()