Using merge in transactions

Hi,

I know we cannot use $merge in a transaction. I have tried to replace it with an update (even inside a bulkWrite) but I have a lookup aggregation (which is mandatory to compute the updated value I want to write and which is different for every document in the destination collection).

This is a perfect use case for the merge pipeline but as merge is not atomic, is there a workaround to make merge in an atomic way or to update documents with specific-lookuped-and-computed values ?

@MongoDB is it planned to allow merge in transactions in near future ?

Thank you in advance