Skip to navigation
How to delete key or field from a batch of couchdb docs
29.10.14
#!/usr/bin/env python import os import sys from operator import itemgetter import json import re import couchdb class Delete_field(): def __init__(self): couch = couchdb.Server('http://user:pass@127.0.0.1:5984/') db = couch['language'] docs = db.view('get/all') ddocs = [] for i in docs: doc = db.get(i['id']) doc.pop("ru", None) print doc.keys() db.save(doc) if __name__ == "__main__": da = Delete_field()
Reply
Anonymous
Information Epoch 1732557818
Design for the future, because it will be here sooner than you think.
Home
Notebook
Contact us