Am trying to filter out duplicates from a ditto aggregation and am hopeful someone can put me on the right track. In my structure am retrieving child documents indicated by a flag TV, but only want one parent document to be returned, not all the children. Currently am doing this by means of a ditto filter: &filter=`tv_flag,yes,7`
Then in the ditto template retrieve the parent document with a snippet call. This returns all the children matching the tv_flag condition, but as they all point to the same parent, creates redundant documents. So am looking for a way to filter out the duplicates. A solution would be if I could stop ditto aggregation after the first flag hit.
Anyone have a hint?
Thanks!
Thanks for that pointer, can’t use it directly, but puts me on the extenders track.
Ah, that did it, changed the distinct extender code to look for an already used parent id with modx->getParent(id,1,’id’);
Great