Javascript Azure node.js脚本:类型错误:对象#<;查询>;没有方法';toQueryObject';
我正在尝试编写一个TodoItem.read.js方法,将Azure Mobile for iOS的示例TodoItem程序转换为使用表存储。我现在已成功插入项目,但尚未读取它们 下面是node.js抛出的错误: 脚本“/table/TodoItem.read.js”中出错。TypeError:对象#没有方法Javascript Azure node.js脚本:类型错误:对象#<;查询>;没有方法';toQueryObject';,javascript,node.js,azure,mobile,Javascript,Node.js,Azure,Mobile,我正在尝试编写一个TodoItem.read.js方法,将Azure Mobile for iOS的示例TodoItem程序转换为使用表存储。我现在已成功插入项目,但尚未读取它们 下面是node.js抛出的错误: 脚本“/table/TodoItem.read.js”中出错。TypeError:对象#没有方法 “toQueryObject” [外部代码] 阅读时(:12:14) 时间:1:6 [外部代码] 这是我的代码: var azure = require('azure-storage');
“toQueryObject” [外部代码] 阅读时(:12:14) 时间:1:6 [外部代码] 这是我的代码:
var azure = require('azure-storage');
var tableSvc = azure.createTableService();
var query = new azure.TableQuery()
.select()
.where('PartitionKey eq ?', 'learningazure');
function read(query, user, request) {
console.log('query: ', query);
tableSvc.queryEntities('TodoItem',query, null, function(error, result, response) {
if(!error) {
// query was successful
request.respond(200, result);
console.log('result: ', result);
console.log('response: ', response);
} else {
console.log('Error calling read()');
console.log(error);
}
});
}
我在这里遗漏了什么?看起来我的问题是我在创建
var query = new azure.TableQuery()
对象位于read()函数的外部。简单的回答是,我创建的query
对象不在范围内