-
Hi! I have one question about the I run CouchDB v2.3.1. This document has 10 revisions, each of them results of a conflict resolution.
I try the following:
And it doesn't purge anything. Do you have an idea how I could purge the old revisions, without deleting the You may ask why I want to do that. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Hey @H--o-l , thanks for asking. https://docs.couchdb.org/en/latest/api/database/misc.html#db-purge has a really good explanation of why this won't work, as you've explained it. If your revision tree has branches, you can purge the branches that aren't direct ancestors of the "winning revision." If your revision tree is a straight line, as in your example, you can't purge the preceding versions. If, after reading the link, you still have questions, let me know and I'll try and explain further. |
Beta Was this translation helpful? Give feedback.
-
Hi @wohali thanks for the really quick answer!
You are right, the documentation explains it well that it will purge only leaf revisions.
So the solution for me is the compaction. My issue is showed with the following example:
If I do the following command, the 30 revisions metadata are kept:
But If I do the following command, only the last 5 revisions metadata are kept:
The only difference is the value of Do you know if this behavior is expected, and what may explains it? |
Beta Was this translation helpful? Give feedback.
-
Hey! I find the answers I was looking for. To clean old revisions when you have resolved conflicts in your tree:You first need to purge the "losing revisions".
Then purge them:
Will have have a straight line history, and the RAM issue with PouchDB:Purge the "losing revisions" as above. Of course don't do commands above if you need the document history (conflicts could appear). Thanks @wohali for your help on the subject. Also thanks @kocolosk for your comment here in 2018, it helps me understand what to do. |
Beta Was this translation helpful? Give feedback.
-
Glad to see that |
Beta Was this translation helpful? Give feedback.
Hey!
I find the answers I was looking for.
If anyone ever asks themselves the same questions:
To clean old revisions when you have resolved conflicts in your tree:
You first need to purge the "losing revisions".
You can get them with the following (see the
?meta=true
):