War es wirklich?

  • login
  • kontakt
Startseite › Weblogs › cs's blog

How to remove corrupted documents from CouchDB

Once a corrupted document is written to CouchDB it's not completely straightforward how to get it out again. Having such a document in the DB can bring the replication to a grinding halt, for example.
Futon will throw an error if you try to display the document and you won't get to delete it.

Assuming you know the ID here is an example of how to delete the document:

curl http://localhost:5984/mydbname/_all_docs | grep MYDOCID

_all_docs will not try to get the corrupted content of the document but just its meta data,
that's why no error about invalid json is thrown in this case.
The resulting line will give you the latest revision ID that you need to delete the document.

curl -X DELETE http://localhost:5984/mydbname/MYDOCID?rev=MYREVID --user user:pass

See also:
http://tickets.opscode.com/browse/CHEF-2391

Trackback URL for this post:

http://ich.war-es-wirklich.net/trackback/451
  • CouchDB
  • Ich will das nie wieder suchen müssen
  • Englisch
  • cs's blog
  • Neuen Kommentar schreiben

Suchen

Themenwolke

Biologie Dokumentation Drupal Gesellschaft Git Ich will das nie wieder suchen müssen Internet IT IT-Sicherheit JavaScript jobpilot KDE Kryptographie Linux Mensch Monster MySQL Netzwerkzeug Open-Source-Software PHP Politik Psychologie Software Software-Entwicklung Spaß und Satire Tipps und Tricks Versionskontrolle Web-Entwicklung WTF Überwachung
Weitere Themen

OpenSource-Scores

Ohloh

Ohloh profile for cspitzlay

Drupal: Certified to rock

Yes I am
  • login
  • kontakt