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

Support additional queries with $type=number partial indexes

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.1.7
    • Component/s: Index Maintenance, Querying
    • Labels:
      None
    • Query Optimization

      As of 3.1.7, a partialFilterExpression of {field: {$type: 'number'}} only supports the following queries:

      {field: {$type: 'number'}}
      {field: {$type: 'number'}, anotherField: ...}
      

      An improvement could be made to answer the following class of queries:

      // Comparison operations involving numbers
      {field: 10}
      {field: {$lt: 20}}
      {field: {$in: [30, 40, 50]}}
      // $type queries for double, int, and long.
      {field: {$type: 'int'}}
      {field: {$type: 1}}
      

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: