getDbFiles(store, function(files){
require('ms-db').connect("DBname", function (db) {
db.collection('collectionName').find().toArray(function (err, data) {
console.log(data);
store = data;
})
});
getCdnFiles(store, function(files1) {
});});
我想调用这个getDbFiles func make查询,其结果应该可以通过getCdnFiles()访问,但它显示错误'store'未定义。所以请帮助我,如何实现这一目标使用节点JS和回调...卡住nodejs回调
理想的'store'没有被定义。那是你的整个代码吗? –
没有那不是整个代码,我不知道如何实现这个.. –
你必须把'getCdnFiles'放在创建'store'的回调中,以便'store'在那个时候存在。 – Ryan