Skip to content

Commit

Permalink
chore(gae): migrate region tags from projectionqueries.go (#5108)
Browse files Browse the repository at this point in the history
  • Loading branch information
OremGLG authored Jan 30, 2025
1 parent 3702a10 commit 3d22ecd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/appengine/datastore/projectionqueries/projectionqueries.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@ type EventLog struct {
}

func example() {
// [START gae_datastore_using_1]
// [START using_1]
q := datastore.NewQuery("People").Project("FirstName", "LastName")
// [END using_1]
// [END gae_datastore_using_1]
_ = q
}

func example2() {
// [START gae_datastore_using_2]
// [START using_2]
q := datastore.NewQuery("EventLog").
Project("Title", "ReadPath", "DateWritten").
Expand All @@ -53,31 +56,38 @@ func example2() {
log.Infof(ctx, "Log record: %v, %v, %v", l.Title, l.ReadPath, l.DateWritten)
}
// [END using_2]
// [END gae_datastore_using_2]
}

func example3() {
// [START gae_grouping_grouping]
// [START grouping]
q := datastore.NewQuery("Person").
Project("LastName", "Height").Distinct().
Filter("Height >", 20).
Order("-Height").Order("LastName")
// [END grouping]
// [END gae_grouping_grouping]
_ = q

type Foo struct {
A []int
B []string
}

// [START gae_datastore_projections_and_multiple_valued_properties_1]
// [START projections_and_multiple_valued_properties_1]
entity := Foo{A: []int{1, 1, 2, 3}, B: []string{"x", "y", "x"}}
// [END projections_and_multiple_valued_properties_1]
// [END gae_datastore_projections_and_multiple_valued_properties_1]
_ = entity
}

func example4() {
// [START gae_datastore_projections_and_multiple_valued_properties_2]
// [START projections_and_multiple_valued_properties_2]
q := datastore.NewQuery("Foo").Project("A", "B").Filter("A <", 3)
// [END projections_and_multiple_valued_properties_2]
// [END gae_datastore_projections_and_multiple_valued_properties_2]
_ = q
}

0 comments on commit 3d22ecd

Please sign in to comment.