Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-6633

Incorrect help text in shell -- o.isObjectId is not a function

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Trivial - P5 Trivial - P5
    • 2.3.0
    • 2.0.6
    • Shell
    • ALL

    Description

      The text displayed in the mongo shell for "help misc" gives incorrect syntax for the isObjectId property. It is shown as a function, but it is just a property.

      MongoDB shell version: 2.2.0-rc1-pre-
      > help misc
              b = new BinData(subtype,base64str)  create a BSON BinData value
              b.subtype()                         the BinData subtype (0..255)
              b.length()                          length of the BinData data in bytes
              b.hex()                             the data as a hex encoded string
              b.base64()                          the data as a base 64 encoded string
              b.toString()
       
              b = HexData(subtype,hexstr)         create a BSON BinData value from a hex string
              b = UUID(hexstr)                    create a BSON BinData value of UUID subtype
              b = MD5(hexstr)                     create a BSON BinData value of MD5 subtype
              "hexstr"                            string, sequence of hex characters (no 0x prefix)
       
              o = new ObjectId()                  create a new ObjectId
              o.getTimestamp()                    return timestamp derived from first 32 bits of the OID
              o.isObjectId()
              o.toString()
              o.equals(otherid)
       
              d = ISODate()                       like Date() but behaves more intuitively when used
              d = ISODate('YYYY-MM-DD hh:mm:ss')    without an explicit "new " prefix on construction
      > o = new ObjectId()
      ObjectId("5014000dd3f4f73f93ee6fb6")
      > o.isObjectId()
      Sat Jul 28 11:07:07 TypeError: o.isObjectId is not a function (shell):1
      > o.isObjectId
      true
      >

      Attachments

        Activity

          People

            sverch Shaun Verch
            tad Tad Marshall
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: