12

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?

1 Answer 1

9

Unfortunately, as of now, this is not possible. You can vote up the suggestion on the Microsoft Azure User Voice page.

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

More Information

Scott Guthrie's Blog: 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

Here is a comment from a Microsoft employee, stating that support for partial document updates will be added in a future update:

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

Sign up to request clarification or add additional context in comments.

2 Comments

Still not available as of April 2017.
The user voice feature request has been updated on Mar 5, 2018: Azure Cosmos DB Team (Admin, Microsoft Azure) responded: We are actively working on this feature. .- Hurray

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.