node.js - 无法执行存储过程: 'One of the specified inputs is invalid.'

标签 node.js azure-cosmosdb

我正在使用 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/

相关文章:

Azure数据工厂: copying data from CosmosDB to SQL Database fails with "range-indexed" error

azure - 如何区分cosmosdb触发器中的delete update create到azure函数

azure - 如何使用 Azure DocumentDB 执行 UPSERT?

azure - 无法加载 DLL 'Microsoft.Azure.Documents.ServiceInterop.dll' [使用 Microsoft.Azure.DocumentDB 1.17.0]

javascript - 如何设置 Node 进程的时区?

javascript - 解析云代码如何与解析服务器一起工作?

ajax - 使用 Express 下载文件

node.js - 如何使用 node-forge 创建与 iOS 的多点连接兼容的 PKCS12?

javascript - Bot 为用户分配一个角色,即使用户没有自己的角色

c# - 如何在代码中将 Azure Cosmos DB Mongo API 的吞吐量设置为 10000 RU