I am currently trying to build a swap query for my database, i currently have the following: db.customers.findOneAndUpdate(
{
name
},
{
currentCustomer: swapCustomerId,
$push: {
que: currentCustomerId
},
$pull:{
que : swapCustomerId
}
}, {
new: true
})
Executing this query gives me the following error : Cannot update 'que' and 'que' at the same time
.
I have read about Bulk writes, but i cant find a way to access a specific document to edit with it ?
Any ideas on how to solve this would be greatly appreciated.