Update mongodb

This commit is contained in:
sunkaixuan 2025-06-22 20:27:13 +08:00
parent f4e51d8ff1
commit 1e58a08fd9

View File

@ -25,6 +25,9 @@ namespace MongoDbTest
if (db.Queryable<Student>().Count() != 3) Cases.ThrowUnitError();
var list=db.Queryable<Student>().ToList();
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();
var list2=db.Queryable<Student>().Where(it => it.Name == null).ToList();
if(list2.Count!=1||list.First().Name!=null) Cases.ThrowUnitError();
}
[SqlSugar.SugarTable("UnitStudent1ddsfhssds3z1")]
public class Student : MongoDbBase