Q: mongoose .pre hook for update but it shows there's nothing like that Here after lots of stuggle i'm finally able to check the name exist but now if person is editing some existing doc and edited name it should check in db for exiting name throw error that name exist.
here is logic for save and I want same logic at updating the document. 
Note: I am using react in front end, and this code is added on the API service call
company_model.companySchema.pre('save', function (next) {
                                try {
                                    cModel.find({ name: this.name }, function (err, docs) {
                                        try {
                                            if (!docs.length) {
                                                next();
                                            } else {
                                                console.log('company name exists: ', this.name);
                                                next(new Error("Company Name exists!"));
                                            }
                                        } catch (e) {
                                            console.error('error in cModel.find: ' + e.message)
                                        }
                                    });
                                } catch (e) {
                                    console.error('error in pre save : ' + e.message)
                                }
                            });

