0

I am using couchdb, and I am running the following code with the following packages (nano & Bluebird)

nano = nano(uri)
var db_name = Promise.promisifyAll(nano.db.use(resources.db.name))

exports.db_init = function () {
    return new Promise(function (resolve, reject) {
        var temp_doc = {'Hello' : 'World'}
        db_name.insertAsync(temp_doc)
            .then(function (body) {
                return db_name.destroyAsync(body.id, body.rev)
            })
            .then(function (body) {
                resolve(body)
            })
            .catch(function (err) {
                reject(err)
            })
    })
}

When I call the above function, I see the body in the console, however when I view it in futon, the db gets deleted. Am I doing something wrong?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189

0 Answers0