[The same question but with better formatting is available here: http://stackoverflow.com/questions/23249293/sync-with-couchbase-lite-through-couchbase-sync-gateway-doesnt-see-any-document ]
I’m trying to sync a Couchbase bucket from the server to an iOS app using the Couchbase Sync Gateway and Couchbase Lite for iOS.
So far I’m working with the “beer-sample” example bucket that comes with Couchbase.
On my Ubuntu 12.04 LTS VM, the Couchbase Sync Gateway is started with this config file:
{
"interface":":4984",
"adminInterface":":4985",
"log":["REST"],
"databases":{
"sync_gateway":{
"server":"http://localhost:8091",
"bucket":"beer-sample",
"sync":`function(doc) {channel(["public"]);}`,
"users": {
"GUEST": {"disabled": false, "admin_channels": ["public"]}
}
}
}
}
My intention is to get it running without worrying about authentication first, therefore the GUEST user.
I’ve also modified some example to make sure the channel assignment is not dependent on the documents, because the sample bucket doesn’t have any channel assignment:
"sync":`function(doc) {channel(["public"]);}`,
I included some code from https://github.com/couchbaselabs/ToDoLite-iOS/blob/master/TodoLite7/CBLSyncManager.m into my own example project, and after a bit of trying the iOS can actually connect to the connector.
The NSLog in line 168 gives me this output:
[1026:60b] SYNCMGR: active=0; status=1; 0/0; (null)
[1026:60b] SYNCMGR: active=1; status=3; 0/0; (null)
[1026:60b] SYNCMGR: active=0; status=2; 0/0; (null)
…and my interpretation of that is that the syncing (of 0 documents) was working successfully.
Why does the Couchbase Sync Gateway not report any documents to the Couchbase Lite? I’m obviously missing something. I suspect the channels are not setup correctly.
Any help will be appreciated.