MongoDB supports matching an array object field against a single value. Moreover, it support matching a single-value field against a set of values (using $in operator).
This allows us to map certain collection .contains method invocations directly to MongoDB filter expressions.
The first patch adds mapping of contains() method invoked on a collection field into MongoDB equality expression. The second patch adds support for matching a single-value field against a constant collection of values. Please refer to individual patch for a more detailed description.
The first attached patch depends on
. The second patch depends on the first one.