intersection
Full name: taxi.stdlib.intersection
Signature
declare extension function <T> intersection(collectionA: T[], collectionB: T[]):T[]Description
Returns a new collection containing only the elements that are present in both of the provided collections.
This function identifies common elements between two collections.
// Find common tags between two products
find { productA: Product, productB: Product } as {
commonTags: intersection(productA.tags, productB.tags)
}Examples
Returns only elements present in both collections, identified by value equality.
Try it out
Schema
Query Plan
Play with this snippet by editing it here, or edit it on Taxi Playground
Result
Query failed