I'm new at jsonpath and want to query JSON fields in my PostgreSQL database by using jsonpath.
I use this query but it doesn't work.
SELECT jsonb person '$.years' FROM people
Person is a JSON field with the following value:
{
"years": 2,
"name": "Josh"
}
I use the documentation but it is not beginner-friendly.
How can I get a specific key's value from JSON using jsonpath? I use PostgreSQL 13.