Implement recursive filtering for collections