Couchbase Console - Delete Document

198 views Asked by At

I need to do some cleanup work so I wrote a View in the Couchbase Console that get my data. How do I update or delete them ?

Thanks

1

There are 1 answers

0
NoSQLKnowHow On

For deletion, one of the better ways would be for each objectID from the view do the touch() method to set a random TTL for the next whatever range of time you do; hours, days, month whatever. Then Couchbase will delete the objects gracefully over time with little to no load on the cluster. This would be very fast as you are not editing the object itself, but only the metadata Couchbase keeps for that object and it'd be very very fast.

For updating of the object, the high level would be; for each objectid in the view you'd read the object, make the changes to it, then save it back to the DB.

If there is something more specific you are looking for let me know.