How good is Phoenix at benefiting from Postgres JSON capabilities for RestfulAPIs?

Postgres JSON handing is getting better day by day. How are we Elixir Phoenix developers benefiting from it?
Is there already some built-in feature of Phoenix/Ecto or there is some other library which enables developers to benefit from Postgres great JSON support, but we don’t know about it?

It’s built into ecto with embedded schemas…

maybe check this tutorial:

3 Likes

Ecto has convenient syntax for accessing JSONB fields without fragments:

https://hexdocs.pm/ecto/Ecto.Query.API.html#json_extract_path/2

from(post in Post, select: post.meta["tags"][0]["name"])
5 Likes

Thank you @outlog and @mbuhot ! :heart:

1 Like