[GODRIVER-1631] Expose ErrDocumentTooLarge to caller from result of BulkWrite Created: 28/May/20  Updated: 30/Mar/22

Status: Backlog
Project: Go Driver
Component/s: Error Handling
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Michael O'Brien Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Use case:

We're using the bulk write API to apply a set of changes to a collection. The set of individual bulk updates are populated dynamically prior to sending the command.

It's possible that under extreme cases, one of the bulk items is larger than the max bson size, which results in the call to BulkWrite returning an error. Currently, the only way to confirm that the error is due to exceeding the size limit is by importing "go.mongodb.org/mongo-driver/x/mongo/driver" and comparing to ErrDocumentTooLarge. However, this is a code smell since it introduces dependency on parts of the non-public facing package API.

Ideally, it would be possible to confirm if the bulk write failed as a result of the size error without needing to involve internal packages.


Generated at Thu Feb 08 08:36:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.