I want to create a username from the user's email, first name, and the last name entered. I am using NodeJs and Sequelize. I want to make it unique by continuously checking the database. How can I achieve this?
CodePudding user response:
There can be multiple ways to achieve the solution of your problem .One way to achieve is you can use timestamp in conjunction with email, first name, and the last name.
CodePudding user response:
There are many ways to achieve this.
One way to create pre and post-middleware.
Way use timestamp.
In the schema data field added.
{ timestamps: true }