below is my my mongo aggregation pipeline
[{
$match: {
email: {
$ne: null
},
current_landing: 'DASHBOARD'
}
}, {
$lookup: {
from: 'profile_recommendation_info',
localField: '_id',
foreignField: 'profile_id',
as: 'result'
}
}, {
$sort: {
'result.created_date': 1
}
}, {
$addFields: {
oldest_profile_recommendation_info_data: {
$arrayElemAt: [
'$result',
0
]
}
}
}, {
$set: {
oldest_profile_recommendation_info_id: '$oldest_profile_recommendation_info_data._id'
}
}, {
$unset: 'oldest_profile_recommendation_info_data'
}]
As seen in aove pipeline i am setting oldest_profile_recommendation_info_id with some values.I want to persist them in my data.But unable to do so