Delete values from JSON

From: Andreas Joseph Krogh <andreas(at)visena(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Delete values from JSON
Date: 2023-03-17 07:56:51
Message-ID: VisenaEmail.bc7.d4292f85844d033f.186ee909d72@origo01.app.internal.visena.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, in PG-14, how do I delete the keys "dunsNumber": "NaN":

{ "sessionId": "ce6fc9d0-5923-4d71-9f7e-ae60f35c45d6", "details": [ {
"keyInformation": { "dunsNumber": "NaN", "organizationType": "LIMITED_COMPANY"
} }, { "keyInformation": { "dunsNumber": "123", "organizationType":
"LIMITED_COMPANY" } } ], "nisse": 123 }

So that the result becomes:

{ "sessionId": "ce6fc9d0-5923-4d71-9f7e-ae60f35c45d6", "details": [ {
"keyInformation": { "organizationType": "LIMITED_COMPANY" } }, {
"keyInformation": { "dunsNumber": "123", "organizationType": "LIMITED_COMPANY"
} } ], "nisse": 123 }

Thanks.

--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
andreas(at)visena(dot)com <mailto:andreas(at)visena(dot)com>
www.visena.com <https://www.visena.com>
<https://www.visena.com>

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Wim Bertels 2023-03-17 10:05:18 nested xml/json to table
Previous Message jian he 2023-03-17 06:47:33 src/test/examples/testlibpq2.c where the HAVE_SYS_SELECT_H is defined.