This is my agg query :
db.users.aggregate([
{
‘$match’: {
‘lastLogin’: {
‘$gte’: []
}
}
},
{
‘$set’: {
‘lastLogin’: {
‘$first’: ‘$lastLogin’
}
}
}
] )
which results in a document showing the output i expect, but when querying the database in Atlas, the data isn’t mutated. So looking at your code, i need to use $set inside a update… does Aggregations have a update property?