I need to use transactions on mongodb in laravel-5.8. I am using jenssegers-laravel-mongodb and use like below snippet in my code but it does not rollback when one of queries failed.
$session = MongoDB::startSession();
$session->startTransaction();
try {
Player::document()->update($updates, ['session' => $session]);
$session->commitTransaction();
return true;
} catch (\Exception $e) {
$session->abortTransaction();
return false;
}
As I found out, this package does not support transactions. I desperately need to support transactions in my code. Could you advise me what to do?