Node.js, Sync Gateway, CBL: best way to transfer small files

Hello,

I’m trying to transfer some image files of thumbnails (one per CB document) to the iOS app that I’m writing.

I’m entering documents into my main bucket using the Node.js API, and the data gets synced to the iOS devices using the CB Sync Gateway and CBL.

I’ve seen that there are ways to add attachments to CB documents, or to save binary data as Base64-encoded strings.

I couldn’t find anything in the Node.js API that suggested that attachments are supported, so please give me some pointers.

What would be the best way to transfer small files to the iOS devices?

Cheers,
Florian

Update: I’ve seen that Connection.set(…) can take a value of type Buffer. Would that help me to achieve my goal?