inquiry v0.1.1 Inquiry

Inquiry allows you to extract data from a nested data structure like the ones you get from parsing a JSON.

It allows you to use strings as: person.adresses.0.street to get data from the nested structures.

The nested structures supported by now are Lists and Maps with string keys, we’re working in a new version that supports atoms.

Link to this section Summary

Functions

Get the data from the specified path, returns the default or :nil

Link to this section Functions

Link to this function inquiry(data, query, default \\ nil)

Get the data from the specified path, returns the default or :nil

Examples

iex> Inquiry.inquiry(%{"hello" => ['world', "me"]}, "hello.0")
'world'

iex> Inquiry.inquiry(%{"hello" => ["zero", "one", "two", %{"yes" => true}]}, "hello.3.yes")
true