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

Query without Limit throws exception when too many results #1249

Closed
jpdiazvaz opened this issue Apr 19, 2016 · 1 comment
Closed

Query without Limit throws exception when too many results #1249

jpdiazvaz opened this issue Apr 19, 2016 · 1 comment
Assignees
Labels
api: datastore Issues related to the Datastore API. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@jpdiazvaz
Copy link

jpdiazvaz commented Apr 19, 2016

Hi,

I'm using Datastore with gcloud 0.30.3 and when executing a simple Query to find all entities in a Kind that has 1.000 entities, it fails if the query isn't provided a Limit value:

Without Limit

{"namespace":null,"kinds":["postdatastore"],"filters":[],"orders":[],"groupByVal":[],"selectVal":[],"autoPaginateVal":true,"startVal":null,"endVal":null,"limitVal":-1,"offsetVal":-1}
Output
/Users/jpdiazvaz/Documents/github/loopback-connector-gcloud-metrics/node_modules/gcloud/lib/datastore/request.js:475
      var limit = reqOpts.query.limit.value;
                                     ^
TypeError: Cannot read property 'value' of undefined
    at onResponse (/Users/jpdiazvaz/Documents/github/loopback-connector-gcloud-metrics/node_modules/gcloud/lib/datastore/request.js:475:38)

With Limit

{"namespace":null,"kinds":["postdatastore"],"filters":[],"orders":[],"groupByVal":[],"selectVal":[],"autoPaginateVal":true,"startVal":null,"endVal":null,"limitVal":100000,"offsetVal":-1}
Output
[{"key":{"id":4503908059709440,"kind":"postdatastore","path":["postdatastore",4503908059709440]},"data":{"body":"This is the body of a test POST","title":"This is a test POST"}},...]
@callmehiphop callmehiphop added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. api: datastore Issues related to the Datastore API. labels Apr 19, 2016
@callmehiphop
Copy link
Contributor

@jpdiazvaz this should be fixed in v0.31.0, thanks again for reporting this and please let us know if you experience any more issues!

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: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants