-
Notifications
You must be signed in to change notification settings - Fork 326
multi update in one query jsonb postgres #412
Unanswered
MaherUnlocker
asked this question in
Q&A
-
i have object of object
i have table items with colon data
and i have json like this
{
"designation": "test"
"items": {
"0024dd81-db96-4a87-863b-e6ca9dd69d90": {
"id": 71,
"color": "#FFFFFF",
"title": "item1",
},
"0024dd81-db96-4a87-863b-e6ca9dd69d91": {
"id": 71,
"color": "#FFFFFF",
"title": "item1",
},
"0024dd81-db96-4a87-863b-e6ca9dd69d92": {
"id": 71,
"color": "#FFFFFF",
"title": "item2",
}
}
}i want to modify color and title with same data for specifed item in one query the result must be like this
{
"designation": "test"
"items": {
"0024dd81-db96-4a87-863b-e6ca9dd69d90": {
"id": 71,
"color": "#000",
"title": "updated",
},
"0024dd81-db96-4a87-863b-e6ca9dd69d91": {
"id": 71,
"color": "#000",
"title": "updated",
},
"0024dd81-db96-4a87-863b-e6ca9dd69d92": {
"id": 71,
"color": "#000",
"title": "updated",
}
}
}im blocked with this
i tryed with syntaxe and jsonset but i cant
Beta Was this translation helpful? Give feedback.
All reactions
-
👎 1
Replies: 1 comment 2 replies
-
If you could show your table definition that would be great :) Are you trying to put that json into a json/jsonb column named data?
Beta Was this translation helpful? Give feedback.
All reactions
2 replies
-
sorry for late response
i have table with uid and data column
colomn uid type uuid
data type jsonb
Beta Was this translation helpful? Give feedback.
All reactions
-
theres is any helps
Beta Was this translation helpful? Give feedback.
All reactions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment