Skip to content

_purge API for only old revisions #2959

Answered by H--o-l
H--o-l asked this question in Q&A
Discussion options

You must be logged in to vote

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):

$ curl -sSf "localhost:5984/database/document?meta=true"
{
  "_id": "document",
  "_rev": "30-a3dbf287d0d1ece7bbe8b784db603dc2",
...
  ],
  "_deleted_conflicts": [
    "29-3168b4b8cd02c25c6a0f6c34539b631d",
    "26-05786d423bfe1cbf82e3d6c73bf2e7c9",
    "23-34e3dfdc994ad000c64a21cd30049cb3",
    "20-5d9beef9eeb48ad773b00f04b9d14e38",
    "17-a9f7e63943620255a66e9629466c7e66",
    "14-740198ac11897c6b9f2e9ff768561273",
    "…

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@wohali
Comment options

wohali Jun 22, 2020
Collaborator

Comment options

You must be logged in to vote
2 replies
@wohali
Comment options

wohali Jun 23, 2020
Collaborator

@H--o-l
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by H--o-l
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants