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

Datastore.runQuery with .on('data') doesn't demonstrate how to "abort"? #1261

Closed
jgeewax opened this issue Apr 25, 2016 · 1 comment
Closed
Assignees
Labels
api: datastore Issues related to the Datastore API. type: question Request for information or clarification. Not an issue.

Comments

@jgeewax
Copy link
Contributor

jgeewax commented Apr 25, 2016

In a for-loop, I can call break; to exit. When I'm in a runQuery stream, I'm unsure how to exit early. Is there a way to document that?

Ie, it might be...

datastore.runQuery(query)
  .on('data', function(entity) {
    if (my exit criteria) this.exit(); // ?
  });
@jgeewax jgeewax added type: question Request for information or clarification. Not an issue. api: datastore Issues related to the Datastore API. labels Apr 25, 2016
@callmehiphop
Copy link
Contributor

All the streaming APIs can be exited early via this.end(). It would appear that runQuery is one of the few places we don't have that documented, I'll put together a PR with some doc updates

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

3 participants