Update mongodb

This commit is contained in:
sunkaixuan 2025-06-10 17:48:57 +08:00
parent b41076f0b0
commit ea02771199
3 changed files with 3 additions and 3 deletions

View File

@ -15,7 +15,7 @@ namespace MongoDb.Ado.data
public async Task<int> HandleAsync(IMongoCollection<BsonDocument> collection, string json)
{
var doc = BsonDocument.Parse(json);
await collection.InsertOneAsync(doc);
await collection.InsertOneAsync(doc,null,token);
return 1;
}
}

View File

@ -16,7 +16,7 @@ namespace MongoDb.Ado.data
public async Task<int> HandleAsync(IMongoCollection<BsonDocument> collection, string json)
{
var documents = ParseJsonArray(json);
await collection.InsertManyAsync(documents);
await collection.InsertManyAsync(documents,null,token);
return documents.Count;
}

View File

@ -21,7 +21,7 @@ namespace MongoDb.Ado.data
{
var filter = doc["filter"].AsBsonDocument;
var update = doc["update"].AsBsonDocument;
var result =await collection.UpdateManyAsync(filter, update);
var result =await collection.UpdateManyAsync(filter, update,null,token);
total += (int)result.ModifiedCount;
}
return total;