Skip to navigation
How to do a server side update on a couchdb doc by sending a dict with couchdb python
13.05.15
dicX = {'val':'Foo', 'key':'BAR'} r = self.db.update_doc('update/MYNAME',doc_id,data=dicX) in the design(server side update handler): { "_id": "_design/update", "updates": { "MYNAME": "function(doc, req) { var obj = eval (\"(\" + req.query.data + \")\"); var key = obj.key ; var val = obj.val ; doc[key] = val ; var message = 'set '+key+' to '+val; return [doc, message]; }" } }
https://pythonhosted.org/CouchDB/client.html?highlight=batch#
Reply
Anonymous
Information Epoch 1746854934
Worse is better.
Home
Notebook
Contact us