[SERVER-49870] The 'as' parameter in $lookup could be optional Created: 23/Jul/20  Updated: 06/Dec/22  Resolved: 28/Jul/20

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

Type: Improvement Priority: Minor - P4
Reporter: Mukesh Bhakta Assignee: Backlog - Query Team (Inactive)
Resolution: Won't Do Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query
Participants:

 Description   

If an 'as' param is not provided $lookup could use the foreignField as the output field. 



 Comments   
Comment by Craig Homa [ 28/Jul/20 ]

The Query team has decided not to pursue this effort. Please see asya's comments above.

Comment by Asya Kamsky [ 28/Jul/20 ]

I can see synthesizing new field name maybe from combination of from collection name and foreignField ($lookup from "product", localField "product_id", foreignField "_id" should come back as maybe as "products" or "product_id" but never "_id")

Comment by Asya Kamsky [ 28/Jul/20 ]

This seems dangerous. A common foreign field name is "_id" (looking up foreign key to another collection primary key". I don't think we want to assign it into the primary key for this collection.

Comment by Jonathan Streets (Inactive) [ 24/Jul/20 ]

hi Mukesh,
Thank you for the idea to simplify $lookup. We're assigning this ticket to the appropriate team to be evaluated against our currently planned work. Updates will be posted on this ticket as they happen.
Jon

Generated at Thu Feb 08 05:21:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.