In CBL android version, there is a method getBlob() on Database that fetches attachments like getBlob("_attachements.something"). On Swift side however I don’t find this method on Database. There is a blob(forKey:) method on Document class, but when I tried it on “_attachments” or “_attachments.something”, both returned nil. value(forKey:) on the same document returns both as DictionaryObject.
The attachments were created on the server side via Sync Gateway api
In CBL android version, there is a method getBlob() on Database
You mean Document, not Database, right? (Actually it’s on Dictionary, inherited by Document.)
blob(forKey:) is the equivalent method in Swift.
when I tried it on “_attachments” or “_attachments.something”, both returned nil.
The _attachments property of a document isn’t a blob; it’s a dictionary containing blobs.
_attachments.something is not a path to the something property of the _attachments dictionary; it refers to a property named literally _attachments.something. You need to get one property and then the other.
I expected the content of “somethingN” to be Blob instead of dictionary (not sure if it’s log printing thing or not). I just tested this yesterday and I didn’t see the issue.
Does this work on CBL Android 2.0? Are you using the master branch build of CBL iOS? If it works on Android but not iOS, would it be possible to pack a zip of database folder and post it somewhere for me to download and test?