{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Adapter for Envoy
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • 日本語コミュニティ
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • BaaS/Usergrid /
avatar image
0
Question by Eric Hildum · Jul 23, 2015 at 01:06 AM · 399 Views cassandraquerydeletecollectionshow to

Deleting entities from collections with cursor

I am working on a project where I will likely have a collection containing several million entities. On occasion, I will need to delete several hundred to several thousand entities based on a query. Looking at the documentation, and experimenting with a test collection in the free development environment, it appears I should be able to delete the records in groups and receive a cursor pointing to where the next delete should start. That is, I should be able to repeatedly:

DELETE "[....]/collectionname?ql=where value=deleteme&limit=100&cursor=xxxxxxx"

The limit appears to be needed in case there are a lot of records to delete - if I have too many, the DELETE does not return a body, and I do not know if I deleted everything or not. By limiting the number deleted in a single request, I am sure to get a response with a cursor if there are more records to be deleted. The first delete call does not have a cursor of course, and all subsequent calls use the cursor returned from the previous call. In theory, the cursor should be returned until no more records exist to be deleted.

Great story, however, I am seeing inconsistencies when I tried this out in the free environment. The limit clause worked as I expected, but the cursor was not always returned even if there were records that should be deleted remaining. Is it better to keep deleting until the number of deleted entities returned is zero, or is the missing cursor a bug in the free environment? Or should I not bother with the cursor at all, and just keep deleting until the deleted entities returned is empty?

Bottom line question, how can I be sure I deleted everything I should have? I will be implementing this in a node.js script.

Comment
Add comment Show 1
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Dino ♦♦   · Apr 22, 2016 at 05:05 AM 0
Link

Maybe @jwest1 will have some input here.

Close

0 Answers

  • Sort: 

Follow this Question

Answers Answers and Comments

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Is there a way to query a collection for entities that do not contain an attribute? 2 Answers

Entity query to get all of a collection yields a different entity count than displayed on BAAS overview dashboard 1 Answer

What is the best way to update BaaS? 1 Answer

Querying data to BaaS with 'ql=' statement 1 Answer

How can i know if a property in the entity is full text indexed? 1 Answer

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2021 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Adapter for Envoy
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • 日本語コミュニティ
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges