如何在没有应用程序层的CouchDB中为每个新用户创建一个新数据库

我正面临着“如何在CouchDB中保密私人用户数据”的挑战.在couchdb维基上很详细:
http://wiki.apache.org/couchdb/PerDocumentAuthorization

我选择为每个用户创建一个新的数据库,因为这最适合我正在创建的应用程序,因为社区有很多建议去那条路.

我无法弄清楚如何做到这一点.在CouchDB中有没有内置的方法来做到这一点?到目前为止,我没有其他需要中间层或应用程序层,并希望保持这纯粹是沙发htmll5应用程序.对此最好的案例是什么?

最佳答案
new feature将添加对每个用户自动创建/删除数据库的支持.

以下部分将添加到default.ini和local.ini:

[couch_peruser]
; If enabled, couch_peruser ensures that a private per-user database
; exists for each document in _users. These databases are writable only
; by the corresponding user. Databases are in the following form:
; userdb-{hex encoded username}
enable = true

; If set to true and a user is deleted, the respective database gets
; deleted as well.
delete_dbs = true
点赞