'Converting an extended JSON document to mongo shell format
MongoDB can output data in Extended JSON format. For example, in relaxed mode, a date is represented as:
{"my_date_field": {"$date": "2000-01-23T01:23:45.678+00:00"}}
But, to my knowledge, the legacy mongo shell cannot parse extended JSON, supporting a different format instead:
{"my_date_field": ISODate("2000-01-23T01:23:45.678+00:00")}
Is there a CLI app to convert from extended JSON to mongo shell format? Or is it possible to parse extended JSON from the legacy mongo shell? (I'm aware that mongoimport and the newer mongosh already support extended JSON natively.)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
