Skip to content

Commit

Permalink
docstore/mongodocstore: add Offset method implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
bartventer committed Feb 26, 2024
1 parent 63f5f38 commit ce7cb1b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docstore/mongodocstore/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ func (c *collection) RunGetQuery(ctx context.Context, q *driver.Query) (driver.D
if len(q.FieldPaths) > 0 {
opts.Projection = c.projectionDoc(q.FieldPaths)
}
if q.Offset > 0 {
offset := int64(q.Offset)
opts.Skip = &offset
}
if q.Limit > 0 {
lim := int64(q.Limit)
opts.Limit = &lim
Expand Down

0 comments on commit ce7cb1b

Please sign in to comment.