我在 .net 客户端上使用聚合的 storedproc lumenize https://github.com/lmaccherone/documentdb-lumenize时遇到问题。尝试将参数传递并查询到存储过程时出现错误。下面是我的代码
public async static void QuerySP() {
using (client = new DocumentClient(new Uri(endpointUrl), authorizationKey))
{
//Get the Database
var database = client.CreateDatabaseQuery().Where(db => db.Id == databaseId).ToArray().FirstOrDefault();
//Get the Document Collection
var collection = client.CreateDocumentCollectionQuery(database.SelfLink).Where(c => c.Id == collectionId).ToArray().FirstOrDefault();
StoredProcedure storedProc = client.CreateStoredProcedureQuery(collection.StoredProceduresLink).Where(sp => sp.Id == "cube").ToArray().FirstOrDefault();
dynamic result = await client.ExecuteStoredProcedureAsync<dynamic>(storedProc.SelfLink, "{cubeConfig: {groupBy: 'publication', field: 'pid', f: 'count'}, filterQuery: 'SELECT pid, publication FROM c'}");
Console.WriteLine("Result from script: {0}\r\n", result.Response);
}
}
执行代码时出现以下错误
消息:{“错误”:[“执行 Javascript 时遇到异常。异常 = 错误:需要 cubeConfig 或 savedCube\r\n堆栈跟踪:错误:需要 cubeConfig 或 savedCube\n at fn (cube.js:1803:7)\n在 __docDbMain (cube.js:1844:5)\n 在未知脚本代码 (cube.js:1:2)"]}
不知道我做错了什么。我非常感谢您的帮助。谢谢。