question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is new mongo 3.2 $lookup support planned?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kofrasacommented, Mar 11, 2017

Taking another look at this issue, it hit me that a collection abstraction is not necessary at all if we are willing to break a bit of MongoDB convention. The from field can refer directly to the join collection.

Example:

{
   $lookup:
     {
       from: <collection to join>, // this will be an Array
       localField: <field from the input documents>,
       foreignField: <field from the documents of the "from" collection>,
       as: <output_field> 
     }
}

In fact this is similar to what @justsml suggested above but will put the implementation of data sourcing outside of Mingo.

<strike>If a Function value is used for the from field, it will be called when the pipeline stage is reached to obtain the data to use. This is nice for a lazy effect and allows us to pass in values should we choose, which then can impact what the function will yield for the join. The latter part (params to function) is yet to be considered thoroughly.</strike>

Any comments?

0reactions
kofrasacommented, Mar 11, 2017

Added in commit 6ae65098 Currently, the from field must be an array.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support | Dell US
Get support for your Dell product with free diagnostic tests, drivers, downloads, how-to articles, videos, ... Want to look up your product?
Read more >
LOOKUP function
Use LOOKUP, one of the lookup and reference functions, when you need to look in a single row or column and find a...
Read more >
warrantylookup
Warranty Lookup. Search By Serial Number ... Register your products and services to get the most benefit and ensure timely support.
Read more >
Mail - Official Apple Support
Mail Support. iOS mail. Mac mail. iCloud mail. Mail Settings Lookup. Enter your email address below and we will verify your Mail settings....
Read more >
IT Support Lookup – ETS Knowledge Base
IT Lookup. This tool can be used to find the appropriate IT Support resource assigned to your department. Simply enter your NetID in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found