Lets say I have a few fields that I don't want modified. In my case my users can utilize a PATCH request which invokes this method:
Ad.findByIdAndUpdate(req.params.id, req.body, {new: true})
Technically I can "manually" filter the "req.body" object and remove everything that should not be updated even if they specifically send those fields in the request, but is there a better way, perhaps, adding a "protected" flag in the relevant schema something like this:
title: {
type: String,
required: true,
protected: true
}