Hi HN,<p>Here's a small Postgres extension I’ve been working on: jsonb_apply.<p>This extension allows you to dynamically apply functions to jsonb objects, both recursively and with optional arguments.<p>The general signature looks like this:<p>select jsonb_apply(doc jsonb, func text[, variadic "any" args1_n])<p>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.<p>So you can do things like this.<p>select jsonb_apply('{
"id": 1,
"name": "John",
"messages": [
"hello"
]
}', 'replace', 'hello', 'bye');<p>{"id": 1, "name": "John", "messages": ["bye"]}<p>Came in handy for the couple of cases I wanted it for.<p>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.