Handle indexes in $lookup stage

XMLWordPrintableJSON

    • Needed

      In explain for aggregations, if $lookup stages uses indexes, show those indexes to the user as well. 

      Reference: Slack

      Pipeline:

      [{
       $lookup: {
        from: 'transactions',
        localField: 'account_id',
        foreignField: 'account_id',
        as: 'result',
        pipeline: []
       }
      }]
      

      collection `transactions` has index

      {account_id:1, date: 1}

              Assignee:
              Basit Chonka
              Reporter:
              Basit Chonka
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: