mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-06-28 13:34:32 +08:00
Update mongodb
This commit is contained in:
parent
b41076f0b0
commit
ea02771199
@ -15,7 +15,7 @@ namespace MongoDb.Ado.data
|
|||||||
public async Task<int> HandleAsync(IMongoCollection<BsonDocument> collection, string json)
|
public async Task<int> HandleAsync(IMongoCollection<BsonDocument> collection, string json)
|
||||||
{
|
{
|
||||||
var doc = BsonDocument.Parse(json);
|
var doc = BsonDocument.Parse(json);
|
||||||
await collection.InsertOneAsync(doc);
|
await collection.InsertOneAsync(doc,null,token);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ namespace MongoDb.Ado.data
|
|||||||
public async Task<int> HandleAsync(IMongoCollection<BsonDocument> collection, string json)
|
public async Task<int> HandleAsync(IMongoCollection<BsonDocument> collection, string json)
|
||||||
{
|
{
|
||||||
var documents = ParseJsonArray(json);
|
var documents = ParseJsonArray(json);
|
||||||
await collection.InsertManyAsync(documents);
|
await collection.InsertManyAsync(documents,null,token);
|
||||||
return documents.Count;
|
return documents.Count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ namespace MongoDb.Ado.data
|
|||||||
{
|
{
|
||||||
var filter = doc["filter"].AsBsonDocument;
|
var filter = doc["filter"].AsBsonDocument;
|
||||||
var update = doc["update"].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;
|
total += (int)result.ModifiedCount;
|
||||||
}
|
}
|
||||||
return total;
|
return total;
|
||||||
|
Loading…
Reference in New Issue
Block a user