Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-2170

$lookup returns only the local table and not the foreign table

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 3.3.2
    • Component/s: Native
    • Environment:
      No mongoose
      No transpiling

      Hello,

      I have a simple lookup. It's working in compass but it's missing the result from the lookup in node.

              $lookup: { 
                  from: 'Setpoints',
                  localField: 'MTYPE',
                  foreignField: 'SPNAME',
                  as: 'SETPOINTS'
              }
      

      As you can see below the result in node is missing the "SETPOINTS" field from the lookup

        {
          _id: '1.1',
          MNAME: 'C010',
          MTITLE: 'Supply',
          MTYPE: 'CONVEYOR',
          MPOWER: '11KW DOL'
        }
      

      Version info

      OS: Windows 10
      EDITOR: Visual Studio Code 1.38.1
      Node.js: v12.10.0 (installed version) | v10.11.0 (used by Visual Studio code)
      MongoDB: v4.2
      MongoDB - Node driver: v3.3.2
      

      Not sure if the problem is related to the Node driver. Any help would be greatly appreciated for solving this problem.

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            s.sierdsma@gmail.com Sander Sierdsma
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: