Skip to content

Commit

Permalink
Add fulllist to collections
Browse files Browse the repository at this point in the history
  • Loading branch information
pluja authored Mar 15, 2024
1 parent 82075fd commit 61deff4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,22 @@ type post struct {
func main() {
client := pocketbase.NewClient("http://localhost:8090")
collection := pocketbase.CollectionSet[post](client, "posts_public")

// List with pagination
response, err := collection.List(pocketbase.ParamsList{
Page: 1, Size: 10, Sort: "-created", Filters: "field~'test'",
})
if err != nil {
log.Fatal(err)
}

// FullList also available for collections:
response, err := collection.FullList(pocketbase.ParamsList{
Sort: "-created", Filters: "field~'test'",
})
if err != nil {
log.Fatal(err)
}

log.Printf("%+v", response.Items)
}
Expand Down

0 comments on commit 61deff4

Please sign in to comment.