How to debug Azure Cosmos DB Stored Procedures?

不想你离开。 提交于 2019-12-30 03:05:07

问题


I am working with Azure Cosmos DB, I am programming the client side in C# (web service) and I'm writing some server side Stored Procedures with java-script.

How can I debug my stored procedure's code?

Thanks,

MAK


回答1:


Azure Cosmos DB stored procedure is JS script running on the server, you can not debug it on your side.

However , you can use console.log () to log some key steps in your stored procedure as below.

Then use getScriptLog to get the output from stored procedure console.log() statements.

Please note that EnableScriptLogging = true is necessary to print console.log:

var response = await client.ExecuteStoredProcedureAsync(
    document.SelfLink,
    new RequestOptions { EnableScriptLogging = true } );
Console.WriteLine(response.ScriptLog);

You could refer to this official doc.

Hope it helps you.



来源:https://stackoverflow.com/questions/47855094/how-to-debug-azure-cosmos-db-stored-procedures

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!