2015-12-29 25 views
1

我一直在嘗試連接到我的Azure存儲帳戶,但我在使用azure存儲模塊時遇到了一些問題。特別是,一旦我創建一個TableService對象,該對象只有一個過濾器方法。我試過的兩種方法是queryTables和createTableIfNotExist。例如,createTableIfNotExist返回「TypeError:aztd.createTableIfNotExistis不是函數」。源代碼如下。Node.js azure-storage TableService沒有方法

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 

我可以看到entityGenerator創建好的,但我錯過了TableService什麼?

回答

1

其實,函數名應該是createTableIfNotExists,看來你輸入一個無效的函數名。你

也可以指的azure-storage-node源代碼在GitHub上獲得所有功能的信息。

+0

絕對是這樣。具有諷刺意味的是,我測試的兩個功能都不正確。第二個鏈接真的很有用。我調整了它,一切都很好。 – jlindsey

相關問題