Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-1631

Expose ErrDocumentTooLarge to caller from result of BulkWrite

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Error Handling
    • None

      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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            mikeo@mongodb.com Michael O'Brien
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: