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

findOneAndUpdate() behavior when a field is not present

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.1.8
    • Affects Version/s: None
    • Component/s: MongoDB 3.2
    • Labels:
    • Environment:
      linux

      I mistakenly did not give a field, but a string instead in ` col.findOneAndUpdate('56cd129222222', ...`

      Thinking the first index field would automatically be searched....

      This caused the behavior to treat it as a empty document, when it's not exactly empty...nor is it a document that is empty.

      The result was the first document being modified. This is confusing and I do not see a real life use case for this kind of behavior.

      I would like to request that nothing is returned when a non blank arg is given.

      ref http://stackoverflow.com/questions/35712746/mongodb-node-js-driver-findoneandupdate-behavior-without-a-field-given?noredirect=1#comment59102797_35712746

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            dman777 Darin Hensley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: