MongoError when uploading excel on Laravel platform

I have been having this error on Laravel 11 when I try to upload an Excel document where my database is a MongoDB instance:

Transaction numbers are only allowed on a replica set member or mongos

Steps to reproduce

  1. I installed Laravel 11
composer create-project laravel/laravel
  1. I added Laravel Mongodb composer package
composer require mongodb/laravel-mongodb
  1. I added the Laravel Excel composer package
composer require maatwebsite/excel:^3.1
  1. Added some User Interface to facilitate the upload of the document. I am trying to upload assets into the web platform.

  2. Created an AssetsImport document

php artisan make:import AssetsImport

The part that’s producing the error is on this file,

class AssetsImport implements ToCollection 
{
  public function collection(Collection $collection) 
  {
     foreach ($collection as $key => $row) {
        $asset = Asset::where('asset_no', $row[2])->first();
        if($asset) {
            continue;
        }
        // add the upload code
        ....
     }
  }
}

The above script is meant to check if there’s an existing Asset. If it’s there, then don’t add it (Continue with the foreach loop).

After checking this similar question, I still could not find a solution for this. Is this the correct way of implementing, and if so, how do I go about solving this error. I don’t have control over the database (there’s a Server Admin) so I cannot just add a replica set. Kindly assist.