Created
January 17, 2024 14:12
-
-
Save bassemawhoob/115823fe651799342ddfed28b48cd917 to your computer and use it in GitHub Desktop.
Set a dynamically nested jsonb key by key type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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