Aggregation stage not supported:lookup on multiple join conditions

1

I got the error from documentdb
Aggregation stage not supported: '$lookup on multiple join conditions and uncorrelated subquery
how to fix this do you have any solution for solving this problem?

i have 3 document to join this is lookup command

{
  from: "subscribe",
  let: {
    program_id: "$program_id"
  },
  pipeline: [
    {
      $match: {
        $expr: {
          $and: [
            {
              $eq: [
                "$program_id",
                "$$program_id"
              ]
            }
          ]
        }
      }
    },
    { "$lookup": {
        "from": "user_token",
        "let": { "user_id": "$user_id" },
        "pipeline": [
          { 
            "$match": { 
              "$expr": { 
                "$eq": [ "$user_id", "$$user_id" ] 
              }
            }
          }
        ],
        "as": "tokens"
      }
    }
    // { "$wind": "$token" }
  ],
  as: "subscribers"
}

Edited by: BECIDEV on Apr 17, 2020 1:02 AM

Edited by: BECIDEV on Apr 17, 2020 1:03 AM

BECIDEV
질문됨 4년 전1820회 조회
2개 답변
0

There's no workaround for now, the $let and $expr operators are not supported and are needed in order to achieve this extension to $lookup. As we are working backwards from customer needs, these operators may be supported in the future versions of the service.

AWS
Mihai A
답변함 2년 전
  • Does it support it now?

  • Hi! any updates for uncorrelated subqueries?

0

Same case here, any one know how to workaround?

답변함 3년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠