Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-100431

Ability to push a projection into idLookup

    • Query Integration
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Most $search and $vectorSearch pipelines involve a step to fetch the full document for subsequent use in the pipeline. We could do better to attempt to fetch only the fields necessary for the rest of the pipeline so that we can try to avoid a FETCH stage and stick to data present in indexes. For example:

      // Could use only the _id index:
      db.fts.aggregate({
        $search: { text: {path: "description", value: "example"}}
      },
      {
        $project: { _id: 1}
      })
      
      // Could use an index on fields '_id, a, b, c'.
      db.fts.aggregate({
        $search: { text: {path: "description", value: "example"}}
      },
      {
        $group: {_id: "$a", /* do something with 'b, c' */}
      })
      

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            memento@mongodb.com Memento Slack Bot
            Votes:
            5 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              None
              None
              None
              None