Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

multi update in one query jsonb postgres #412

Unanswered
MaherUnlocker asked this question in Q&A
Discussion options

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

You must be logged in to vote

Replies: 1 comment 2 replies

Comment options

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?

You must be logged in to vote
2 replies
Comment options

sorry for late response
i have table with uid and data column
colomn uid type uuid
data type jsonb

Comment options

theres is any helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /