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

findOne and findOneAndUpdate when query has undefined value

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 2.0.44
    • Affects Version/s: None
    • Component/s: None

      db.collection.findOneAndUpdate(

      {uid:undefined}

      )
      causes an update of the random record.
      Instead, it should behave the same as
      db.collection.findOneAndUpdate(

      {uid:null}

      )
      which works as expected since there are no records with uid:null.

      Similar issue with db.collection.findOne(

      {uid: undefined}

      ) - returns result equivalent to db.collection.findOne({})

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            olado Laura Doktorova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: