[SERVER-41922] Explain on $lookup ("let and pipeline" form) throws Created: 25/Jun/19 Updated: 07/Apr/23 Resolved: 28/Jun/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | 4.0.10 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Segey Gladskikh | Assignee: | Eric Sedor |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Steps To Reproduce: | db.getCollection("threads").explain().aggregate("'$lookup': { 'from': 'posts', 'let': { 'postsIds': '$Posts' }, 'pipeline': [ { '$match': { '$expr': { '$in': [ '$_id' '$$postsIds' ] }} } ], 'as': 'LastPosts' }") |
| Participants: |
| Description |
|
I try to get plan of my aggregation including complex lookup to figure out could it utilize index of joined collection or not. End even with simplified example (in selfdescribing repro) I get error "Expected 'pipeline' to be BSON docs (or equivalent), but got []interface {} instead." |
| Comments |
| Comment by Eric Sedor [ 28/Jun/19 ] |
|
This looks to be because the argument to aggregate is a string instead of an array. The SERVER project is for bugs and feature suggestions for the MongoDB server. As this ticket does not appear to a bug, I will now close it. If you need further assistance troubleshooting, I encourage you to ask our community by posting on the mongodb-user group or on Stack Overflow with the mongodb tag. |