Right now it's easy to specify a query that will scan a range on an index:
or a set of points on an index:
Using a regular expression it is also possible to specify certain combinations of ranges on an index:
This ticket represents functionality for easily specifying more than one arbitrary range on a single index, scanned efficiently by the query optimizer. For example on
Example 1 is not currently optimized to work as a single index scan because $or is only implemented to support more general cases where or clauses may use different indexes.
Example 2 is not an allowed query currently.