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

Batch delete based on condition #163

Open
isuhendro opened this issue Mar 7, 2017 · 1 comment
Open

Batch delete based on condition #163

isuhendro opened this issue Mar 7, 2017 · 1 comment
Labels
api: datastore Issues related to the Datastore API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@isuhendro
Copy link

isuhendro commented Mar 7, 2017

Is it possible to delete records in batch using NodeJS based on condition?
Below is sample code for batch delete, but preparing taskKey1, taskKey2... etc is not a elegant as putting condition like size > 25

const keys = [taskKey1, taskKey2];

datastore.delete(keys)
  .then(() => {
    // Tasks deleted successfully.
  });
@eddavisson
Copy link
Contributor

We currently only support delete-by-key. To delete according to a condition, you'd have to run a separate keys-only query() operation, and feed the results into delete() calls.

@kolea2 kolea2 added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Apr 7, 2021
@meredithslota meredithslota added the api: datastore Issues related to the Datastore API. label Nov 24, 2021
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: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

4 participants