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

bson.json_util.loads does not recognize $timestamp in object_hook

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.8, 3.0
    • Affects Version/s: 2.7.2
    • Component/s: None
    • None
    • Minor Change

      bson.json_util.loads does not recognize and appropriately convert $timestamp in the object_hook to json.loads.

      A document fragment like the following throws an exception in bson.json_util.loads due to the field name starting with '$':

      {u'$timestamp': {u'i': 3, u't': 1416343293}}
      

      Instead, it should convert it to a bson.Timestamp.

      Here's the diff in my fork to be more clear about what I'm on about:
      https://github.com/jribnik/mongo-python-driver/commit/cb2ff1d08fc9ded7f350a1050a64d01394fc34d9

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            jacob.ribnik@mongodb.com Jacob Ribnik
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: