Couchbase Mobile doesn’t support use of the regular Couchbase Java SDK because it adds it’s own metadata for attachments. This is covered in the documentation.
I think you’re looking for a code example of using the Sync Gateway REST interface to get to the document+attachment. Moving this to a linked topic in the other category.
In fact I am getting this image from Android in Couchbase Lite, then replicate that using Sync Gateway to Couchbase Server sync_gateway bucket and move that to my “shadow” bucket, which I try to access from external system and get that image. In my “shadow” bucket I see the document with that section: