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

How to generate ObjectId's of 12 byte size

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: 2.1.1
    • Component/s: None
    • Environment:
      development

      I'm trying to generate objects where _id is only 12 byte but I keep creating the 24 byte "version" of this object.
      I'm using the following example code:
      >>> dummy =

      { '_id': ObjectId()}

      Executing this will result in the creation of a database object of 24 byte all the time.
      I've tried several different examples and get always the same 24 byte object. I've even create objects directly on the js console with the same result.

      Regards,
      N.

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            tid@norbertoleite.com Norberto Leite
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: