Description
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]
|
[-Infinity, 3)
|
[-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.