我正在尝试使用 python-couchdb 在数据库的“_security”文档中添加一个用户。我收到一个错误,因为“_security”文档没有“_id”属性。
import couchdb
couch=couchdb.Server("http://admin:admin@localhost:5984")
couch["db"]["_security"]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/couchdb/client.py", line 977, in __repr__
return '<%s %r@%r %r>' % (type(self).__name__, self.id, self.rev,
File "/usr/local/lib/python2.7/dist-packages/couchdb/client.py", line 987, in id
return self['_id']
KeyError: '_id'