How to use dynamic collection name in $merge

I am trying to run aggregation on one collection and transferring that result to some other collection.
Stages for group and project run correctly but having issue on $merge stage.
I would like to merge into new collection which should be dynamically created with the name as some field from resultset.
{ $merge: { into: “$CollectionName”, on: “_id”, whenMatched: “replace”, whenNotMatched: “insert” } }

  • where $CollectionName is variable (or any value from projection). it can be any string