Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/470.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在服务器脚本中从另一个表中选择数据?WindowsAzure_Javascript_Azure_Azure Storage_Azure Mobile Services - Fatal编程技术网

Javascript 如何在服务器脚本中从另一个表中选择数据?WindowsAzure

Javascript 如何在服务器脚本中从另一个表中选择数据?WindowsAzure,javascript,azure,azure-storage,azure-mobile-services,Javascript,Azure,Azure Storage,Azure Mobile Services,我在WindowsAzure移动服务公司工作。我得到了两个表计划1:N订阅(一个计划与多个订阅相关,一个订阅与一个计划相关)。我不太熟悉JS服务器脚本。当我插入一个新的Subscripton时,我需要查询这个新的子描述拥有的计划(planId来自subscription对象中的客户端)。所以我有这个: function insert(item, user, request) { var planTable = tables.getTable("Plan"); //Here I

我在WindowsAzure移动服务公司工作。我得到了两个表计划1:N订阅(一个计划与多个订阅相关,一个订阅与一个计划相关)。我不太熟悉JS服务器脚本。当我插入一个新的Subscripton时,我需要查询这个新的子描述拥有的计划(planId来自subscription对象中的客户端)。所以我有这个:

function insert(item, user, request) 
{
    var planTable = tables.getTable("Plan");
    //Here I want to select the plan from planTable using item.PlanId

    request.execute();
}
您可以这样做(提供官方文档):

您可以这样做(提供官方文档):


你可以在上的博客文章中找到这个场景的解释。它包含了一些例子,对Sandrino Di Mattia的答案进行了扩展。

你可以在以下网址的博客文章中找到这个场景的解释。它包含的例子扩展了Sandrino Di Mattia的答案

 planTable.where({
        id: item.PlanId
    }).read({
        success: function(results) {
            // Do something here!
            request.execute();
        }
    });