Update mongodb

This commit is contained in:
sunkaixuan
2025-06-22 20:30:40 +08:00
parent 1e58a08fd9
commit 7b419221d7

View File

@@ -27,7 +27,7 @@ namespace MongoDbTest
if (list.First().Name!="11"|| list.Last().Name != "33") Cases.ThrowUnitError(); if (list.First().Name!="11"|| list.Last().Name != "33") Cases.ThrowUnitError();
db.Insertable(new Student() { Age = 1, Name = null, SchoolId = "111", CreateDateTime = DateTime.Now }).ExecuteCommand(); db.Insertable(new Student() { Age = 1, Name = null, SchoolId = "111", CreateDateTime = DateTime.Now }).ExecuteCommand();
var list2=db.Queryable<Student>().Where(it => it.Name == null).ToList(); var list2=db.Queryable<Student>().Where(it => it.Name == null).ToList();
if(list2.Count!=1||list.First().Name!=null) Cases.ThrowUnitError(); if(list2.Count!=1|| list2.First().Name!=null) Cases.ThrowUnitError();
} }
[SqlSugar.SugarTable("UnitStudent1ddsfhssds3z1")] [SqlSugar.SugarTable("UnitStudent1ddsfhssds3z1")]
public class Student : MongoDbBase public class Student : MongoDbBase