问题标签 [azure-cosmosdb]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
5530 浏览

c# - 如何根据内部 json 对象值在 DocumentDB 中查询?

假设我在 DocumentDB 中有 3 个像这样的对象。

这是课堂记录。

现在我想获取一个名为 Sunny 的学生所在的所有 ID。

得到结果的查询是什么?

0 投票
1 回答
457 浏览

c# - 在 DocumentDB 中查询以进行搜索

我有一个类似的文件

标记可以包含任何主题和任何名称。(模式不固定)

我想要任何一门科目不及格的学生名单(任何科目<35)

有什么方法可以做到这一点或需要更改架构以获得结果?

任何帮助将不胜感激。

0 投票
1 回答
1138 浏览

stored-procedures - DocumentDB 从另一个存储过程或自身调用存储过程

有没有一种方法可以针对 DocumentDB 文档递归调用存储过程(或者甚至是 UDF,如果可以的话)?

我们有一个看起来像这样的文档:

只要我们有"items",该"items"数组就可以包含混合"type" : "item"和的条目"type" : "group"。的条目有一个需要求和"type" : "item"的简单字段。具有数组"value"的条目......等等。理论上,递归的级别没有限制,我承认这是一个问题,但在实践中,级别很少会低于 4 或 5 深。"type" : "group""items"

我正在尝试编写的伪代码如下所示:

这甚至可能吗?DocumentDB 是否支持从另一个 sproc 调用一个 sproc?sproc 可以调用自己吗?

我在网上找到了一些 DocumentDB 存储过程参考,包括thisthis以及thisthis以及许多其他页面。

如果可能的话,我想我可能不得不以某种方式查询集合以获取我想要调用的存储过程,然后以某种方式引用存储过程,而不是sumTotals()像使用独立语言那样直接调用。

我们刚刚开始研究使用 DocumentDB 进行编程,所以我们还不能完全确定我们可以用它做什么。感谢您提供任何帮助或建议。

0 投票
1 回答
7294 浏览

azure - Updating part of a Document in Azure DocumentDB

Is there a way to update part of a document in a DocumentDB collection?

I know that ReplaceDocumentAsync lets you update a document, but you have to replace the entire document. This sounds kind of scary. If I have an object that has other objects nested I will have to query for the parent document and then replace the entire document to update a nested part of the object.

Does DocumentDB handle ReplaceDocumentAsync in a way that makes it perform better than it might seem on the surface?

0 投票
3 回答
23330 浏览

c# - 如何通过c#代码删除DocumentDB中的所有文档

我正在使用 Microsoft 的一个名为 DocumentDB 的新数据库。现在我想按 ID 删除一个文档,但我不知道该怎么做。DocumentDB 中的删除操作需要自链接,它们与我自己的 id 不同。但是我查询一次文档,然后我会得到自我链接。使用该自我链接,我正在删除文档。

现在我想删除我收藏中大约 50000 多个文档的所有文档。

需要获取每个文档然后删除或任何简单的方法来做同样的事情?

有可能吗?

0 投票
1 回答
1517 浏览

azure - 为什么 Azure DocumentDB 有两个键(主键和辅助键)?

题目说明了一切……

为什么 Azure DocumentDB 有两个键(主键和辅助键)?

0 投票
1 回答
395 浏览

azure - 索引 DocumentDB 源时,如何解决 Azure 搜索上的 RequestRateTooLargeException?

我有一个包含大约 4,000 个文档的 DocumentDB 实例。我刚刚将 Azure 搜索配置为对其进行搜索和索引。这起初工作得很好。昨天我更新了文档和索引字段以及一个 UDF 来索引一个复杂的字段。现在索引器报告 DocumentDB 报告 RequestRateTooLargeException。有关该错误的文档建议限制调用,但似乎搜索需要这样做。有解决方法吗?

0 投票
1 回答
2547 浏览

json - 有人知道如何将 JSON 字符串保存到 DocumentDB 集合中吗?

我试图制作一个快速而肮脏的 NLog DocumentDB 目标,但似乎无法将 JSON 直接保存到 DocumentDB 中。

使用 C# 库似乎DocumentClient.CreateDocumentAsync()的文档参数只需要一个“复杂类型”,我看不到其他可能采用 JSON 字符串的方法。

还有其他人想出如何直接保存 JSON 吗?

0 投票
2 回答
4023 浏览

c# - Exception: Microsoft.Azure.Documents.RequestRateTooLargeException while querying from DocumentDB

y query is something like

This is the method for retry logic when requestRateTooLarge exception raise.

I am not sure, whether it is working fine or not,

I am getting Exception: Microsoft.Azure.Documents.RequestRateTooLargeException while querying and inserting around 4000 records at a time,

I used the same retry logic for inserting, its working fine. I am not getting any error and also successfully inserted all records but unable to get query data.

0 投票
1 回答
833 浏览

azure - UserDefined 函数在文档数据库中不再起作用

我正在使用 Microsoft Azure DocumentDB 客户端库来管理文档数据库。然而最近我所有的用户定义函数都停止工作了。为了测试功能,我尝试了这个简单的用户定义函数,

我可以使用创建用户定义的函数

但是,当我在我的 sql 查询中使用 udf 时,我收到一条错误消息

税收不是公认的内置功能。