Handle single document patch item limit of partial document updates
See original GitHub issueIs 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:
- Created 4 months ago
- Comments:7 (5 by maintainers)
Top GitHub Comments
Correct.
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.
@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.