Is there any operator to achieve what the following map tries to do?
this.http.get(this.url)
.pipe(map(data => {
let results: object[] = new Array();
data.forEach(function(d) {
let result = d['a'];
result['new_index'] = d['b'];
results.push(result);
}
retrun results;
}));
d['a'] is an object while d['b'] is a string. The new_index key is new to each result.
Basically the original data contains quite a few fields out of which I only want 2 fields, one being the actual data of the object type, and the other an ID like field. I do not need any other fields. And I need to pull out that object data and insert the ID field into that object.