I need to showcase a transaction using mongoDB in PHP. In my example, I have "accounts" and "transfers". The first operation I am deducting balance from the "sender account" and attempt to send the money to "beneficiary account", but the latter cannot accept any transfers therefore, the transction should rollback i.e. the money should be returned on senders account.
I could not find any PHP specific documentation regarding transactions online and thus I do not really know how to go about it.
Thank you for your help!