mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-06-27 19:41:17 +08:00
Update mongodb
This commit is contained in:
parent
b8d1ae414d
commit
fb319f9e13
@ -18,6 +18,10 @@ namespace MongoDbTest
|
||||
var data1=db.Queryable<Student>().ToList();
|
||||
if (data1.First().Book.Count != 1) Cases.ThrowUnitError();
|
||||
if (data1.First().Book.First().Price != 21) Cases.ThrowUnitError();
|
||||
data1.First().Book.First().Price = 100;
|
||||
db.Updateable(data1).ExecuteCommand();
|
||||
var data2 = db.Queryable<Student>().ToList();
|
||||
if (data2.First().Book.First().Price != 100) Cases.ThrowUnitError();
|
||||
}
|
||||
|
||||
[SqlSugar.SugarTable("UnitStudentdfsds3zzz1")]
|
||||
|
@ -123,7 +123,7 @@ namespace SqlSugar.MongoDb
|
||||
{
|
||||
if (col.IsJson)
|
||||
{
|
||||
var bsonValue = BsonDocument.Parse(col.Value?.ToString());
|
||||
var bsonValue = UtilMethods.ParseJsonObject(col.Value?.ToString());
|
||||
setDoc[col.DbColumnName] = bsonValue;
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user