Filter using $map operator

Hi, is there any way in order to filter in “in” $map clause?. I was found documentation etc and I didn’t find anything.

Thanks in advance

writers: {
  $map: {
    input: "$writers",
    as: "writer",
    in: {
      $arrayElemAt: [
        {
          $split: [ "$$writer", " (" ]
        },
        0
      ]
    }
  }
}

Something like this?
https://docs.mongodb.com/manual/reference/operator/aggregation/filter/

1 Like

Thx @007_jb :slight_smile: