Hello,
When I create file attachments for couchbase documents I can give them a name. Is there a way I can use the metadata stored in the couchbase document to build a view/index to lookup the truth path of the attachment on disk from its given name alone? The metadata looks like something like this:
"_attachments" : {
"image-BF835EEF-0A86-47C1-B596-8A83389A5089.jpg" : {
"stub" : true,
"length" : 179287,
"digest" : "sha1-aVPI3e+uHklPwaICkX28ePAsWqQ=",
"revpos" : 2,
"content_type" : "image\/jpeg"
}
},
I want to create a view that emits the keys of the _attachments hash as the query key, and the value being the path on disk. However, I don't see the disk path anywhere. I read somewhere that the disk filename is the digest of the content. However, I can't find the relationship between "digest" and the disk filename (in this case: 6953C8DDEFAE1E494FC1A202917DBC78F02C5AA4.blob). I tried taking the hex value of "aVPI3e+uHklPwaICkX28ePAsWqQ=" but this isn't the same as the filename.
The greater context here is that I'm building a file provider extension where the goal is to abstract the storage details from other apps. I'd like to expose the attachments stored in couchbase as a flat list of files based on their given name.
Thanks,
Jeff