question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Handle single document patch item limit of partial document updates

See original GitHub issue

Is your feature request related to a problem? Please describe. We spend a couple of hours today trying to figure out what was causing some of the errors we were seeing when patching certain documents. All the patch items in our patch failed and we received a cosmos 400 error with no subcode and no additional error message.

After much experimentation, we discovered this little line in the documentation: Single document patch: You can patch a single document based on its ID and the partition key. It's possible to execute multiple patch operations on a single document. The maximum limit is 10 operations.

This limit was our problem.

Describe the solution you’d like I’d like the SDK to protect me from sending more than 10 patch items. It knows I’m going to send more than 10, it can throw a warning in advance. “Sending more than 10 patch items is not supported”. A warning is probably better than a hard limit, because that would allow the limit to change maybe at some time in the future.

The serverside of course should definitely have a specific subcode when sending more than 10 patch items for this specific type, instead of throwing a 400 with 0 details.

Describe alternatives you’ve considered A clear and concise description of any alternative solutions or features you’ve considered.

Additional context Add any other context or screenshots about the feature request here.

Issue Analytics

  • State:closed
  • Created 4 months ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
hartmancommented, Jun 2, 2023

@hartman Are you by any chance using the client with Bulk mode enabled?

Correct.

In this case the SDK is not the right place to enforce this restriction, because it is a service restriction which might vary in the future.

If even a warning is too much, then I think at the very least there could be a mention of a limit in the function’s class documentation. Basically anything that brings attention to me that is closer to when I’m actually writing the code.

0reactions
msftbot[bot]commented, Jun 19, 2023

@hartman this issue requires more information for the team to be able to help. In case this information is available, please add it and re-open the Issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get started with Azure Cosmos DB Partial Document Update
There's a limit of 10 patch operations that can be added in a single patch specification. For more information, see Partial Document Update...
Read more >
Updating part of a Document in Azure DocumentDB
Here is a comment from a Microsoft employee, stating that support for partial document updates will be added in a future update:.
Read more >
How to Perform Single Document Patch Operations - RavenDB
The Patch operation is used to perform partial document updates with one trip to the server, instead of loading, modifying, and saving a...
Read more >
solrj api for partial document update
You can update parts of documents using the SOLR API's update endpoint curl 'https://solr-url/update?
Read more >
How to Perform Single Document Patch Operations - RavenDB
The Patch operation is used to perform partial document updates without having to load, modify, and save a full document. The whole operation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found