v0.0.363 wmo.extraModPipeline as func
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 3m9s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 3m9s
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
ct "gogs.mikescher.com/BlackForestBytes/goext/cursortoken"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/exerr"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/langext"
|
||||
)
|
||||
|
||||
func (c *Coll[TData]) List(ctx context.Context, filter ct.Filter, pageSize *int, inTok ct.CursorToken) ([]TData, ct.CursorToken, error) {
|
||||
@@ -50,7 +51,10 @@ func (c *Coll[TData]) List(ctx context.Context, filter ct.Filter, pageSize *int,
|
||||
}
|
||||
|
||||
pipeline = append(pipeline, paginationPipeline...)
|
||||
pipeline = append(pipeline, c.extraModPipeline...)
|
||||
|
||||
for _, ppl := range c.extraModPipeline {
|
||||
pipeline = langext.ArrConcat(pipeline, ppl(ctx))
|
||||
}
|
||||
|
||||
cursor, err := c.coll.Aggregate(ctx, pipeline)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user