-
Notifications
You must be signed in to change notification settings - Fork 595
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
Is datastore.createQuery.hasAncestor() just work alone without any other query command like order sort or select? #803
Comments
Thanks for reporting! I'm not sure in this case, but I bet @pcostell can help. |
In order to use In this particular case, your datastore-indexes.xml file should look something like:
|
Hi Pcostell, Thank you so much for quickly reply. |
HI, I try add a indexes.xml for my project, Because I use the Goole App with Node.js, so It looks hard to add a indexes.xml file to application's dataset directory. Because if you use gcloud command to push to remote. I try add the Index.xml in my local node project's directory like /war/WEB-INF/appengine-generated/datastore-indexes.xml, then push to remote. Finally it looks not working.
My question is why let us do so hard work for add a index. (SQL don't need do). I very love use Datastore and need clean up all my SQL idea. I hope it will easy to use and learn. |
@petersunquest sorry it's not super easy right now. We are working to integrate gcd into the gcloud command line tool, which will make this much nicer. In the future we also plan to make index creation available via an API, so you should get the "New Index" option in the developer console. Unlike SQL, Datastore requires that all queries scale with the size of the result set. Because of this, specific indexes are required to actually run a query. For example, if you were filtering for |
🤖 I have created a release *beep* *boop* --- ## [7.0.1](googleapis/nodejs-translate@v7.0.0...v7.0.1) (2022-08-10) ### Bug Fixes * **deps:** do not depend on protobufjs ([#802](googleapis/nodejs-translate#802)) ([e8f13e4](googleapis/nodejs-translate@e8f13e4)) * **deps:** update dependency @google-cloud/automl to v3 ([#796](googleapis/nodejs-translate#796)) ([440b1cb](googleapis/nodejs-translate@440b1cb)) * **deps:** update dependency @google-cloud/text-to-speech to v4 ([#797](googleapis/nodejs-translate#797)) ([a210e6e](googleapis/nodejs-translate@a210e6e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Hi,
I use the [email protected] & nodejs 0.12.7.
And use datastore.createQuery get some result.
Every looks great when I do a query with filter + sort + select + limit + order same time.
But I got Error 412 'Precondition Failed' when I add a hasAncestor() for any filter + sort + select + limit. Even I change order for each one when createQuery.
I used hasAncestor() whthout other filter or sort was work fine.
Is the hasAncestor() can only alone, can't use other command as sort or select or filter same time?
Or that is a bug?
I did:
var q = ds.createQuery('table')
.hasAncestor(ds.key({path:['fatherTable','fatherName']}))
.select('time')
.order('-time')
.limit(5)
The text was updated successfully, but these errors were encountered: