[SERVER-27517] $lookup into a pipeline Created: 27/Dec/16 Updated: 06/Dec/22 Resolved: 27/Nov/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | 3.2.8, 3.4.0 |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | tisha Kariya | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Assigned Teams: |
Query
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
I have been trying to limit lookup, i.e. limit lookup to check only first 1000 documents from joined collection, it fails. |
| Comments |
| Comment by tisha Kariya [ 08/May/19 ] | ||
|
Thanks James | ||
| Comment by James Wahlin [ 27/Nov/17 ] | ||
|
$lookup into a sub-pipeline has been implemented and will be available in our upcoming MongoDB 3.6 release. It is currently available for testing as part of our 3.6 release candidates. Given this, we will close this ticket as a duplicate of As for your additional question:
If you still have a question related to $out, please open a new ticket and provide a detailed example of what you are looking to accomplish. Thanks, | ||
| Comment by David Storch [ 27/Dec/16 ] | ||
|
This is being sent to the Query Team for triage. As my colleague kyle.suarez mentioned, you can accomplish this using read-only non-materialized views starting in MongoDB 3.4. However, adding the ability to explicitly lookup into a pipeline is an interesting feature request in its own right. Please continue to watch this ticket for updates. Best, | ||
| Comment by Kyle Suarez [ 27/Dec/16 ] | ||
|
In MongoDB 3.4+, you can create a view on the collection to look up from and apply a limit:
Not sure about earlier versions, though. |