Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firestore: add LimitToLast samples #1599

Merged
merged 21 commits into from
Jul 30, 2020
Merged
9 changes: 9 additions & 0 deletions firestore/firestore_snippets/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,15 @@ func createOrderByNameLimitQuery(client *firestore.Client) {
_ = query
}

func createOrderByNameLimitToLastQuery(client *firestore.Client) {
cities := client.Collection("cities")
// [START fs_order_by_name_limit_to_last_query]
query := cities.OrderBy("name", firestore.Asc).LimitToLast(3)
// [END fs_order_by_name_limit_to_last_query]

_ = query
}

func createOrderByNameDescLimitQuery(client *firestore.Client) {
cities := client.Collection("cities")
// [START fs_order_by_name_desc_limit_query]
Expand Down