'How could I go about correcting this JSON code for nested objects
correcting this JSON code for nested objects i want correction json
{
"first_name": "John",
"last_name": "Parks",
"recipe_page":
{"shortbread":
"page_visit": [
"opened_on": ISODate("2020-01-23"),
"time_opened": "2022-21-03T13:49:51.141Z"
"time_closed": "2022-21-03T13:59:32.121Z"
]
}
}
Solution 1:[1]
Two things are wrong here:
- You cannot use ISODate or other functions in a JSON file.
- You have an array of objects but forgot to wrap each object in curly braces.
See below:
{
"first_name": "John",
"last_name": "Parks",
"recipe_page":
{"shortbread":
"page_visit": [
{"opened_on": "2020-01-23"},
{"time_opened": "2022-21-03T13:49:51.141Z"}
{"time_closed": "2022-21-03T13:59:32.121Z"}
]
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | iwk549 |
