Optimize simple aggregations using $redact followed by a $match

XMLWordPrintableJSON

    • Fully Compatible
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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 Stearn
            Reporter:
            Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: