We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
According to the docs:
https://cloud.google.com/datastore/docs/concepts/queries#datastore-equal-and-inequality-range-go "Note that a query can combine equality (EQUAL) filters for different properties, along with one or more inequality filters on a single property. Thus the following is a valid query:"
query := datastore.NewQuery("Task"). Filter("Priority =", 4). Filter("Done =", false). Filter("Created >", time.Date(1990, 1, 1, 0, 0, 0, 0, time.UTC)). Filter("Created <", time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC))
However when I create the simple table in the attached screenshot the following code from the docs fails:
q := datastore.NewQuery("Task").Namespace("test"). Filter("Priority =", 4). Filter("Done =", false). Filter("Created >", time.Date(1990, 1, 1, 0, 0, 0, 0, time.UTC)). Filter("Created <", time.Date(2018, 3, 9, 0, 0, 0, 0, time.UTC)) var t []*task if _, err := datastoreClient.GetAll(ctx, q, &t); err != nil { log.Printf("Failed reading: %v", err) }
Error is:
2018/03/10 09:24:16 Failed reading: rpc error: code = FailedPrecondition desc = no matching index found. recommended index is: - kind: Task properties: - name: Done - name: Priority - name: Created
The text was updated successfully, but these errors were encountered:
I think you'll need to define an index for that query. See https://cloud.google.com/datastore/docs/concepts/indexes#index_configuration.
Sorry, something went wrong.
Thanks very much!
jba
No branches or pull requests
According to the docs:
https://cloud.google.com/datastore/docs/concepts/queries#datastore-equal-and-inequality-range-go
"Note that a query can combine equality (EQUAL) filters for different properties, along with one or more inequality filters on a single property. Thus the following is a valid query:"
However when I create the simple table in the attached screenshot the following code from the docs fails:
Error is:
The text was updated successfully, but these errors were encountered: