Skip to content

Instantly share code, notes, and snippets.

@bassemawhoob
Created January 17, 2024 14:12
Set a dynamically nested jsonb key by key type
UPDATE visual_settings
SET calendar = jsonb_set(cast(calendar as jsonb), '$.**.firstDay', '"new_value"', false)
WHERE json_typeof(jsonb_path_query_first(calendar, '$.**.firstDay')::json) = 'string'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment