Bulk delete

Dear friends,
I have a document where I refresh data at various times. Basically I want to delete all the contents of a file and then add data into it.

To accomplish this, I have to get a list of all nodes in the document and then though the API issue a delete command for each node.

I tried deleting the ‘root’ node, hoping it would delete all children, but that didn’t work.

Is there another approach to a bulk delete (so one command, as opposed to many delete action steps in the API)

Thanks,
Chris

You can’t delete root, but you can delete each child item of root (instead of every node) and it will delete everything.

@Shida thank you for quick response. Yes this is what I found. Just looking for ways to cut api calls (request call limits :-))

You can issue all the delete in a single call, no?

Yes I do it in a single call after retrieving the doc. But I am assuming that each action (Delete or insert) goes against the api request limits, even though its done in one call.

Ah I see what you mean. Sorry we don’t have a way right now - hopefully there isn’t many items in your root level (the burst capacity is 500).

If I understand this burst capacity basically means a max of 500 changes in a minute time frame?

This is very much enough.

I have one scenario where I might have to write code to handle for large change operations. I want to sync some small databases as references (probably not more than 400 to 600 inserts max, but if I have to remove what was written, then I will exceed 500).

Do I understand this right?

500 top-level nodes shouldn’t be that common. If you delete a top level item, all child items are removed and it counts as 1 operation.