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

@@ -16,7 +16,14 @@ namespace MongoDb.Ado.data
public async Task<int> HandleAsync(IMongoCollection<BsonDocument> collection, string json)
{
var doc = BsonDocument.Parse(json);
await collection.InsertOneAsync(doc,null,token);
if (context.IsAnyServerSession)
{
await collection.InsertOneAsync(context.ServerSession,doc, null, token);
}
else
{
await collection.InsertOneAsync(doc, null, token);
}
var objectId = doc["_id"].AsObjectId.ToString();
context.ids = new string[] { objectId };
return 1;