Forum Discussion

fajosa's avatar
fajosa
New Contributor II
4 years ago
Solved

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.

4 Replies

  • khanh_tran's avatar
    khanh_tran
    New Contributor III

    yes, sure. that’s all I want. Because every object will be not duplicated except the key-participant_survey_progress_sk. The field is also group by key, so it’s also not problem.