API to read non-json documents in couchbase lite

So, the blog here explains how to create non json documents on the server side. After it gets sync’ed to couchbase lite, how can the non-json document be read?

The API public Document getDocument(String id) in the Database class returns a Document object. The Document object expects a key in all its APIs but obviously non-json documents doesn’t have a key.

APIs are available here

any inputs on this @priya.rajagopal . If you think you are not the right person, kindly let me know who should be tagged.

Your option for non-JSON data with couchbase lite is blob or binary attachments that are associated with a document. You’d have to create those through Sync Gateway attachments API.

@priya.rajagopal : Thanks for taking the time to respond and help us.

That’s a bummer. Our content creation happens mostly on the web and couchbase lite is mostly consumer only (ATM). Going through sync_gateway for creating just one type of content creates an overhead which is costly for us in the near and medium term and it also feels like a hack than a neat solution.

What’s on the Roadmap? Any plans to add support for binary attachments in couchbase server directly?

thanks for the awesome information.

Can you elaborate on the “overhead concerns” and “cost”? In fact most of time, I would expect documents and attachment being updated independently so having a separate HTTP call for managing attachments does not seem unreasonable - in fact thats why we have separate attachments API . If you really prefer, you can create documents via Sync Gateway REST endpoint as well. I agree that it is more convenient to have it unified, I am not sure I fully understand the concerns listed.

thanks my issue has been fixed.