Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-1517

Extended JSON $date incorrectly parses integer literals

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.3.0
    • Component/s: JSON & ExtJSON
    • None

      The $date format requires a string or a $numberLong, but the driver incorrectly parses integer literals like the following:

      {"":{"$date":1}}
      0f0000000900010000000000000000
      
      {"":{"$date":-1}}
      0f0000000900ffffffffffffffff00
      

      N.B. floats do error:

      {"":{"$date":1.23}}
      unmarshal error: $date value should be string or object, but instead is double
      

            Assignee:
            divjot.arora@mongodb.com Divjot Arora (Inactive)
            Reporter:
            david.golden@mongodb.com David Golden
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: