I'm trying to add a new bool field in my JSON object throught jsonb request but it doesn't work. How should I change the request?
update source_settings
set settings = settings - 'isEnabled' ||
jsonb_build_object('isEnabled', settings->'isEnabled')
where settings ? 'isEnabled';
isEnabledkey. If you want to add it when it's not there, you would needwhere (not settings ? ...). And adding "binary" data is something completely different than "adding a boolean" valuesettings->'isEnabled'doesn't really make sense as that will at best update it with the current value?