Skip to content

Commit

Permalink
Bug fix next page on findPageable func
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Cataldo committed Mar 4, 2024
1 parent 420b420 commit d65785d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ MongoDB Template
<!--suppress ALL -->
<img align="right" src="gopher-mongo.png" alt="">

[![Project status](https://img.shields.io/badge/version-v1.2.1-vividgreen.svg)](https://github.com/GabrielHCataldo/go-mongo-template/releases/tag/v1.2.1)
[![Project status](https://img.shields.io/badge/version-v1.2.2-vividgreen.svg)](https://github.com/GabrielHCataldo/go-mongo-template/releases/tag/v1.2.2)
[![Go Report Card](https://goreportcard.com/badge/github.com/GabrielHCataldo/go-mongo-template)](https://goreportcard.com/report/github.com/GabrielHCataldo/go-mongo-template)
[![Coverage Status](https://coveralls.io/repos/GabrielHCataldo/go-mongo-template/badge.svg?branch=main&service=github)](https://coveralls.io/github/GabrielHCataldo/go-mongo?branch=main)
[![Open Source Helpers](https://www.codetriage.com/gabrielhcataldo/go-mongo-template/badges/users.svg)](https://www.codetriage.com/gabrielhcataldo/go-mongo)
Expand Down
3 changes: 2 additions & 1 deletion mongo/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ func (t *Template) FindPageable(ctx context.Context, filter any, input PageInput
return nil, err
}
opt := option.MergeFindPageableByParams(opts)
skip := input.Page * input.PageSize
cursor, err := collection.Find(ctx, filter, &options.FindOptions{
AllowDiskUse: opt.AllowDiskUse,
AllowPartialResults: opt.AllowPartialResults,
Expand All @@ -631,7 +632,7 @@ func (t *Template) FindPageable(ctx context.Context, filter any, input PageInput
Projection: opt.Projection,
ReturnKey: opt.ReturnKey,
ShowRecordID: opt.ShowRecordID,
Skip: &input.Page,
Skip: &skip,
Sort: input.Sort,
Let: opt.Let,
})
Expand Down

0 comments on commit d65785d

Please sign in to comment.