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

Unable to query on two indexed fields with 1 being date [Datastore] #2660

Closed
DaveyEdwards opened this issue Oct 8, 2017 · 1 comment
Closed
Assignees
Labels
api: datastore Issues related to the Datastore API. type: question Request for information or clarification. Not an issue.

Comments

@DaveyEdwards
Copy link

DaveyEdwards commented Oct 8, 2017

Environment details

  • OS: Windows 10
  • Node.js version: 6.11.2
  • npm version: 3.10.10
  • google-cloud/datastore: "^1.1.0",

I am unable to pass in multiple query filters if one of them is checking for a date. It gives the error Your Datastore does not have the composite index (developer-supplied) required for this query. It also produces this result if I try to sort based on the date.

In the indexes tab inside Google Cloud console there is nothing. Any information I try to find about this it talks about having your index composites inside index.yaml. With google-cloud-node I do not have this yaml file, and don't think I need it? If I do where would I need to connect it.

Query filter by date + _id (both indexed) not working
image

Querying date alone works
image

Querying matched _id works
image

Multiple query filters do work
image

@DaveyEdwards DaveyEdwards changed the title Unable to query on two indexed fields with 1 being date - Your Datastore does not have the composite index (developer-supplied) required for this query. Unable to query on two indexed fields with 1 being date [Datastore] Oct 8, 2017
@stephenplusplus
Copy link
Contributor

stephenplusplus commented Oct 10, 2017

Related: #369

Check out the Index docs! They will do a better job than I can explaining what a file looks like, when/why you need it, and how to use the gcloud sdk to create them.

@stephenplusplus stephenplusplus added api: datastore Issues related to the Datastore API. type: question Request for information or clarification. Not an issue. labels Oct 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

2 participants