Re: Appending new data to existing field of Json data type

From: VENKTESH GUTTEDAR <venkteshguttedar(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Subject: Re: Appending new data to existing field of Json data type
Date: 2014-10-30 17:28:13
Message-ID: CA+iwz4kw06A0LqcM_5Bvz61kBv6y_epdZpaVqocnDmRk6BHszA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks Adrian Klaver, Its really helped me to solve my problem, ya i have
example_list = jsonfield.JSONField() in models. Apologies i did not mention
that. but anyways thank again.

On Thu, Oct 30, 2014 at 8:09 PM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
wrote:

> On 10/29/2014 11:26 PM, VENKTESH GUTTEDAR wrote:
>
>> @Adrian Klaver, Thanks for this idea but still m really confused with
>> how to update the json filed in the DB. is there any way to update the
>> json field in the DB through view.?
>>
>>
> Realized I should have shown at least one concrete example so, assuming
> you are dealing with Python data structures where:
>
> id2.example_list = {"abc" : [ { "a":"b","c":"d" } ] }
>
> then
>
> id2.example_list["abc"].append({ "e":"f", "g":"h" })
>
> id2.example_list
>
> {'abc': [{'a': 'b', 'c': 'd'}, {'e': 'f', 'g': 'h'}]}
>
>
> then
>
> Regards :
>> Venktesh Guttedar.
>>
>>
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com
>

--
Regards :
Venktesh Guttedar.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G Johnston 2014-10-30 18:17:18 Re: syntax error while using pg_dump in Postgres 8.4
Previous Message David G Johnston 2014-10-30 16:52:39 Re: syntax error while using pg_dump in Postgres 8.4