Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-2306

Driver module does not export `BulkWriteError`

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.5, 3.4.0
    • Affects Version/s: None
    • Component/s: Native
    • None

      I currently have a use-case where I need to check if thrown error is a `BulkWriteError`. Right now, the only way I can import this is by importing it 'mongodb/lib/bulk/common', but I would like to be able to import it from 'mongodb'

      Current behavior:

      import { ClientSession, Collection, BulkWriteResult, WriteError } from 'mongodb' 
      import { BulkWriteError } from 'mongodb/lib/bulk/common'

       

      Desired behavior:

      import { BulkWriteError, ClientSession, Collection, BulkWriteResult, WriteError } from 'mongodb'

       

      Additionally, the typescript definitions for the Node.js driver are missing BulkWriteError. Once the Node.js driver exposes BulkWriteError in the root module, I can open a PR on the type definitions to add BulkWriteError.

            Assignee:
            matt.broadstone@mongodb.com Matt Broadstone
            Reporter:
            adam.chelminski@mongodb.com Adam Chelminski (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: