The Three Ways to Remove a Document From CouchDB and Their Usages
The choice depends (mostly) on how you’re syncing between databases:
- With filtered replication, you might want to add
_deleted:truealongside the original document data- For normal/plain/unfiltered replication, you can simply
DELETE- If you are NOT replicating,
_purgehas its uses
I only knew about the straightforward DELETE approach. But I’m learning that it is just a special case of marking a document as deleted. While the post looks at these operations from the point of view of CouchDB’s masterless replication, their behavior can also be connected to the school of soft deletes or Pat Helland’s non updatable data:
In large-scale systems, you don’t update data, you add new data or create a new version.
Original title and link: The Three Ways to Remove a Document From CouchDB and Their Usages (©myNoSQL)