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

returnOriginal option in findOneAndUpdate unnecessarily differs from returnNewDocument option in shell

    XMLWordPrintable

    Details

    • Type: Question
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Done
    • Affects Version/s: 2.2.25
    • Fix Version/s: None
    • Component/s: MongoDB 3.2, MongoDB 3.4
    • Labels:
      None

      Description

      It is very easy as a developer to make the mistake of thinking documentation for the MongoDB shell applies to the node driver because many methods are so similar between the two.

      Imagine my surprise and confusion on finding that returnNewDocument doesn't work in the node driver, and I have to use returnOriginal instead, which takes the opposite value.

      I think most developers would try to minimize mismatch between the node API/shell if they could start from scratch. Consistency in naming helps everyone.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              christkv Christian Amor Kvalheim
              Reporter:
              jedwards1211 James Edwards
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: