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

Add 3.0 changelog entry about bson.int64.Int64

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 3.0.2
    • Affects Version/s: 3.0.1
    • Component/s: None
    • Labels:
      None
    • Environment:
      Ubuntu 14.10 64-bit. Python 2.7.3.
    • Minor Change

      [context: we are working to transition to pymongo 3 so that we can also upgrade to mongodb 3 so that we can get to WireTiger storage and document level locking.]

      When querying documents with pymongo 3.0.1 we are finding that fields with long values are being returned as bson.int64.Int64 instances, while in pymongo 2.7.2 they were returned as longs:

      pymongo 2.7.2:

      >>> type(table.find_one()['created'])
      <type 'long'>
      

      pymongo 3.0.1:

      >>> type(table.find_one()['created'])
      <class 'bson.int64.Int64'>
      

      So far we haven't found other data types that exhibit the same behavior:

      pymongo 2.7.2:

      >>> for k,v in sorted(table.find_one({'_id':'1003abf06db74d2991a23668a3510954'}).items()):
      ...   print k, v, type(v)
      
      _id 1003abf06db74d2991a23668a3510954 <type 'unicode'>
      boolVal True <type 'bool'>
      created 1430840397664 <type 'long'>
      dictVal {u'a': 1, u'c': 3, u'b': 2} <type 'dict'>
      floatVal 10 <type 'int'>
      intVal 5 <type 'int'>
      listVal [1, 2, 3] <type 'list'>
      noneVal None <type 'NoneType'>
      stringVal abc <type 'unicode'>
      

      pymongo 3.0.1:

      _id 1003abf06db74d2991a23668a3510954 <type 'unicode'>
      boolVal True <type 'bool'>
      created 1430840397664 <class 'bson.int64.Int64'>
      dictVal {u'a': 1, u'c': 3, u'b': 2} <type 'dict'>
      floatVal 10 <type 'int'>
      intVal 5 <type 'int'>
      listVal [1, 2, 3] <type 'list'>
      noneVal None <type 'NoneType'>
      stringVal abc <type 'unicode'>
      

      We are looking for either confirmation that this is intended behavior (and if so, if there are any workarounds we could implement at the pymongo layer rather than at the application layer) or if it's a bug.

      Please let me know if there is any additional info I can provide.
      Thanks!

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            dbrueck Dave Brueck
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: