Update mongodb

This commit is contained in:
sunkaixuan
2025-07-11 17:20:42 +08:00
parent 9883aeca4e
commit ce87e40d41
18 changed files with 154 additions and 29 deletions

View File

@@ -22,8 +22,16 @@ namespace MongoDb.Ado.data
{
var filter = doc["filter"].AsBsonDocument;
var update = doc["update"].AsBsonDocument;
var result =await collection.UpdateManyAsync(filter, update,null,token);
total += (int)result.ModifiedCount;
if (context.IsAnyServerSession)
{
var result = await collection.UpdateManyAsync(context.ServerSession,filter, update, null, token);
total += (int)result.ModifiedCount;
}
else
{
var result = await collection.UpdateManyAsync(filter, update, null, token);
total += (int)result.ModifiedCount;
}
}
return total;
}