Hi Jens,

If I embed the attachments into the metadata as a data property, the JSON 
file could potentially get really huge. For example, I'm working with one 
import which is about 450 MB. Mostly it's because of the attachments which 
I store in a folder along side a data.json file. I've got them all bundled 
together into a package directory.

The data.json file itself is actually 96 MB. So if I stick the attachments 
in there too, it's going to get really huge, especially base64 encoded.

Is there any downside to the way I've done it above? I actually have that 
technique working, but I think it does mean I get an additional revision 
for each document.

Thanks,

Brendan

On Friday, April 1, 2016 at 1:45:23 PM UTC-6, Jens Alfke wrote:
>
> Hm, attachments. Good point. Internally, the way that method gets used is 
> that the attachment bodies are downloaded into the attachment store first, 
> and then when the revision is added (with the _attachments property intact) 
> they’re already there so the insert succeeds. But there’s no public API for 
> shoving attachments directly into the store (nor should there be.) 
>
> As a workaround for right now, you can preprocess the attachment metadata 
> to put the data inline:
> - remove the “follows” or “stub” properties
> - base64-encode the attachment body
> - add a “data” property whose value is the base64 string
> Then call putExistingRevision…
>
> I should come up with a better way to do this, though, before we release 
> this API. I filed #1195 
> <https://github.com/couchbase/couchbase-lite-ios/issues/1195>.
>
> —Jens
>

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/a74730b0-9880-4168-815a-8aec79d2920e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to