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

add some convenient methods for BinData and UUID

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.9.1
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      MongoDB shell version: 1.9.1-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

      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)

            Assignee:
            antoine Antoine Girbal
            Reporter:
            antoine Antoine Girbal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: