# -*- coding: utf-8 -*-
"""
@Time: 2021/7/26 16:20
@Author: zzhang <EMAIL>
@File: in_array.py
@desc:
"""
from collect.service_imp.common.filters.template_filters.base_filter import BaseFilter


class InArrayFilter(BaseFilter):

    def filter(self, value, arr, field):
        if not arr:
            return False
        for item in arr:
            if field in item and value == item[field]:
                return True
        return False
