-
Notifications
You must be signed in to change notification settings - Fork 1.1k
-
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
Beta Was this translation helpful? Give feedback.
All reactions
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
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
thanks @nickva "$DB/_node/_local/_stats/couchdb/document_purges" - seems to be working for us
Beta Was this translation helpful? Give feedback.