【问题标题】:How do I get a list of tables from Azure Table Storage using Node.js?如何使用 Node.js 从 Azure 表存储中获取表列表?
【发布时间】:2019-04-09 23:41:32
【问题描述】:

我在 node.js 模块中使用 azure-storage-node 包。我可以创建表和实体,但我看不到如何从存储容器中获取表列表。我该怎么做?

【问题讨论】:

    标签: node.js azure azure-table-storage


    【解决方案1】:

    您需要调用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
        }
      }
    });
    

    【讨论】:

      猜你喜欢
      • 2017-05-12
      • 2019-11-25
      • 2014-08-29
      • 1970-01-01
      • 1970-01-01
      • 2012-09-30
      • 2013-09-04
      • 2016-04-01
      • 2021-02-03
      相关资源
      最近更新 更多