Skip Menu |

This queue is for tickets about the CouchDB-Client CPAN distribution.

Report information
The Basics
Id: 55273
Status: resolved
Priority: 0/
Queue: CouchDB-Client

People
Owner: medwards [...] nasba.org
Requestors: ckras [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.05
Fixed in: 0.06



Subject: Attachments can't be deleted
Currently it's not possible to delete an attachment. It would be nice if this could be done simultaneously with updating a document (data and attachments), just like when creating/updating a document and attachment.
On Fri Mar 05 19:36:47 2010, CKRAS wrote: Show quoted text
> Currently it's not possible to delete an attachment. It would be nice if > this could be done simultaneously with updating a document (data and > attachments), just like when creating/updating a document and attachment.
You can delete attachments, although there's not a dedicated delete method. Let's say that $DOC is a CouchDB::Client::Doc that has an attachment named "page.html" delete $DOC->attachments->{'page.html'}; $DOC->update; Will remove the attachment without changing anything else about the doc. I've added a test for this to the test suite since it currently doesn't test that. http://github.com/maverick/couchdb-client/blob/master/t/15-client.t look around line 222 for an example. I'll probably add a delete method in the next release just for completeness.
On Sun 07 Mar 2010 17:25:41, MAVERICK wrote: Show quoted text
> On Fri Mar 05 19:36:47 2010, CKRAS wrote:
> > Currently it's not possible to delete an attachment. It would be nice if > > this could be done simultaneously with updating a document (data and > > attachments), just like when creating/updating a document and
attachment. Show quoted text
> > You can delete attachments, although there's not a dedicated delete > method. Let's say that $DOC is a CouchDB::Client::Doc that has an > attachment named "page.html" > > delete $DOC->attachments->{'page.html'}; > $DOC->update; > > Will remove the attachment without changing anything else about the doc. > I've added a test for this to the test suite since it currently doesn't > test that. > > http://github.com/maverick/couchdb-client/blob/master/t/15-client.t > look around line 222 for an example. > > I'll probably add a delete method in the next release just for
completeness. OK Thanks. I tried to undef the attachment but didn't think of delete(). I guess my perl has gotten rusty :-(.
Added dedicated deleteAttachment() method