skip to Main Content

jsonb_strip_nulls equivalent in sql server

I'm using next request to get json from some json type column in POSTGRES: SELECT jsonb_strip_nulls(json_build_object( 'employee', c."info"->'employee2', 'product', c."info"->'product2' )::jsonb) as info FROM item."Item" AS c WHERE "rootId" = '40a8cb67-84f8-33b5-87dc-e1b039858d43' GROUP BY "id") ...; jsonb_strip_nulls omits unnecessary fields with…

VIEW QUESTION

Ios swift – How can I remove Escaped string from Json?

I am trying to send request to server. unable get correct format JSON . please help to resolve this error. [ "{"ProductGroupId":"994475","ProductId":"994408"}", "{"ProductGroupId":"994475","ProductId":"999737"}", "{"ProductGroupId":"994475","ProductId":"999915"}", "{"ProductGroupId":"994475","ProductId":"1194875"}" ] self.productGroupList = json.response.result.packages[0].productGroups for index in 1..<self.productGroupList[3].products.count{ self.productGroupIdList.append(self.productGroupList[3].products[index].productGroupID) self.productGroupIdList.append(self.productGroupList[3].products[index].id) let dictionary = ["ProductGroupId": self.productGroupList[3].products[index].productGroupID,…

VIEW QUESTION

Json – How to create array using values from input array and another fields from hierarchy using JOLT

I am trying to generate the JSON output based on JSON input using JOLT. Output should contain flatten array of objects for storing in db. Each object should contain following fields: rateplan = subscriptions.subscription[].products[specification=rateplan].code code = subscriptions.subscription[].options[].products[].code mandatory = subscriptions.subscription[].options[].mandatory…

VIEW QUESTION

Array key on laravel controller group by

I want to get data plan by date, then I use carbon on laravel to get it. this my query on laravel controller $data = DB::table('visit_plan') ->join('outlets', 'outlets.id', '=', 'visit_plan.id_outlet') ->select('outlets.id', 'outlets.name') ->get() ->groupBy(function($date) { return $this->attributes['date'] = Carbon::parse($date->date)->format('Y-m-d'); });…

VIEW QUESTION

Json – Remove dot inside a number

I have the following JSON type file: [{ "sid": "s-mtl-1", "MaterialNumber": "0.4440", "MaterialWNumber": "W0.4440", "tubePrice": "12"}, { "sid": "s-mtl-2", "MaterialNumber": "0.5550", "MaterialWNumber": "W0.5550", "tubePrice": "13"}, { "sid": "s-mtl-3", "MaterialNumber": "0.6660", "MaterialWNumber": "W0.6660", "tubePrice": "14"}] And I would like to remove…

VIEW QUESTION

How to replace JSON escaping characters in dbt

I have a JSON data like this: {"payload":"{"custom":{"a":{"hs.dl":"hs:\/\/categories\/Z2lkOi8vc2hvcGlmeS9NZW51SXRlbS81NDM2Nzk0NDczODI=","hs.image":"https:\/\/cms-highstreetapp.imgix.net\/denham\/2023\/08\/0657f839-0045-49b0-ba89-fbde3c74f519\/montage20230818-1-kzy7bm.jpg","hs.body":"Reworked in the colours of the season.","hs.video_720":null,"hs.thumbnail":"https:\/\/cms-highstreetapp.imgix.net\/denham\/2023\/08\/0657f839-0045-49b0-ba89-fbde3c74f519\/montage20230818-1-kzy7bm.jpg","hs.title":"Free Move Chinos","hs.video_480":null,"hs.id":"HS_STUDIO-91428"},"i":"31d443e3-1874-4deb-b475-ac10c850451d"},"aps":{"mutable-content":1,"alert":"Free Move Chinos - Reworked in the colours of the season.","category":"category","sound":"default"}}"} Currently, I am replacing escaping characters this way: REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(value, 'hs.', ''), '\"', '"'), '"{',…

VIEW QUESTION
Back To Top
Search