v0.0.547 allow calling ListWithCount with pageSize=0
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m55s

This commit is contained in:
2024-12-08 18:04:04 +01:00
parent d8cf255c80
commit 49375e90f0
7 changed files with 68 additions and 18 deletions

View File

@@ -11,6 +11,7 @@ import (
type CursorToken interface {
Token() string
IsStart() bool
IsEnd() bool
}

View File

@@ -115,6 +115,10 @@ func (c CTKeySort) IsEnd() bool {
return c.Mode == CTMEnd
}
func (c CTKeySort) IsStart() bool {
return c.Mode == CTMStart
}
func (c CTKeySort) valuePrimaryObjectId() (primitive.ObjectID, bool) {
if oid, err := primitive.ObjectIDFromHex(c.ValuePrimary); err == nil {
return oid, true

View File

@@ -35,3 +35,7 @@ func (c CTPaginated) Token() string {
func (c CTPaginated) IsEnd() bool {
return c.Mode == CTMEnd
}
func (c CTPaginated) IsStart() bool {
return c.Mode == CTMStart || c.Page == 1
}