# Function intersection
intersection(
filters
):Filter
Creates a filter representing the intersection of multiple filters on the same attribute. The resulting intersection filter filters on items that match all of the given filters.
To create 'and' filters using different attributes, use the and()
function.
# Parameters
Parameter | Type | Description |
---|---|---|
filters | Filter [] | Filters to intersect. The filters must all be on the same attribute. |
# Returns
A filter instance
# Example
Filter for countries that start with the letter 'A' and end with the letter 'A' in the Sample ECommerce data model.
filterFactory.intersection([
filterFactory.startsWith(DM.Country.Country, 'A'),
filterFactory.endsWith(DM.Country.Country, 'A'),
])