0👍
✅
The first parameter of findOneAndUpdate
should be a filter, not just an id.
Something like:
Registro.findOneAndUpdate({_id: req.params.id}, ...
The way you have it currently will match all documents and just update the first one.
Source:stackexchange.com