I was able to achieve the desired result like this:
I have sample data like this:
![]()
Then I use Group by Field snap
![]()
Then a Mapper with the following expression jsonPath($, "object[*]").map((val, index, arr) => val.extend({"Count": index == 0 ? 1 : 2})). This way you are adding a Count field to every object, if index is 0 meaning first object then add a count of 1, if index > 0 then Count will always be 2. Output:
![]()
Then you can use filter snap to filter out those records with count = 2.
Make sure you add a sort by snap before group by snap.
Edit:
Also, if you don’t need the Count field you can make it more simple with a mapper with the following expression jsonPath($, "object[*]")[0], the output will be the same as above except there is no Count field. This way you only get one object from the grouped records (meaning all other duplicates are ignored).