design pattern to expire documents on cloudant

后端 未结 2 1202
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-18 15:54

So when a document is deleted, the metadata is actually preserved forever. For a hosted service like cloudant, where storage costs every month, I instead would like to compl

2条回答
  •  终归单人心
    2021-01-18 16:43

    Deleted documents are kept for ever in couchdb. Even after compaction .Though the size of document is pretty small as it contains only three fields

    {_id:234wer,_rev:123,deleted:true}

    The reason for this is to make sure that all the replicated databases are consistent. If a document that is replicated on several databases is deleted from one location there is no way to tell it to other replicated stores.

    There is _purge but as explained in the wiki it is only to be used in special cases.

提交回复
热议问题