I am currently using the Couchbase Mobile solution to synchronize data from my Couchbase Server to my local computer.
I have no problem to synchronize my JSON documents from my Couchbase Server to my local device, however, the binary documents are never synchronized. It seems that the problem I have encoutered concerns about the Blob documents.
I read about storing blobs using Attachments, as it is specified here : http://developer.couchbase.com/mobile/develop/guides/couchbase-lite/native-api/attachment/index.html
The thing is that I can’t pull blobs from my server using the Sync Gateway.
I am using Couchbase Lite 1.0.4 (The Java library) and here is some of my project to synchronize my data using Sync Gateway :
Database db = null;
final Manager manager = new Manager(new JavaContext("data"), Manager.DEFAULT_OPTIONS);
db = manager.getDatabase("myDatabase");
final URL url = new URL("http://127.0.0.1:4984/myDatabase");
final Replication pull = db.createPullReplication(url);
I have tried many things such as adding parameter to the Replication object (ChangeListener, CountDownLatch)… no success.
I have no error message either on my Sync Gateway console or my Eclipse console. But none of my blob is synchronized to my Couchbase Lite.
The questions is as follows : Is it possible to pull binary documents from the server to Couchbase Lite using Sync Gateway?
I would look into upgrading with the 1.1 release of Couchbase Mobile first.
A good test is to check if you can load the attachment in the browser.
Also, this tutorial might help, it’s loading images from the Places API to SG and then in a Recycler View.
When you say “mydocwithattachments”, what am I supposed to specify exactly? As you know, in Couchbase Server, we do not have attachments but either JSON documents or Binary documents. There is not necessarily a link between a JSON doc and a Binary document. How a binary document could be associated to a JSON one.
So “mydocwithattachments” is a Binary document ID (of CouchbaseServer)?
@jamiltz, I would say the same thing, what attachment am I supposed to put in the GET request? And about the tutorial, I am not working on an Android project, but I checked the Java code lines about the pull replication, it’s quite the same things that I have.