Details
-
Bug
-
Resolution: Works as Designed
-
Major - P3
-
None
-
2.11.2
-
None
-
OSX (most likely all)
Description
When we were using the version 2.10.3 we could create simple transactions, but after upgrading to the latest version the client would throw the following error when starting the transaction: 'Standalone servers do not support transaction mongo'.
I am not sure if this is an intended change or a bug.
using (var session = mongoClient.StartSession()) |
{
|
try |
{
|
session.StartTransaction();
|
|
|
if (insert) |
{
|
await collection.InsertOneAsync(family); |
session.CommitTransaction();
|
return true; |
}
|
else |
{
|
var filter = Builders<FamilyModel>.Filter.Eq(x => x.Id, family.Id); |
var result = await collection.ReplaceOneAsync(filter, family); |
session.CommitTransaction();
|
return result.ModifiedCount > 0; |
}
|
}
|
}
|