How can I get attachment on couchbase server via Java SDK for my system?


I want to get an attachment stored in Couchbase server into another system using Java API. I can access a document, using: couchdoc=bucket.get(id)

but I don’t know how to open a Stream or any other methods to get attachment data.
Here is a part of my document in Couchbase server with the attachment section:

"_attachments": {
“2119.jpg”: {
“content_type”: “image/jpg”,
“digest”: “sha1-pGSjuuUGjHv4Y1V7/jXut7VyVdI=”,
“length”: 929737,
“revpos”: 7,
“stub”: true

Example of accessing attachments through Sync Gateway with Java?

See the linked topic, as what you’re trying to do is not supported by Couchbase Mobile.