How to undo several document changes at once?


#1

As Couchbase Light does not seem to support transactions: What is the best way to “undo” a set of new document creations and changes to existing documents done to a Couchbase Light database?

My idea is to store the document ids and revisions of all documents available in the database before the changes start and in case of a “rollback” purge the newly created documents and set the updated documents back to the revisions they had before the update started.

Would that work? Or is there any better way to do this? I am a bit worried about how long the old revisions of the updated documents are kept in the Couchbase Light Database after a document has been updated.

Joerg


#2

Couchbase Lite supports transactions: See here