I am very new to nodejs and trying to create a registration API using nodejs, I search for it and got some code but the problem is developer is using MongoDB but I am using MYSQL. So my question is how to create a schema in MYSQL using nodejs, I got the code where developer created the schema in MongoDB.
Here is the code:
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const userSchema = new Schema({
email: String,
password: String,
});
module.exports = mongoose.model('user', userSchema, 'users');
Also Why we need schema in the first place can't I just create table in my database manually and Insert data using Insert Query.
Thanks.