javascript - Node.js azure-storage TableService 没有方法

标签 javascript node.js azure azure-storage

我一直在尝试连接到我的 Azure 存储帐户,但我在使用 azure-storage 模块时遇到一些问题。具体来说,一旦我创建了一个 TableService 对象,该对象就只有一个过滤方法。我尝试过的两种方法是 queryTables 和 createTableIfNotExist。例如,createTableIfNotExist 返回“TypeError:aztd.createTableIfNotExistis 不是函数”。源代码如下。

var azure = require('azure-storage');
var aztd = azure.createTableService();
var azseg = azure.TableUtilities.entityGenerator;
console.log("AZSEG " + Object.getOwnPropertyNames(azseg).filter(function (p) { return typeof azseg[p] === 'function'; }));
console.log("AZTD " + Object.getOwnPropertyNames(aztd).filter(function (p) { return typeof aztd[p] === 'function'; }));
aztd.createTableIfNotExist('table1', function (e, result, res) {
    if (result) console.log('Table created');
});

除了找不到函数之外,我没有收到任何其他错误。控制台日志返回两个变量的函数:

AZSEG Entity,Int32,Int64,Binary,Boolean,String,Guid,Double,DateTime
AZTD filter

我可以看到实体生成器创建得很好,但是我是否缺少 TableService 的任何内容?

最佳答案

实际上,函数名应该是createTableIfNotExists ,并且您似乎输入了无效的函数名称。

也可以引用azure-storage-node的源码在 github 上获取所有函数的信息。

关于javascript - Node.js azure-storage TableService 没有方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34518912/

相关文章:

node.js - npm -g 在 Windows Azure 远程服务器上安装 weinre

azure - 根据环境调整超媒体链接

c# - 如何防止 HttpWebRequest 因 Azure Web App 超时而响应过长

javascript - 如何去掉javascript中的注释?

node.js - 在node.js中如何检查特定的写入流是否打开

json - package.JSON 文件不完整?

Azure 服务器没有响应,但仪表板报告一切都在运行?

Javascript内联onclick转到本地 anchor

javascript - 在窗口调整大小时写入新文本大小的函数

javascript - 将 html div 传递给 ajax 调用