[SERVER-85586] Error if $lookup is specified with a foreign collection and an initial source in the pipeline Created: 23/Jan/24  Updated: 24/Jan/24  Resolved: 24/Jan/24

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Hana Pearlman Assignee: Backlog - Query Optimization
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Optimization
Participants:

 Description   

Aggregate commands like

 {aggregate: "foo", pipeline: [{$documents: [...]}], ...}

 fail with "'$documents' can only be run with {aggregate: 1}". However, a $lookup like

 {$lookup: {from: "foo", pipeline: [{$documents: [...]}], ...}}

 succeeds. While executing this $lookup, we will never look at the foreign collection, so it's confusing to allow it to be specified here. This ticket is to consider erroring for these $lookups, too.



 Comments   
Comment by Hana Pearlman [ 24/Jan/24 ]

Good news! I must have been wrong about this... suddenly unable to repro locally.

Generated at Thu Feb 08 06:58:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.