bettio
I am pleased to announce an initial release ExJSONPath.
ExJsonPath is an Elixir library which allows to query maps (JSON objects) and lists (JSON arrays), using JSONPath expressions.
We decided to implement ExJSONPath while working on Astarte Flow, since we wanted to allow users to query arbitrary JSON objects from their pipelines code.
ExJsonPath allows to query deserialized JSON files [1] using expressions similar to the following:
ExJsonPath.eval(store, "$.store.book[?(@.price > 20)].title")
{:ok, ["The Lord of the Rings"]}
ExJsonPath is not tied to JSON at all, the same kind of JSONPath expression can be used on any Elixir map or list.
Right now, the only hard requirement is that keys must be strings.
Hope you’ll find this useful ![]()
Let me know if you have any request/question/feedback.
[1]:
{ "store": {
"book": [
{ "category": "reference",
"author": "Nigel Rees",
"title": "Sayings of the Century",
"price": 8.95
},
{ "category": "fiction",
"author": "J. R. R. Tolkien",
"title": "The Lord of the Rings",
"isbn": "0-395-19395-8",
"price": 22.99
}
],
"bicycle": {
"color": "red",
"price": 19.95
}
}
}
Trending in Announcing
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
Hello,
I’m sharing my plugin here in forum after some time so it has time to mature and proof yourself.
I use Claude Code daily on a pr...
New
Aloha gang,
There’s a new class of AI model out from TypeSafe. Jev is their flagship model. You can learn about it here:
...
New
I’ve recently created a small library phoenix_vite integrating the vite build tooling with phoenix.
It
provides an igniter.installer t...
New
I needed something like premailer for rails, and after searching, I decided to make an easy-to-use library to handle inline styles and co...
New
If you’ve ever had to debug a BEAM node you know it can be a painful process. Parsing raw data, or dealing with clutter often gets in the...
New
Other Trending Topics
Hey there,
I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first.
...
New
Hi everyone :waving_hand:
I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly)
AI dream has many faces, but general...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Code BEAM Europe 2026 – Call for Talks is Open!
We’re excited to announce that Code BEAM Europe 2026 is now open for talk submissions :t...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #code-sync
- #discussion
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #blog-post
- #elixirconf-us
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #security
- #elixirconf-eu
- #api
- #forms
- #performance











Showing Posts 1 to 5- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
LostKobrakai
Looks interesting. I took a quick look at the code and it seems you’re recursing the structure manually. I’m wondering if it would make sense to convert to an
Accesspattern instead, so it could be used withget_in,put_in, … all by implementing one transformation from the JSONPath format to a list ofAccessaccessors.bettio
Thanks for the feedback
I’ll try to focus on your advice as soon as I finished writing more tests. I need to write them since JSONPath is not “strongly specified” so I want to ensure a consistent (and stable) behaviour across different library releases.
gregvaughn
Is JSONPath widely used in general? I first encountered it in some other libraries as I was doing some background search before writing my first library, path_express, which more closely adheres to
Kernel.get_in/2. I’ve used xpath before and I assume some equivalent ideas. I’m on the fence on whether my library should be more or less JSON focused instead ofget_infocused. I hope your insight can help in my decisions.bettio
I know there are several software around that use it (e.g. kubectl).
The syntax is quite well known and there are tutorials, several tools (that allows users to test their expressions) and libraries in several languages.
So it was my first choice since it doesn’t require people to learn a new syntax.
I think you should focus your library to a specific use-case, my use-case was to allow people to write JSON templates and pipelines for arbitrary JSON inputs. As a side effect several kind of maps and lists are now supported by my JSONPath library.
I think I will add support to protocols and funs so I can extend my library to use-cases outside JSON.
koolquark
Hi,
Is there any support for regex matching in filter expressions ?