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

Inconsistent typing in findOneAndDelete() result

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 3.6.0, 3.5.2
    • Component/s: None

      Using version 3.6.0 of the driver (and 3.5.2) in a typescript project, the result of the .findOneAndDelete() operation is of type FindAndModifyWriteOpResultObject that has a property .value that is typed as possibly undefined.

      When executing such function with a filter that does match no documents, what is returned in the .value property is null, not undefined as the typing suggests.

      Please change the typing so that it aligns with the runtime type of the .value property.

            Assignee:
            Unassigned Unassigned
            Reporter:
            danielgonnet@gmail.com Daniel González García
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: