Are change stream events generated as part of the same multi-document transaction that inserts/updates data?

Hello,

I need to know if change stream events get generated as part of the original multi-document transaction from the business application code. My understanding is not, since only committed transactions will generate change stream events. That means, only after the business transaction is committed, then change stream events get generated after the committing.

Can somebody please help to verify if my understanding is correct? It’ll be helpful to point to the MongoDB documentation on this aspect.

Thanks!

I don’t recall this is explicitly mentioned in manual, but i suppose its true.

Nobody wants to get notified on an event that may never happen. So notify-after-commit is the way to go.