cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Check incoming JSON is empty or not

darshthakkar
Valued Contributor
4 REPLIES 4

darshthakkar
Valued Contributor

@bojanvelevski - creating a new thread for ease and convenience.

$group.map(o=> o.values().length ).reduce((a, b) => a + b, 0)

Thank you @alchemiz for your quick suggestion however it has been failing on my end:

image

When incoming JSONโ€ฆ starting from root? Kindly share the JSON schema

e.g.

[
 { "group": { 
      "key1": "a",
      "key2": "b",
      "other": 100
 },
 { "group": {
     }
 },
 { "group": {
      "key4": "",
      "key5": ""
     }
 }
]

$group.values().join(โ€˜โ€™).trim().length > 0