如何调试Azure Cosmos DB存储过程? [英] How to debug Azure Cosmos DB Stored Procedures?

查看:129
本文介绍了如何调试Azure Cosmos DB存储过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Azure Cosmos DB,我正在使用C#编写客户端(Web服务),我正在使用java脚本编写一些服务器端存储过程。

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?

谢谢,

MAK

推荐答案

Azure Cosmos DB存储过程是在服务器上运行的JS脚本,你无法在你身边调试它。

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

但是,您可以使用 console.log()来记录存储过程中的一些关键步骤,如下所示。

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

然后使用 getScriptLog 获取存储过程的输出 console.log()州议员ts。

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

请注意,打印console.log需要 EnableScriptLogging = true

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);

你可以参考这个官方文档

希望它可以帮到你。

这篇关于如何调试Azure Cosmos DB存储过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆