fajosa
4 years agoNew Contributor II
Remove json key value from document based on condition
Greetings!
Is there a way we can use the mapper to remove “upperlimit” key value from the document, whenever “ApprovalType”==“Greater than equal to” and ignore it if “ApprovalType”==“Between”??
Appreciate your help!!
Thanks,
F.
That won’t be a problem here, because I’m using destructuring assignment ( the three dots ) before the
$group
array...$group
, this will always work for every $group array regardless of the array size, you don’t have to get each index from the $group array, just use...$group
, this will destructure the array and will be the same as writing$group[0]... $group[n]
multiple times.