Search Posts

Category: mean

How to unset a field in Mongoose with findByIdAndUpdate [duplicate]

This question already has an answer here: Mongoose overwrite the document rather that `$set` fields 2 answers I use MEAN stack. On my backend I use findByIdAndUpdate function in Mongoose to do the update operation in CRUD. I also use Bootstrap UI date picker. On “clearing” of the date, uib-datepicker-popup resets the scope value for the date field to undefined. Now I pass the scope resource object into Mongoose with a HTTP PUT angular $resource […]