findOne and findOneAndUpdate when query has undefined value

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Critical - P2
    • 2.0.44
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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:
            Christian Amor Kvalheim
            Reporter:
            Laura Doktorova
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: