更新 Azure DocumentDB 中文档的一部分

Updating part of a Document in Azure DocumentDB

有没有办法更新 DocumentDB 集合中的部分文档?

我知道 ReplaceDocumentAsync 可以让您更新文档,但是您必须替换 整个 文档。这听起来有点吓人。如果我有一个嵌套了其他对象的对象,我将不得不查询父文档,然后替换整个文档以更新对象的嵌套部分。

DocumentDB 处理 ReplaceDocumentAsync 的方式是否使其性能比表面上看起来更好?

不幸的是,截至目前,这是不可能的。您可以在 Microsoft Azure User Voice 页面上对建议投赞成票。

http://feedback.azure.com/forums/263030-documentdb/suggestions/6693091-be-able-to-do-partial-updates-on-document

更多信息

Scott Guthrie 的博客:http://weblogs.asp.net/scottgu/azure-new-documentdb-nosql-service-new-search-service-new-sql-alwayson-vm-template-and-more

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/822d4b5c-13ce-4737-a1e9-6217851dfa9c/update-delete-parts-of-an-documentdb-object-graph-how-do-weak-relations-work?forum=AzureDocumentDB

这里是微软员工的评论,表示将在未来的更新中加入对部分文档更新的支持:

http://blogs.msdn.com/b/documentdb/archive/2014/08/22/introducing-azure-documentdb-microsoft-s-fully-managed-nosql-document-database-service.aspx