Is there a method to remove an item from an array with Mongoose? I have an array inside object like this:
"students": [ "5ad72254452996029415e49f", "5adaeb388acfc414d428820b" ]
And I'd like to remove one of them by identified value. This is my code :
Company.findById(id_company, function(err, company) {
var students = company.students; //students array
// ...
// ...
// ...
});
Students is an array, and I'd like to update and remove one of array element inside it by ID.