Here's a small Postgres extension I’ve been working on: jsonb_apply.
This extension allows you to dynamically apply functions to jsonb objects, both recursively and with optional arguments.
The general signature looks like this:
select jsonb_apply(doc jsonb, func text[, variadic "any" args1_n])
You don't have to specify types for the arguments, but they'll be used in lieu of parser hints, to find the appropriate function to call.
So you can do things like this.
select jsonb_apply('{ "id": 1, "name": "John", "messages": [ "hello" ] }', 'replace', 'hello', 'bye');
{"id": 1, "name": "John", "messages": ["bye"]}
Came in handy for the couple of cases I wanted it for.
It's mostly text-oriented for now, but I'm putting it out there, just in case anyone else wants something more LISPy in Postgres.