-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Native
-
None
-
Empty show more show less
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.