I tried the POSTMAN api to update the user's email address via the PUT request but I get the following error
saying the _id already exists:
=====================================
{
"errors": {
"_id": "is already taken"
}
}
I believe the error is being triggered by the uniqueValidator(). I read on stackoverflow that if one uses
findOneAndUpdate() instead then the uniqueValidator is not invoked. However when I tried this I got an
error that one cannot modify the _id of an existing entry in the database (even though the _id is the same
value as before).
Anybody else encounter this error? Please advise.