Closed Stwissel closed 8 years ago
You can access nano from your datasource.
var db = app.dataSources.{yourDatasourceName}.connector._nanoWriter;
You can then use the normal nano attachment functions
fs.readFile(file.path, function (err, data) {
if (err){
console.log(err);
}else{
db.attachment.insert(id,"image",data,'image/png',
{ rev: rev }, function(err,body){
if (!err) {
// process
} else {
console.log(err);
}
});
}; `
});
Brilliant. Thx for the sample. Would make a good addition to the documentation
Since it is modeled after nano it should|does (?) handle attachments. Is there an example for it? Or hints how to use