I have below json data and want to update the value according to the condition
I have managed the things as below.
xxxxxxxxxx
let update = await UserDetails.findAndModify(
{ userId: 1, token: token },
[],
{$set: { isActive: 0 }},
{ new: true }
);
=> This query should update the last json collection key of isActive to 1. But it is not updating the values any how. What the things that I am doing wrong ? It is not throwing me any error as well to debug.