Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-606

oid and binary types and python types

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      The python type() function for _id and binary types yield this (with a print):
      myBlob <class 'bson.binary.Binary'>
      _id <class 'bson.objectid.ObjectId'>

      I am sure I am just a python newbie but what do I have to do to use

      if isinstance(value, bson.objectid.ObjectId)

      import pymongo doesn't seem to fulfill the namespace and I am admittedly a little Java-heavy so my head's not in the right place
      P.S. isinstance(int) and long and datetime.datetime, etc. work great.

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            buzz.moschetti Buzz Moschetti
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: