v0.0.302
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m41s
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m41s
This commit is contained in:
@@ -36,9 +36,11 @@ func (c *Coll[TData]) Paginate(ctx context.Context, filter pag.Filter, page int,
|
||||
}
|
||||
|
||||
pipelinePaginate := mongo.Pipeline{}
|
||||
pipelinePaginate = append(pipelinePaginate, bson.D{{Key: "$skip", Value: page - 1}})
|
||||
if limit != nil {
|
||||
pipelinePaginate = append(pipelinePaginate, bson.D{{Key: "$skip", Value: *limit * (page - 1)}})
|
||||
pipelinePaginate = append(pipelinePaginate, bson.D{{Key: "$limit", Value: *limit}})
|
||||
} else {
|
||||
page = 1
|
||||
}
|
||||
|
||||
pipelineCount := mongo.Pipeline{}
|
||||
|
Reference in New Issue
Block a user