mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-24 04:53:45 +08:00
Update mongodb
This commit is contained in:
@@ -15,6 +15,7 @@ namespace MongoDb.Ado.data
|
|||||||
var doc = BsonDocument.Parse(json);
|
var doc = BsonDocument.Parse(json);
|
||||||
collection.InsertOne(doc);
|
collection.InsertOne(doc);
|
||||||
var objectId = doc["_id"].AsObjectId.ToString();
|
var objectId = doc["_id"].AsObjectId.ToString();
|
||||||
|
context.ids = new string[] { objectId };
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -17,6 +17,8 @@ namespace MongoDb.Ado.data
|
|||||||
{
|
{
|
||||||
var doc = BsonDocument.Parse(json);
|
var doc = BsonDocument.Parse(json);
|
||||||
await collection.InsertOneAsync(doc,null,token);
|
await collection.InsertOneAsync(doc,null,token);
|
||||||
|
var objectId = doc["_id"].AsObjectId.ToString();
|
||||||
|
context.ids = new string[] { objectId };
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user