Consider this scenario: I have a collection of large objects consisting of various attributes like ID, type, title, count, and more.
{
"id": "0165a74c-2545-40f7-9145-b95f5e5cb77e",
"type": 4,
"title": "My Title",
"delete": false,
"delete_reason": null,
"delete_time": "2019-12-05T16:17:15.313Z",
"count": 37765,
"sync": 1575672973,
"observe": 1575672949,
"updated": true,
"option": null
}
By using obj.filter(), I can selectively filter the objects based on their type 'n'.
However, even after filtering, the resulting array still contains the entire large objects.
If I want to extract only the title and ID from these objects to create a new array, how can I achieve that?
[
{
"id": "0165a74c-2545-40f7-9145-b95f5e5cb77e",
"title": "My Title"
},
...
]
Is there a way to accomplish this using map reduce, or do I need to revert to using a for loop for this task?