When dumping a database or collection with dates -at least on Mac OS X and from .NET gererated Output- all date-data-object are encodes as timestamps in the form:
{ when : { "$date" : 1234567890000 } } // an unqouted Long value
when I try to parse such an String with JSON.parse(), I either get an java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String, if this timestamp is an unquoted Long or silently a null, if it was an quoted Long as in '"1234567890"'. Requesting such object leads e.g. to:
{ "when" : null }
I'm quite astonished that nobody found nor fixed this issue so far, since it is even an internally used format.
I fixed this in JSONCallback.java by assuming first that the value is a parsable Long which can be turned into a Date-object. In case of an NumberFormatException ISODate is will be tried by applying defined SimpleDateFormat (Which is also no correct ISODate, since incomplete format. But this is another issue.)
See attached patch.