Hi @Takis,
Instead of using JSON.parse(), try using the implicit evaluation in mongosh or console.log(...). This should pretty-print including awareness of MongoDB extended JSON data types.
I created a quick test doc with arrays and objects based on the Atlas Sample Restaurants Dataset and all of the values appeared as I expected:
doc = {
"address": {
"building": "8825",
"coord": [-73.8803827, 40.7643124],
"street": "Astoria Boulevard",
"zipcode": "11369"
},
"borough": "Queens",
"cuisine": "American",
"grades": [ {
"date": new Date("2014-11-15T00:00:00.000Z"),
"grade": "Z",
"score": 38
},
{
"date": new Date("2012-02-10T00:00:00.000Z"),
"grade": "A",
"score": 13
}],
"name": "Brunos On The Boulevard",
"restaurant_id": "40356151"
}
If you are still seeing Object and Array, please provide:
- The output of
version()in your MongoDB Shell - A small sample doc to test with
Thanks,
Stennie