我正在尝试从沙发上获取数据,我遵循下面的代码
var request = require('request')
var nano = require('nano')('http://localhost:5984/user');
var url = 'http://127.77.3.1:5984/'
var db = 'users2/'
var id = 'document_id'
exports.insertdata = function (req, res) {
var data = req.body;
var item = {
name: data.name,
skills: data.skills,
experience: data.experience
};
nano.insert(item,(err, result) => {
if(!err){
//awesome
}if(result){
console.log(result)
response = {status:'success',data:result};
}
res.send(response);
});
};
exports.getdata = function (req, res) {
nano.getDoc('25f2b6d1e5b83887a42c74bc9b000647',(err, result) => {
if(!err){
//awesome
console.log(err)
}if(result){console.log(result)
console.log('inserted')
response = {status:'success',data:result};
}
res.send(response);
});
};
我收到以下错误
nano.getDoc is not a function
我正在尝试从沙发上获取数据,并且我按照上面的代码进行操作,但我不确定这些命令....谁能给我一些帮助....