Question

I'm trying to delete all the saved documents in CouchDB with Ektorp. A document can I delete so:

public void deleteDoc(Object o) {
    db.delete(o);
}

But for all Docs? can any help?

Thanks.

Was it helpful?

Solution

If you want to delete all docs, why don't you just drop the database?

Or you can use the bulk operations in Ektorp:

List<Object> bulkDocs = ...
Sofa toBeDeleted = ...

bulkDocs.add(BulkDeleteDocument.of(toBeDeleted));

db.executeBulk(bulkDocs);

read more here: http://ektorp.org/reference_documentation.html#d100e642

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top