I am working with the Laravel framework and using MongoDB. So I need to commit and roll back the collection save, but I get the following error in response.
Server does not support sessions
Does my MongoDB installation not support sessions? If not, how can I enable sessions?
$session = DB::getMongoClient()->startSession();
$session->startTransaction();
try {
// Query
$lead = Leads::create($data);
$session->commitTransaction();
} catch (\Exception $e) {
$session->abortTransaction();
}
This is the version of Mongodb I am using mongodb-win32-x86_64-2008plus-ssl-3.4.24-3-g78e64a697a Just copied to bin and running