How to debug Azure Cosmos DB Stored Procedures?

后端 未结 1 699
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-30 04:52

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

1条回答
  •  孤独总比滥情好
    2020-12-30 05:20

    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.

    0 讨论(0)
提交回复
热议问题