节点函数会使用c#CosmosDB输入绑定吗? [英] Will node function use c# CosmosDB input binding?

查看:71
本文介绍了节点函数会使用c#CosmosDB输入绑定吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我要设置的host.json文件中:

In my host.json file I want to set:

"cosmosDB":{
 "connectionMode":"Direct",
 "protocol":"Tcp"
},

为了利用更高的性能,我将通过Direct模式获得CosmosDb.

in order to take advantage of the far higher performance I would get via Direct mode to CosmosDb.

但是,我想用javascript编写函数,然后调用绑定与数据库进行交互.如果这样做,我将获得直接模式的好处吗?我假设绑定仍然是c#,所以似乎这是可能的. 但是绑定会退回到javascript绑定对象吗?如果它确实与C#绑定进行通信,那么js =>会产生巨大的开销吗? c#?我认为跨对象内存障碍将远远小于我的收益 通过使用直接模式获得.

However, I want to write my function in javascript and then call the binding to interact with the database.  If I do this, will I get the benefit of Direct mode?  I assume that the binding is still c# so it would seem as though this is possible.  But will the binding fall back to a javascript binding object?  If it does communicate to a c# binding, is there tremendous overhead going from js => c#?  I would assume the cross object memory barrier would be far less than the benefit I would get by using Direct mode.

推荐答案

我们有使用Javascript进行CosmosDB绑定的示例

We have examples of CosmosDB bindings using Javascript

https://docs.microsoft .com/zh-CN/azure/azure-functions/functions-bindings-cosmosdb#trigger --- javascript-example

您可以详细说明这个主题吗?您是否看到任何错误?

Can you elaborate on this topic more? Are you seeing errors of any sort? 


这篇关于节点函数会使用c#CosmosDB输入绑定吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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