mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-21 02:58:05 +08:00
Update mongodb
This commit is contained in:
@@ -13,7 +13,14 @@ namespace MongoDb.Ado.data
|
||||
public int Handle(IMongoCollection<BsonDocument> collection, string json)
|
||||
{
|
||||
var doc = BsonDocument.Parse(json);
|
||||
collection.InsertOne(doc);
|
||||
if (context.IsAnyServerSession)
|
||||
{
|
||||
collection.InsertOne(context.ServerSession,doc);
|
||||
}
|
||||
else
|
||||
{
|
||||
collection.InsertOne(doc);
|
||||
}
|
||||
var objectId = doc["_id"].AsObjectId.ToString();
|
||||
context.ids = new string[] { objectId };
|
||||
return 1;
|
||||
|
Reference in New Issue
Block a user