无法执行存储过程:'One of the specified inputs is invalid.'
Cannot execute stored procedure: 'One of the specified inputs is invalid.'
我正在使用 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 Bad Request 错误:执行函数时遇到异常。指定的输入之一无效。
我做错了什么?
@dwheib 在 separate thread 上解决了这个问题 - 为了大家的利益在此处重新发布。
问题是数据库 self-link (test.link
) 中缺少尾随反斜杠。
我正在使用 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 Bad Request 错误:执行函数时遇到异常。指定的输入之一无效。
我做错了什么?
@dwheib 在 separate thread 上解决了这个问题 - 为了大家的利益在此处重新发布。
问题是数据库 self-link (test.link
) 中缺少尾随反斜杠。