CouchDB 附件的自定义属性
我试图在单个 CouchDB 文档中存储多个独立附件,并为每个附件分配任意属性(即描述)。有这样做的约定吗?据我所知,我无法将它们直接插入到 _attachments
结构中。提前致谢!
I am trying to store multiple standalone attachments in a single CouchDB document, and assign arbitrary attributes (i.e. description) to each one. Is there a convention for doing this? From what I can tell, I cannot insert them in the _attachments
structure directly. Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法直接修改
_attachments
中的任何内容,因为它是保留供 CouchDB 使用的。但是,使用与_attachments
(附件名称)中相同的键将任意属性存储在成员(例如attachment_attributes
)中是相当合理的。例如:You can't modify anything in
_attachments
directly as it is reserved for use by CouchDB. However, it would be quite reasonable to store arbitrary attributes in a member such asattachment_attributes
, using the same keys as in_attachments
(the attachment names). For example: