gpt4 book ai didi

couchdb - CouchDB 附件的自定义属性

转载 作者:行者123 更新时间:2023-12-04 11:44:21 27 4
gpt4 key购买 nike

我试图在单个 CouchDB 文档中存储多个独立附件,并为每个附件分配任意属性(即描述)。是否有这样做的约定?据我所知,我无法将它们插入 _attachments直接构造。提前致谢!

最佳答案

您不能修改 _attachments 中的任何内容直接,因为它保留供 CouchDB 使用。但是,将任意属性存储在诸如 attachment_attributes 之类的成员中是非常合理的。 ,使用与 _attachments 相同的键(附件名称)。例如:

{
"_attachments": {
"foo.bar": ...,
"xxx.yyy": ...
},
"attachment_attributes": {
"foo.bar": {
"description": "blah blah"
},
"xxx.yyy": {
"description": "blah blah"
}
}
}

关于couchdb - CouchDB 附件的自定义属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4556839/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com