New in version 2.6.
Takes two arrays and returns
truewhen the first array is a subset of the second, including when the first array equals the second array, and
$setIsSubsethas the following syntax:
$setIsSubset performs set operation on arrays, treating arrays as sets. If an array contains duplicate entries,
$setIsSubset ignores the duplicate entries.
$setIsSubset ignores the order of the elements.
If a set contains a nested array element,
$setIsSubset does not descend into the nested array but evaluates the array at top-level.
experiments collection with the following documents:
The following operation uses the
$setIsSubset operator to determine if the
A array is a subset of the
The operation returns the following results: