Consider the query
{$or: [{a: {$gt: 1}}, {a: {$lt: 3}}]}
with an index on field 'a'. The first branch of the $or has index bounds
(1, Infinity]
and the second branch of the $or has index bounds
[-Infinity, 3)
. Since these two branches are children of an $or, the final index bounds should be the union of these two intervals, which is
[-Infinity, Infinity]
However, the actual index bounds are
[-Infinity, Infinity)
The bug is that the upper bound should be inclusive, but instead it is exclusive.