Try the following:
function updateNota(req, res){
let notaId = req.params.notaId
let update = req.body
console.log(update)
Nota.findByIdAndUpdate(notaId, update, (err, notaUpdated) => {
if(err) return res.status(500).send({message: 'Error al actualizar la nota: ${err}'})
if(!notaUpdated) return res.status(500).send({message: 'No retornó objeto actualizado'})
res.status(200).send({ nota: notaUpdated })
})
}
Note that I added return in the if's, and that the if I added validates that the updated object returns to you. If you do not return the object, then it is not updating. By the way, as you have defined your model, when you update a document, you will return the document before updating or the updated document. The idea is that you return an object, if you do not return it is that the operation was not done.
But if it is returned to you, it means that it is updated. Enter the mongo console and do:
use 'mi-db'
db.micoleccion.find().pretty()
to see if it is modifying you. You only replace the values according to your DB and your collection. This is to avoid having to install a robomongo or mongobooster type program to consult your DB.
As I was saying, if you do not mark any error, it is that you update the doc with the same values, you can place this at the beginning of your function:
if (!req.body.campo1) return res.status(500).send({ message: 'No se recibió valor del campo1' })
This is valid if you are receiving the values to update.
Note1 : placing the return in the errors ifs is to finish executing the function, but it will continue executing the rest of the code and will give an error of "trying to send the return headers when they have already been sent "(you can not make more than one res.status ...)
Note2 : the return http codes, for good practices, should be according to the cause of them. Code 500 is "Unknown error" and that does not give enough information. See here for more.