How to filter json document based on keys present in another object

Hello Experts.
i want to filter json object based on keys present in another object of same document.

I have one json object which hold key information.
As end result we should consider only those values which has key value matching with json object which hold key information.

group object holds key information.
i should only consider value matching with key values from group object.

Regards,
Ajay
input_doc.txt (1.2 KB)

Hi @Ajay_Chawda

Try to use the following expression and let me know if this helps you

$.entries().filter(item =>  $group.findIndex(x => x.name == item[0]) != -1 ).reduce((acc, cur) => acc.extend({[cur[0]]: cur[1]}),{})

BR
Kristijan

5 Likes

@Cele
Thank you for help.
it worked .

Regards,
Ajay

1 Like