Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-5878

Handle indexes in $lookup stage

      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@mongodb.com Basit Chonka
            Reporter:
            basit.chonka@mongodb.com Basit Chonka
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: