I stip all the nulls using json_strip_nulls easily but it causes to have some empty objects on the results:
{
"id": 1,
"organization_id": 1,
"pairing_id": 1,
"location": {},
"device": {
"tracking_id": 1
},
"events": [
{}
]
}
Is there any simple way to remove the empty objects too? In here location and the empty object in events are have to be removed. You can find the complete examples with test data here in DB Fiddle.
{}and[]bynulland then strip nulls again