1

I have problems finding documentation on how to delete a document from CouchDB using CouchPotato. As fare as I know I have to set the property _deleted = true. When I want to get documents that is not deleted, I have tried to add a condition to my class like this:

view :item, :key => [:userid, :date], :conditions => 'doc._deleted === nil'

But it doesn't work. Can someone point me in the right direction?

karlphillip
  • 92,053
  • 36
  • 243
  • 426
Fossmo
  • 2,862
  • 4
  • 25
  • 47
  • It looks like a document can be removed with destroy_document: @comment = Comment.new :title => 'title'; CouchPotato.database.save_document! @comment; @comment_id = @comment.id; CouchPotato.database.destroy_document @comment; – Fossmo Sep 12 '10 at 19:55

1 Answers1

3

CouchPotato.database.destroy <my_model_instance>

Alex Lang
  • 1,298
  • 11
  • 14