[Vuejs]-Put method (with Axios on front-end Vue) changing wrong id

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.

Leave a comment