Make eager_load report if any associated models are in distinct clusters

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Unknown
    • 9.1.0
    • Affects Version/s: None
    • Component/s: Query
    • None
    • None
    • Fully Compatible
    • Ruby Drivers
    • Not Needed
    • 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

      MONGOID-5731 added a new eager_load method for returning an association tree via a single aggregation pipeline. The results are promising for many use cases, but we neglected to consider the case where associated models might exist in different clusters.

      When eager_load is invoked, or maybe when the pipeline is built, we should inspect the associated models and ensure they all exist in the same cluster.

      It would be nice to just fall back to the includes behavior in this case, but if that is non-trivial it can be deferred to a new ticket. At the very least, we should raise an exception, though.

            Assignee:
            Jamis Buck
            Reporter:
            Jamis Buck
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: