Как вставить текстовый файл в couchdb с помощью nodejs - PullRequest
0 голосов
/ 30 октября 2019

Я создаю текстовый файл, используя nodejs:

 fs.writeFile('file.txt',file, err => {
  if (err) {
    console.error(err)
    return
     }
  })

, затем я хочу сохранить этот файл в couchDb. Я пробовал:

couch.insertAttachment("databaseName", "document id", "attachment name", "attachment body", "doc revision").then(({data, headers, status}) => {
    // data is json response
    // headers is an object with all response headers
    // status is statusCode number
}, err => {
    // either request error occured
    // ...or err.code=EFIELDMISSING if either _id or _rev fields are missing
});

Но у меня это не работает, я думаю, что-то не так. и как я могу позже получить этот файл от couchDb?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...