As a possible solution will be to have Oplog or any similar feature.
The main underlaying idea is that mongo uses Oplog (which is a capped collection) to keep all the actions which modifies the database in order to let the replicas synchronize. The way the replicas syncs (as well as the way they recover from a possible outage) is by executing each item in the Oplog. Probably we have to identify or mark our db operations on the Oplog somehow, or maybe have a parallel Oplog for each tx.
So the idea is to either use this mechanism or replicate it.