This commit is contained in:
Mike Schwörer 2023-06-22 15:07:06 +02:00
parent 21d241f9b1
commit ac5ad640bd
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF

View File

@ -3,6 +3,7 @@ package wmo
import (
"context"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
ct "gogs.mikescher.com/BlackForestBytes/goext/cursortoken"
)
@ -11,9 +12,16 @@ func (c *Coll[TData]) List(ctx context.Context, filter ct.Filter, pageSize *int,
return make([]TData, 0), ct.End(), nil
}
pipeline := filter.FilterQuery()
pipeline := mongo.Pipeline{}
pf1 := "_id"
pd1 := ct.SortASC
pf2 := "_id"
pd2 := ct.SortASC
pf1, pd1, pf2, pd2 := filter.Pagination()
if filter != nil {
pipeline = filter.FilterQuery()
pf1, pd1, pf2, pd2 = filter.Pagination()
}
sortPrimary := pf1
sortDirPrimary := pd1