I want to update my schema without one object.
When i updated my schema the req.body automaticly updating schema with $set. But i want to prevent update all schema. For example req.body can include user role and this case i don't want to update user role.
User.findOneAndUpdate(
{ _id: req.user._id },
{ $set: req.body },
{ new: true, runValidators: true },
)
So i want to update all body without role object in user schema.