anyone of you can slove this problem the duplication of name to avoid and execute on postman api the codes are attached below
*employeemodel.jsenter image description here
*employeecontroller.jsenter image description here
*routes.jsenter image description here
I'm not sure if I understood your question correctly. But if you would like to prevent double names in your EmployeeModel, you can use Unique Indexes like
unique: truein youremployeemodel.js:On saving a new model with an existing name, in
employeeController.jsonawait employeeModelData.save()you will get an error, this will be caught with your try-catch.If you need further information and examples, you can take a look on: Understanding unique in Mongoose.