I have one big json document in collection like this:
{
"_id": {
"$oid": "5e7a50e7f1d41b3ea05aa46e"
},
"response": {
"count": 2,
"items": [
{
"id": 1,
"first_name": "Unknown",
"last_name": "Unknown",
"is_closed": false,
"can_access_closed": true,
"photo": "1.jpg",
"track_code": "d9e2ca2eG4GbHAQSwz8Ne4WBiVx"
},
{
"id": 2,
"first_name": "Lorem",
"last_name": "Ipsum",
"is_closed": false,
"can_access_closed": true,
"photo": "2.jpg",
"track_code": "23f1219a7j1xyWba69jz7p"
}
]
}
}
How I can split "items" by individual objects (for example by id in items) in the collection? As a result I want to have something like:
Object #1
{
"_id": {
"$oid": "5e7a50e7f1d41b3ea05aa46e"
},
"id": 1,
"first_name": "Unknown",
"last_name": "Unknown",
"is_closed": false,
"can_access_closed": true,
"photo": "1.jpg",
"track_code": "d9e2ca2eG4GbHAQSwz8Ne4WBiVx"
}
Object #2
{
"_id": {
"$oid": "ae2a40e7ffd41b3ea05aa46e"
},
"id": 2,
"first_name": "Lorem",
"last_name": "Ipsum",
"is_closed": false,
"can_access_closed": true,
"photo": "2.jpg",
"track_code": "23f1219a7j1xyWba69jz7p"
}
I can’t understand how to look for this in the documentation.