Currently referencing files uploaded in a batch when creating / updating a document is tricky. e.g.:
for (var uploadedFilesIndex = 0; uploadedFilesIndex < uploadedFiles.blobs.length; uploadedFilesIndex++) { var currentFile = uploadedFiles.blobs[uploadedFilesIndex]; propertiesToUpdate['files:files'].push({ 'file': { 'upload-batch': currentFile.blob['upload-batch'], 'upload-fileId': currentFile.blob['fileIdx'] } }); } ...
=> The JS client should allow referencing a batch directly in a property. e.g.:
var propertiesToUpdate = { 'files:files': attachmentsBatch };