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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • 2.7.2
    • 2.8, 3.0
    • None
    • None
    • Minor Change

    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

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

            Dates

              Created:
              Updated:
              Resolved: