Ok I've done it this way and now I am having issues with the app syncing.
First here's an abbreviated example of the document
{
"Data": {
"Outlets": [
{
"Base64Logo": null,
"Building": "William G. Davis Computer Research Centre",
"DatesClosed": [
"2013-12-18T00:00:00"
]
etc......
},
etc......
]
},
"_attachments": {
"BA.gif": {
"content_type": "image/gif",
"digest": "sha1-VipoI8BiZUffggTtNW20B3FXSCc=",
"length": 3612,
"revpos": 2,
"stub": true
},
"browsers.gif": {
"content_type": "image/gif",
"digest": "sha1-RBEOHeqsRAXLmPUZqcZ4FmbN0/s=",
"length": 2262,
"revpos": 2,
"stub": true
},
etc......
}
"_sync": {
"rev": "2-6382d15b5661cccd94132c097657c880",
"sequence": 6,
"history": {
"revs": [
"1-34d94ce7897bbbcb5100f7696862062e",
"2-6382d15b5661cccd94132c097657c880"
],
"parents": [
-1,
0
],
"bodies": [
"",
""
],
"channels": [
null,
null
]
}
}
I'm inserting this stuff through the sync gateway REST API the same way I have been doing. I've had no issues at all until now adding attachments
I notice when I make the PUT, on the sync gateway terminal it goes into an endless stream of:
go-couchbase: TAP connection lost; reconnecting to bucket "iwaterloo" in 1s
This continues every second infinitely until I reboot the entire server. If I shut down sync gateway and restart it just immediately goes back into that. I need to shut the whole thing down to make it stop.
Second,
When I boot the app and try to sync, the gateway appears to be working fine and retrieving the docs as usual, but in the application output I'm getting the below for every document:
2013-11-28 17:15:06.388 iWaterloo[11591:80b] WARNING*** : Exception raised during -inTransaction: -[NSNull count]: unrecognized selector sent to instance 0x5376068
2013-11-28 17:15:06.388 iWaterloo[11591:80b] WARNING*** : CBL_Puller[http://....removed...] failed to write {diets #1-ce194927634a241f4107e6941f040c07}: status=594
So basically everything seems to be working fine, but the documents won't write locally on the simulator/device. Everything was working perfectly prior to using attachments.
I deleted the bucket completely and started fresh but got the same issue again.
I'm using the Xamarin version so perhaps the issue is with the bindings. Not sure.
Thanks