-
Notifications
You must be signed in to change notification settings - Fork 598
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
Ancestor query with filter on children not returning anything #1237
Comments
cc @pcostell |
@stephenplusplus Could you verify what proto gets sent in this case? |
Note I tested this manually using direct gRPC to the emulator and it seems to work fine, so I think it may be limited to gcloud-node. |
I'm trying this now and get stuck in an infinite loop. The response from the query always has |
Didn't we address this in 30.3? |
We handle Here's where our response logic starts-- anything look incorrect? |
Doesn't the logic say to create the nextQuery if |
It looks that way because of the code in that function, but when Is it possible the emulator should have returned another value in place of "MORE_RESULTS_AFTER_LIMIT"? The code is only running over and over again because the response is telling us there are more results, but they're not coming. |
Yes this is definitely the case: the emulator always returns I am working on making the emulator match production Datastore now. On Fri, Apr 15, 2016, 3:31 PM Stephen Sawchuk [email protected]
|
This is just the default behavior of our API. If there is a "nextQuery" to run, we run it automatically. All methods that act this way can be instructed not to. In the case of We've done it many ways in the past, but this is why it was defaulted. Do we need to rethink that approach for running Datastore queries, or is allowing auto-pagination to be disabled sufficient? // @jgeewax |
Sorry, but from what I understand adding autoPaginate(false) to my query should solve it for now? I have just tried adding it to my query and it still returns an empty array. |
@stephenplusplus that makes sense, I think in that case you should only return On Fri, Apr 15, 2016, 4:37 PM susanlinsfu [email protected] wrote:
|
@susanlinsfu regarding the empty result set, I'm not sure why they aren't being returned. Here's a script that I've tried: https://gist.github.com/stephenplusplus/8302ecb5892072f80db17f717a84a898. The query seems to return the results. Does that same script not work for you, or am I maybe not properly recreating your scenario? |
@stephenplusplus ahh yes it works for me now, I had a spelling mistake in the word "some stuff". And yes you are right if autopaginate is disabled it works, but if it is not there (or if limit) it will not return any data. Thanks! |
Phew, I'm glad you found the fix! I'm not sure which will be first: the gcloud emulator supporting gRPC or a new release of the gcd.sh tool matching the production Datastore API. Until then, as long as you're using either one, |
@stephenplusplus Do we have an issue tracking improper pagination? Even once the emulator has better handling of |
I thought we should still do that when |
I don't think so -- If a user actually wanted all the results, they shouldn't set a limit. As it is now, anyone who wants a specific number of results has to set both a limit and |
Where Where |
Ah ok, you can probably ignore me then. |
Sorry that the code made this more confusing than it needed to be. |
autoPaginate(false) does not exist on datastore 0.6.0. Am I doing things wrong or was this method removed ? |
I just installed the latest release of gcloud beta tools - this problem is still an issue. Why is it closed? |
+1 |
I am using gcloud-node v.0.30.3 and since it doesn't support gRPC I am using gcd-rpc for my local datastore.
Say I run this query to get all the children:
This works and returns all the entities. If I go:
Nothing is return even though it should return something. Nothing is printed in the node console.
I have noticed some strange behavior. If I add a limit clause to this query it will return an empty array ( [] is printed in the console), but without it nothing.
My index.yaml file looks like this:
indexes: - kind: Contacts ancestor: yes properties: - name: status
I am expecting with this query that all the children get returned, and then from those children only the ones with a status of 'some status' return. This is not happening.
The records do exist in the datastore, but when I filter they do not. Example of a record:
The text was updated successfully, but these errors were encountered: