Is it possible to flatten nested array object to single object.In my query i want to remove the source object and make the resultant object as one object (I have mentioned my output also).
var result = [
{"_id":"12345",
"_type":"feeds",
"_source":{
"title": "hi all solve it",
"link": "www.face.com",
"content": "Hi thewwewewedwe asdasdasdasd",
"createdAt": "2018-08-08T11:42:40.073Z",
"updatedAt": "2018-08-08T11:42:40.073Z",
"reply": []
}
}]
//resultant array
var newResult = [
{
"_id":"12345",
"_type":"feeds",
"title": "hi all solve it",
"link": "www.face.com",
"content": "Hi thewwewewedwe asdasdasdasd",
"createdAt": "2018-08-08T11:42:40.073Z",
"updatedAt": "2018-08-08T11:42:40.073Z",
"reply": []
}];