โ07-11-2021 02:45 AM
Hi Experts,
I have a requirement where I need to check โgroupโ array is empty or not. Could someone help with the JSON path expression.
Empty group array JSON looks like:
[
{
โgroupโ: [
{}
]
}
]
Non empty group array json loiks like:
[
{
โgroupโ: [
{
โIDโ: โ002โ
}
{
โIDโ: โ003โ
}
]
}
]
Thanks in Advance.
โ07-12-2021 12:23 AM
Thanks a lot Bojan. instead if using โIDโ in json path expression is there any other way to check list is empty as the object โIDโ name is a dynamic one.
โ07-12-2021 12:25 AM
Yes @Gayathry , try this:
$group.filter(x=>x.keys().length != 0).length > 0
โ07-12-2021 12:46 AM
Thank you so much. It worked.