View Source Nested.QueryParser (Nestex v0.2.0)

Simple parser for converting query strings into path lists.

Summary

Functions

Parse a query string into a path list.

Functions

Link to this function

parse(query_string, key_type \\ :atom)

View Source
@spec parse(String.t(), :atom | :string) :: list()

Parse a query string into a path list.

Examples

parse("users.0.name")              #=> [:users, 0, :name]
parse("users[name=Alice].age")     #=> [:users, %{name: "Alice"}, :age]
parse("users[*].name")             #=> [:users, "*", :name]