From 1971f1396f059391543a8d056c4c3c788fbafd93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Thu, 9 Nov 2023 11:48:45 +0100 Subject: [PATCH] v0.0.311 BF --- goextVersion.go | 4 ++-- wmo/queryPaginate.go | 10 +--------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/goextVersion.go b/goextVersion.go index c818f1c..cd28de6 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.310" +const GoextVersion = "0.0.311" -const GoextVersionTimestamp = "2023-11-09T11:40:48+0100" +const GoextVersionTimestamp = "2023-11-09T11:48:45+0100" diff --git a/wmo/queryPaginate.go b/wmo/queryPaginate.go index cbb8acc..c8906a9 100644 --- a/wmo/queryPaginate.go +++ b/wmo/queryPaginate.go @@ -2,8 +2,6 @@ package wmo import ( "context" - "encoding/json" - "fmt" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "gogs.mikescher.com/BlackForestBytes/goext/exerr" @@ -42,17 +40,11 @@ func (c *Coll[TData]) Paginate(ctx context.Context, filter pag.Filter, page int, } pipelineCount := mongo.Pipeline{} - pipelinePaginate = append(pipelinePaginate, bson.D{{Key: "$count", Value: "count"}}) + pipelineCount = append(pipelineCount, bson.D{{Key: "$count", Value: "count"}}) pipelineList := langext.ArrConcat(mongo.Pipeline{}, pipelineFilter, pipelinePaginate, c.extraModPipeline) pipelineTotalCount := langext.ArrConcat(mongo.Pipeline{}, pipelineFilter, pipelineCount) - vv1, err := json.MarshalIndent(pipelineList, "", " ") - fmt.Printf("\n==============================\n%s\n==============================\n\n", string(vv1)) - - vv2, err := json.MarshalIndent(pipelineTotalCount, "", " ") - fmt.Printf("\n==============================\n%s\n==============================\n\n", string(vv2)) - cursorList, err := c.coll.Aggregate(ctx, pipelineList) if err != nil { return nil, pag.Pagination{}, exerr.Wrap(err, "mongo-aggregation failed").Any("pipeline", pipelineList).Str("collection", c.Name()).Build()