我对 CouchDB 很陌生,在尝试更新文档时遇到冲突错误。
>>> cachefile_db["ABC"] = {1:1}
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/couchdb/client.py", line 344, in __setitem__
status, headers, data = resource.put_json(body=content)
File "/usr/local/lib/python2.7/site-packages/couchdb/http.py", line 531, in put_json
**params)
File "/usr/local/lib/python2.7/site-packages/couchdb/http.py", line 546, in _request_json
headers=headers, **params)
File "/usr/local/lib/python2.7/site-packages/couchdb/http.py", line 542, in _request
credentials=self.credentials)
File "/usr/local/lib/python2.7/site-packages/couchdb/http.py", line 394, in request
raise ResourceConflict(error)
couchdb.http.ResourceConflict: (u'conflict', u'Document update conflict.')
我可以删除记录然后读取它,避免冲突错误的建议/最佳方法是什么?
谢谢,