`ObjectID.isValid(<Integer>)` returns true

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Trivial - P5
    • None
    • Affects Version/s: 2.2.30
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      let ObjectID = require('mongodb').ObjectID;
      ObjectID.isValid(1)

      Expected:
      false - 1 is not a valid ObjectID

      Actual:
      true
      The same goes for any integer, isValid always returns true!

            Assignee:
            Daniel Aprahamian (Inactive)
            Reporter:
            Michael Yartsev
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: