我在 node.js 模块中使用 azure-storage-node 包。我可以创建表和实体,但我看不到如何从存储容器中获取表列表。我该怎么做?
最佳答案
您需要调用listTablesSegmented
方法来列出表格。
var azure = require('azure-storage');
var tableSvc = azure.createTableService('account-name', 'account-key');
tableSvc.listTablesSegmented(null, function(error, result) {
if (!error) {
var entries = result.entries;
for (var i=0; i<entries.length; i++) {
console.log(entries[i]);//prints table name
}
}
});
关于node.js - 如何使用 Node.js 从 Azure 表存储获取表列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53174291/