javascript - Azure 上的 JavaScript 中的 SQL 查询

标签 javascript node.js api azure azure-mobile-services

我按照教程在 Azure 上编写了一个脚本,用于自定义 SQL 来检索一些数据: https://www.tapanila.net/windows-azure-mobile-services-custom-api-for-existing-sql-database/

我正在开发移动服务,并在 Azure 上使用“Easy API”。

编写此脚本时出现错误:

exports.get = function(request, response) {
    request.service.mssql.query(
        'select * from varegrupper', {
        success: function(results) {
            response.send(200, results);
        }
    });
};

这是我的错误:

{"error":"Cannot read property 'mssql' of undefined"}

知道我错过了什么吗?

最佳答案

移动服务(现已弃用)和移动应用程序之间存在显着差异。您尝试使用的 API 是移动服务 API,您在其中使用移动应用程序。您可以找到一个带有执行 SQL 语句的自定义 API 的示例项目 here 。您还可以找到一些引用文档here .

关于javascript - Azure 上的 JavaScript 中的 SQL 查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37850687/

相关文章:

image - 从 img 标签加载时,Google 静态 map API 收到 403 禁止

javascript - 设置 selectedindex 不触发 onchange 事件

javascript - 如何在 v8 中创建真正的全局对象?

javascript - tabBarOnPress 在 react native 的 react 导航选项卡中不起作用

api - 所有可能的酒店的 amadeus API 列表 "amenities"

api - Kubernetes POD的主机名为env

javascript - Chrome 开发者工具之外的 CSS 断点死区

node.js - AWS SES 未收到电子邮件

node.js - 使用 SequelizeJs 获取父类别对象

node.js - HTTP 响应字符串末尾的奇怪字符