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

Optimize simple aggregations using $redact followed by a $match

    • Fully Compatible

      Current (2.5.2) implementation will not use any indexes if the first operation in the pipeline is $redact. If the pipeline starts with [$redact, $match, ...] we can in some circumstances convert the query to [$match, $redact, $match, ...] and get the same results.

      Known cases where this won't be allowed:

      • Equality matching an object-typed field.
      • Any test that filters based on the non-existance of a field (at least $nin, $ne, and probably $not)

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            mathias@mongodb.com Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: