-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lookup example please #150
Comments
Hi @billreynolds007, so the documentation for this library is thin as it mostly relies on the public MongoDB docs. That is deliberate but it fails for operators such as For I will try to expand on the API docs for such edge cases. |
Thank you @kofrasa. I have put together something for you to consider down the road to allow a hook to retrieve a referenced collection on the fly when only its name is provided. I adjusted .\mingo\operators\pipeline\lookup.js as shown below
Here is my proof of concept node application,
The resulting output is shown below,
This pattern could be used anywhere there is currently a collection argument. Thanks again for all the work on Mingo. It's been awhile since I look at the internals last year when I put together the collating proof of concept example. The community and I appreciate you evolving that into Mingo.
|
Thanks for the suggestion Bill. I like the design and I think it could work. I would opt for a local resolver though, so that it can be passed through the options. With that, users are free to assign different options to the global space and use as desired. Mingo switched to local options since A single function say, Thanks again for raising this up and for your continued contribution to this library. |
Hi @kofrasa. I would suggest you support both flavors of interaction:
Each has tradeoffs that the developer can decide upon to fit his or her requirements. I do like the options approach you suggested and the flexibility that offers. This would be
|
Fixed in 4.0.0 |
I have reviewed the issues related to $lookup and have not found a full example of its use. I am confused as to how to reference the secondary collection being "looked into" with the various Mingo API functions which are passed a single collection.
Any help would be greatly appreciated.
Thank you,
The text was updated successfully, but these errors were encountered: