使用过程(查询sql)对表api azure中的记录进行计数

时间:2019-02-20 04:34:48

标签: azure azure-api-management

通过使用像sql这样的sql查询,我对表API azure中的所有记录计数都有问题。我尝试计算所有工作量,但我无法添加更多条件(例如@ Where @)进行计算。 这是我在表api中的查询 enter image description here

============================================

// SAMPLE STORED PROCEDURE

functionsample(prefix){     var collection = getContext()。getCollection();

// Query documents and take 1st item.
var isAccepted = collection.queryDocuments(
    collection.getSelfLink(),
    'SELECT Count(1) as rowkey FROM root r WHERE r.Name ="Name 01"',
function (err, feed, options) {
    if (err) throw err;

    // Check the feed and if empty, set the body to 'no docs found', 
    // else take 1st element from feed
    if (!feed || !feed.length) {
        var response = getContext().getResponse();
        response.setBody('no docs found');
    }
    else {
        var response = getContext().getResponse();
        var body = { prefix: prefix, feed: feed[0] };
        response.setBody(JSON.stringify(body));
    }
});

if (!isAccepted) throw new Error('The query was not accepted by the server.');

}

任何机构都想对Table API Azure中条件为@ where @的记录进行计数吗? 非常感谢!。

0 个答案:

没有答案