Creates match functions from MongoDB query objects.