0
我正在嘗試使用azure移動服務腳本過濾一些結果,但我在日誌中收到此錯誤。我傳遞給此函數的參數也顯示出來。使用azure移動服務腳本時出現javascript錯誤
錯誤 腳本'/table/Restaurant.read.js'中的錯誤。錯誤:傳遞給'查詢'的回調選項無效。回調選項必須是至少具有'function'類型的'success'或'error'屬性或'Array'類型的systemProperties屬性的對象。 (:7:11)在讀出 [外部代碼] 在:1:6 [外部代碼]
這是我的代碼
function read(query, user, request) {
var location=request.parameters.Location;
var category=request.parameters.Category;
console.log("location is"+location);
console.log("category is"+category);
var sql="SELECT * from restaurant where Location=? AND Category=?";
mssql.query(sql,[location],[category],{success:function(results){request.respond(statusCodes.Ok,results);}});
}