2012-02-28 53 views

回答

1

我不能真正理解你問什麼,所以假定插入附件到CouchDB的最常見的場景:

var db  = require('nano')('http://localhost:5984/test'); 
var request = require('request'); 

// {} for empty body as parameter is required but will be piped in 
request.get("http://nodejs.org/logo.png").pipe(
    db.attachment.insert("new", "logo.png", {}, "image/png")); 
相關問題