Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2022

JsonReader does not accept ISODate()

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.2.0
    • Affects Version/s: 3.0.4
    • Component/s: BSON
    • Labels:
      None

      Hi

      The org.bson.json.JsonReader does not accept fields with ISODate() as content for a current date. Since this is possible in the shell and the JsonReader already accepts Date() as input it would be nice if ISODate() would share the same behaviour. Or am i missing something?

      In visitDateTimeConstructor() this case is already handled like this:

      JsonToken token = popToken();
      if (token.getType() == JsonTokenType.RIGHT_PAREN) {
                  return new Date().getTime();
              } 
      

      Thanks for looking into this!

            Assignee:
            ross@mongodb.com Ross Lawley
            Reporter:
            patricksuter Patrick Suter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: