couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Goodall <matt.good...@gmail.com>
Subject Re: Pruning a couchdb database
Date Mon, 27 Sep 2010 15:32:02 GMT
On 27 September 2010 16:26, John Logsdon <john.logsdon@netdev.co.uk> wrote:
> I need to hold, potentially, millions of call records in a couchdb cluster
> and using a management process periodically truncate the records based on
> their age. I can see how I can get the Set of matching records using a View
> but how do I delete them in the same operation? My understanding is that I
> can only GET from a View so I cant see how to do this without bringing the
> data back to the client and issuing a DELETE for each record which would be
> a real problem wrt performance.

Your view only needs to return the doc id and rev. Then you can issue
a bulk update to delete lots of docs in one go. Search for '_deleted'
in the bulk update API page,
http://wiki.apache.org/couchdb/HTTP_Bulk_Document_API.

- Matt

Mime
View raw message