I’m using sync gateway to sync large document sets with attachments down to mobile which works find for test data sets i’ve created via the syncgateways bulk api.
For our application we need the documents to be created and edited via the web direct into couchbase server using the java sdk.
I’m able to create/edit documents direct in couchbase which get allocated to chanels in sync gateway and sync up to mobile, but cannot see how to create an attachment.
I cannot find anywhere in the documentation how i can create a binary asset in couchbase and associate it with a document so that its picked up as an attachment by the sync-gateway/couchbase-lite.
I know that i could write the document + attachments via the sync gateway but this does not seem write since everything else on the webapp is going via the sdk + n1ql etc.
Looking at the document + attachement created via sync-gateway via couchbase server looks like this.
Its not clear whether the binary is embedded in the document or stored separately.
e.g.
"_attachments": {
“photo.jpg”: {
“content_type”: “image/jpg”,
“digest”: “sha1-ee2gBR7WI0WNb+EVeM2nGeMUuzo=”,
“length”: 13161,
“revpos”: 1,
“stub”: true
}
}…