Recommendations for file storage?

What’s the current recommendation for the Node SDK and file storage?

My default plan (which I’d prefer not to do because I’m hoping there’s a better option) is to read a file, base64 encode the contents, and then split it out into chunks of 500kb or so, with one chunk in each document. I’d then have to write a bunch of code on the back to re-assemble those components in order into a decoded binary stream.

I read a great article on the couchbase site about BLOB storage (http://blog.couchbase.com/2016/january/storing-blobs-in-couchbase-for-content-management) but it was Java specific, and offered suggestions (like the use of the BinaryDocument object) which don’t appear to be an option in the Node SDK.

Hey @moxious,

You are actually able to directly store binary data into Couchbase Server with the Node.js SDK (none of the querying tools such as views, N1QL and FTS would work on that data though). To store binary data, simply read the file into a node Buffer object, split it so that it fits within a single document and then pass the buffer directly to one of the storage operations.

Cheers, Brett