Updater mongodb

This commit is contained in:
sunkaixuan
2025-06-28 10:52:25 +08:00
parent eb3c7f9bdd
commit 2c541944e6
2 changed files with 43 additions and 8 deletions

View File

@@ -127,6 +127,41 @@ namespace MongoDbTest
if (list6.Count != 4) Cases.ThrowUnitError(); if (list6.Count != 4) Cases.ThrowUnitError();
if (list6.Last().StudentName != "jack") Cases.ThrowUnitError(); if (list6.Last().StudentName != "jack") Cases.ThrowUnitError();
if (list6.First().StudentName != "A") Cases.ThrowUnitError(); if (list6.First().StudentName != "A") Cases.ThrowUnitError();
var list7 = db.Queryable<Student>()
.LeftJoin<School>((x, y) => x.SchoolId == y.Id)
.OrderBy((x, y) => x.Name)
.Select((x, y) => new
{
StudentName = x.Name,
SchoolName = y.Name
}).ToPageList(1,2);
if (list7.Count != 2) Cases.ThrowUnitError();
if (list7.First().StudentName != "A") Cases.ThrowUnitError();
var count = 0;
var list8 = db.Queryable<Student>()
.LeftJoin<School>((x, y) => x.SchoolId == y.Id)
.OrderBy((x, y) => x.Name)
.Select((x, y) => new
{
StudentName = x.Name,
SchoolName = y.Name
}).ToPageList(1, 2,ref count);
if(count!=4||list8.Count!=2||list8.First().StudentName!="A") Cases.ThrowUnitError();
var count2 = 0;
var list9 = db.Queryable<Student>()
.LeftJoin<School>((x, y) => x.SchoolId == y.Id)
.Where(x=>x.Name!="jack")
.OrderBy((x, y) => x.Name)
.Select((x, y) => new
{
StudentName = x.Name,
SchoolName = y.Name
}).ToPageList(1, 2, ref count2);
if (count2 != 3 || list9.Count != 2 || list9.First().StudentName != "A") Cases.ThrowUnitError();
} }
[SqlSugar.SugarTable("UnitStudent123131")] [SqlSugar.SugarTable("UnitStudent123131")]
public class Student : MongoDbBase public class Student : MongoDbBase

View File

@@ -266,10 +266,10 @@ namespace SqlSugar.MongoDb
ProcessWhereConditions(operations); ProcessWhereConditions(operations);
ProcessPagination(operations);
ProcessOrderByConditions(operations); ProcessOrderByConditions(operations);
ProcessPagination(operations);
ProcessSelectConditions(operations); ProcessSelectConditions(operations);
ProcessGroupByConditions(operations); ProcessGroupByConditions(operations);