Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-18800

Expand support for $in queries to be answered by partial index

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.5
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Fully Compatible

      A partial index with a filter {a: {$gt: 5}} should be able to answer the following queries

      {a: {$in: [5.1, 6]}}
      {a: {$in: [7, 8, 9]}}
      

      but not

      {a: {$in: [5]}}
      {a: {$in: [3, 4.9]}}
      {a: {$in: [null]}}
      

      because each element in the $in array is greater than the value of the ComparisonMatchExpression. This applies to partial index filters involving $eq, $gt, $gte, $lt, and $lte.

            Assignee:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: