1const userSchema = mongoose.Schema(
2 {
3 email: String,
4 },
5 { timestamps: true }
6);
1const mongoose = require('mongoose');
2
3const UserSchema = new mongoose.Schema({
4 name: {
5 type: String,
6 required: true
7 }
8}, {
9 timestamps: true
10})
11
12const User = mongoose.model('User', UserSchema);
13
14module.exports = User;