Fossmo
Fossmo

Reputation: 2892

How to delete document from CouchDB using CouchPotato?

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?

Upvotes: 1

Views: 1028

Answers (1)

Alex Lang
Alex Lang

Reputation: 1308

CouchPotato.database.destroy <my_model_instance>

Upvotes: 3

Related Questions