ISSUE SUMMARY
When using $elemMatch on a compound multikey index, the result set is not always filtered correctly and may in certain edge cases return additional results that do not match the query. See the comments in this ticket for more details and an example.
USER IMPACT
Users affected by this bug may get query results that do not match the query predicate.
WORKAROUNDS
None.
RESOLUTION
The patch fixes a logical bug where $elemMatch expressions were not correctly handled. Specifically, the result set needs to be filtered to verify that the document correctly matches all predicates of the $elemMatch document.
AFFECTED VERSIONS
MongoDB version 2.6.0 is affected by this bug.
PATCHES
The patch is included in the 2.6.1 production release.