Javascript – How to break a promise chain during DB insertion if data is already present in DB?
I am using mongoose to create a new member entry in DB after checking if member is already present in DB or not. If member already present, I need to return a response otherwise proceed to insert new. Below is…