Use exposed function to filter documents