Curries a function to match documents (standard objects) against a set of criteria.