[SERVER-22881] lookup between local (multiple)array of values and foreign (single) value Created: 26/Feb/16 Updated: 27/May/19 Resolved: 29/Mar/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | 3.3.4 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Jose Antonio Illescas Olmo | Assignee: | Charlie Swanson |
| Resolution: | Done | Votes: | 0 |
| Labels: | expression | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Major Change | ||||||||||||||||||||||||||||||||
| Sprint: | Query 11 (03/14/16), Query 12 (04/04/16) | ||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||
| Description |
|
Example Order Document:
Not Working Query:
Desired Result
|
| Comments |
| Comment by Ramon Fernandez Marina [ 18/Oct/18 ] | ||||||||||||||||||||||||||
|
ferahl, we don't reopen tickets for shipped releases – will you please open a new SERVER ticket so we can investigate the behavior you describe? Please try to include a full reproducer. Thanks, | ||||||||||||||||||||||||||
| Comment by Dominic Tobias [ 18/Oct/18 ] | ||||||||||||||||||||||||||
|
Sadly this still doesn't work. Given a document in users:
and query:
Even $unwind: $projects makes no difference, projectObjects is always null or undefined. | ||||||||||||||||||||||||||
| Comment by Xinghua Wu [ 30/Sep/16 ] | ||||||||||||||||||||||||||
|
Thank you anonymous.user, | ||||||||||||||||||||||||||
| Comment by Kelsey Schubert [ 29/Sep/16 ] | ||||||||||||||||||||||||||
|
Hi sweetwxh, Would you please open a new ticket so we can continue to investigate this behavior? When please include a repro script that generates and then queries some sample data so we can determine whether the output is expected. Or, alternatively, I would be happy to provide you with a link to a secure upload portal on the new ticket where you can upload your data files for us to investigate. Thank you, | ||||||||||||||||||||||||||
| Comment by Xinghua Wu [ 28/Sep/16 ] | ||||||||||||||||||||||||||
|
I have data like:
my mongodb version is 3.3.14。
| ||||||||||||||||||||||||||
| Comment by Charlie Swanson [ 20/Sep/16 ] | ||||||||||||||||||||||||||
|
Yes, that should still work. | ||||||||||||||||||||||||||
| Comment by Yanick Rochon [X] [ 20/Sep/16 ] | ||||||||||||||||||||||||||
|
Will this also work if the local key is from a subdocument inside an array? For example :
| ||||||||||||||||||||||||||
| Comment by Jose Antonio Illescas Olmo [ 05/Apr/16 ] | ||||||||||||||||||||||||||
|
Thank You Asya, I downloaded (nightly) mongo and this feature works for me... Great Work!! | ||||||||||||||||||||||||||
| Comment by Asya Kamsky [ 04/Apr/16 ] | ||||||||||||||||||||||||||
|
3.3.4 is not available yet, if you want to try any 3.3.4 targeted feature once it's checked in, you can download the nightly development build from download site but it will not necessarily be stable or fully tested build. | ||||||||||||||||||||||||||
| Comment by Jose Antonio Illescas Olmo [ 04/Apr/16 ] | ||||||||||||||||||||||||||
|
Can you tell me a link to download 3.3.4 (developer build) of mongodb to check this feature? Thank you | ||||||||||||||||||||||||||
| Comment by Jose Antonio Illescas Olmo [ 29/Mar/16 ] | ||||||||||||||||||||||||||
|
The order is not important for me (now) | ||||||||||||||||||||||||||
| Comment by Charlie Swanson [ 29/Mar/16 ] | ||||||||||||||||||||||||||
|
Hi joseaio, Thank you for your request, it has been implemented and pushed to master. One thing to note about your example in the description is that the results will not come back in any guaranteed order. This is a similar problem to the one described in SERVER-7528, which might also be of interest to you. It would essentially require a custom sort order, based off the order which they were presented, which is not something we support anywhere else. If the ordering is an important feature, I would suggest you open a separate ticket to track that work. | ||||||||||||||||||||||||||
| Comment by Githook User [ 29/Mar/16 ] | ||||||||||||||||||||||||||
|
Author: {u'username': u'cswanson310', u'name': u'Charlie Swanson', u'email': u'charlie.swanson@mongodb.com'}Message: If the value in 'localField' is an array, assume that it corresponds to | ||||||||||||||||||||||||||
| Comment by Jose Antonio Illescas Olmo [ 12/Mar/16 ] | ||||||||||||||||||||||||||
|
One comment I think this feature must be reversible
And return all orders that contains the product:
|