Will transactions work with mongodb aggregation $merge?

If I am using a mongodb transaction to update two documents at the same time.One of the documents I would like to update numerous documents at the same time. And I want to use mongodb aggregation to structure the documents in a certain way. Will $merge be part of the transaction and update all docs or is there a posibility of failure?

1 Like

No the transaction will not work. According to mongodb docs db.collection.aggregate() is allowed in transaction but the $merge stage is excluded. See more here.