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

UnorderedBulkOperation & OrderedBulkOperation missing 'length' property in Typescript definition

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      What problem are you facing?

      UnorderedBulkOperation and OrderedBulkOperation are missing the length property in the Typescript definitions. The property exists in Javascript (see here: https://github.com/mongodb/node-mongodb-native/blob/main/src/bulk/common.ts#L1302-L1307) but Typescript is unaware of it due to using `Object.defineProperty`.

       

      I use this property to determine if a bulk operation has operations. If it doesn't, I skip executing it.

            Assignee:
            Unassigned Unassigned
            Reporter:
            addisonelliott Addison Elliott
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: