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

Valid $lookup rejected

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Aggregation pipeline
    • Labels:
      None
    • Iteration Giraffe, Iteration Hedgehog

      The first stage in this example is incorrectly rejected:

      {
        from: "air_airlines",
        let: { maybe_name: "$airlines" },
        pipeline: [
          {
            $match: {
              $expr: {
                $gt: [
                  {
                    $size: {
                      $setIntersection: [
                        "$$maybe_name",
                        ["$name", "$alias", "$iata", "$icao"]
                      ]
                    }
                  },
                  0
                ]
              }
            }
          },
          {
            $project: {
              _id: 0,
              name_is: "$name",
              ref_name: {
                $arrayElemAt: [
                  {
                    $filter: {
                      input: "$$maybe_name",
                      cond: {
                        $in: ["$$this", ["$name", "$alias", "$iata", "$icao"]]
                      }
                    }
                  },
                  0
                ]
              }
            }
          }
        ],
        as: "found"
      }
       

            Assignee:
            irina.shestak@mongodb.com Irina Shestak (Inactive)
            Reporter:
            lucas.hrabovsky Lucas Hrabovsky (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: