我正在使用 Node.js、Express.js 和 Azure DocumentDB 开发 API。我能够使用以下命令成功注册存储过程:
var documentdb = require('documentdb').DocumentClient;
var client = new documentdb(/* endpoint URL */, { "masterKey": /* master key */ });
var dbLink = /* db self link */
var test = {
id: 'test',
body: function () {
__.response.setBody('Hello world.');
}
};
client.upsertStoredProcedure(dbLink, test, function (err, res) {
// save self link and rid to stored procedure object
test.link = res._self;
test.link = res._rid;
});
但是,当我尝试使用以下代码执行存储过程时:
client.executeStoredProcedure(test.link, function (err, res) {
console.log(err || res);
});
我收到 400 错误请求错误:执行函数时遇到异常。指定的输入之一无效。
我做错了什么?
最佳答案
@dwheib 在 separate thread 上解决了这个问题- 在此转发以供大家引用。
问题是数据库自链接 (test.link
) 中缺少尾部反斜杠。
关于node.js - 无法执行存储过程: 'One of the specified inputs is invalid.' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33489482/