Support pushdown of simple negated filters to $lookup (e.g. ~Q(field=value))

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: django
    • None
    • Python Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      We want to support pushing simple negated filters (e.g., ~Q(field=value)) into $lookup stages to improve performance. Currently we support simple filters.

      Definition of done

      • The system can push simple negated expressions like ~Q(field=value) into the $lookup.pipeline.
      • Only expressions where the negated condition refers to a field from the joined document are considered.

      Pitfalls

      • Be careful not to push negations that involve fields from the outer (parent) document, as this could lead to incorrect results.
      • Complex or nested negations must be excluded unless explicitly supported.
      • Incorrectly pushing unsupported negations could silently produce wrong query results.
      • Always ensure pushed filters behave identically to the non-pushed ones.

              Assignee:
              Unassigned
              Reporter:
              Emanuel Lupi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: