Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Get count of records purged #4964

Answered by nickva
rummitta asked this question in Q&A
Discussion options

We are trying to purge records in couch db. Please let us know how to know the count of records purged. Attaching the power shell script snippet that we are using to purge.
PurgeRecords.txt
Couch db version used is v3.3.2

You must be logged in to vote

I don't understand powershell but there are a couple of ways you can estimate the number of documents purged.

First of all you can inspect the response of the purge request. Most purge request interactive, assuming your cluster nodes are all connected at the time it was made. The response of the purge request will look like "purged": { $doc: [$rev, ...]} if the revs and or docs were not found it won't be returned as "purged"

If you're purging the whole document (the only revision) then you can use the doc_count field in the db info response and check the count before and after the purge request and the difference would be the number of documents purged.

There is also the couchdb.document_...

Replies: 1 comment 1 reply

Comment options

I don't understand powershell but there are a couple of ways you can estimate the number of documents purged.

First of all you can inspect the response of the purge request. Most purge request interactive, assuming your cluster nodes are all connected at the time it was made. The response of the purge request will look like "purged": { $doc: [$rev, ...]} if the revs and or docs were not found it won't be returned as "purged"

If you're purging the whole document (the only revision) then you can use the doc_count field in the db info response and check the count before and after the purge request and the difference would be the number of documents purged.

There is also the couchdb.document_purges metrics that you can check. For example: http $DB/_node/_local/_stats/couchdb/document_purges but that only return the number of processed purges, even if the document or revision(s) where not found.

You must be logged in to vote
1 reply
Comment options

thanks @nickva "$DB/_node/_local/_stats/couchdb/document_purges" - seems to be working for us

Answer selected by rummitta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /