Hello,

I recently needed to modify a field in some documents in a CouchDB database. 
Since there were 26000+ of them I didn't want to edit them all via Futon, so I 
threw together a little Python script with the aid of Couchdbkit.

The code is here: http://gist.github.com/533964

Maybe someone else will find this useful.

The script currently loads all documents at once. For large numbers of 
documents to update you might need to add some form of pagination. Saving 
batches of docs to a temporary list and using bulk_save to send the updated 
docs to CouchDB might also speed up things. Anyway, the current naive approach 
worked fine for my 26000+ docs.

Nils.

De informatie vervat in deze  e-mail en meegezonden bijlagen is uitsluitend 
bedoeld voor gebruik door de geadresseerde en kan vertrouwelijke informatie 
bevatten. Openbaarmaking, vermenigvuldiging, verspreiding en/of verstrekking 
van deze informatie aan derden is voorbehouden aan geadresseerde. De VPRO staat 
niet in voor de juiste en volledige overbrenging van de inhoud van een 
verzonden e-mail, noch voor tijdige ontvangst daarvan.

Reply via email to