I have a User
model containing two arrays of ObjectIds
followers
and requests
.
The following operation is an update performed on both these fields. It should remove all elements from requests
and push them into `followers
_id: req.user._id
},
[
{
$set: {
followers: {
$concatArrays: [
"$followers",
"$requests"
]
}
}
},
{
$set: {
requests: []
}
}
])
My qpplication has a requirement that states no element can be in both requests and followers at any given time
In the operation above, will there be any time during the update when there will be elements in both requests and followers, or will this never happen based on the code provided? Thanks