Skip to content

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

Description

@jgeewax

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(); // ?
  });

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

api: datastoreIssues related to the Datastore API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions