Add support for QuerySet.intersection() and difference()

XMLWordPrintableJSON

    • Type: New Feature
    • 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

      MongoDB doesn't have dedicated operators like it does for $unionWith, but it may be possible to emulate these operations. Emanuel says, "I think difference could be handled with a $lookup for the inner query (a similar flow to unionWith) followed by a $match." 

      Set DatabaseFeatures.supports_select_difference and supports_select_intersection = True to run Django's tests in tests/queries/test_qs_combinators.py.

            Assignee:
            Unassigned
            Reporter:
            Tim Graham
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: