Compare commits

...

2 Commits

Author SHA1 Message Date
207fd331d5 v0.0.540 handle ct=nil same as ct=Start
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m25s
2024-10-28 14:35:05 +01:00
54b0d6701d v0.0.539
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m49s
2024-10-27 02:21:35 +02:00
5 changed files with 15 additions and 2 deletions

View File

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

View File

@@ -111,6 +111,10 @@ func (c CTKeySort) Token() string {
return "tok_" + base32.StdEncoding.EncodeToString(body)
}
func (c CTKeySort) IsEnd() bool {
return c.Mode == CTMEnd
}
func (c CTKeySort) valuePrimaryObjectId() (primitive.ObjectID, bool) {
if oid, err := primitive.ObjectIDFromHex(c.ValuePrimary); err == nil {
return oid, true

View File

@@ -31,3 +31,7 @@ func (c CTPaginated) Token() string {
return "$" + strconv.Itoa(c.Page)
}
func (c CTPaginated) IsEnd() bool {
return c.Mode == CTMEnd
}

View File

@@ -1,5 +1,5 @@
package goext
const GoextVersion = "0.0.538"
const GoextVersion = "0.0.540"
const GoextVersionTimestamp = "2024-10-27T02:18:45+0200"
const GoextVersionTimestamp = "2024-10-28T14:35:05+0100"

View File

@@ -10,6 +10,10 @@ import (
)
func (c *Coll[TData]) List(ctx context.Context, filter ct.Filter, pageSize *int, inTok ct.CursorToken) ([]TData, ct.CursorToken, error) {
if inTok == nil {
inTok = ct.Start()
}
if ctks, ok := inTok.(ct.CTKeySort); ok {
d, tok, err := c.listWithKSToken(ctx, filter, pageSize, ctks)
if err != nil {