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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 2.7.2
    • Fix Version/s: 2.8, 3.0
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Minor Change
    • Sprint:
      Python Sprint 11

      Description

      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

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: