forked from UKSOURCE/ipv6
19 lines
440 B
TypeScript
19 lines
440 B
TypeScript
import mongoose, { Schema, Document } from "mongoose";
|
|
|
|
export interface IUser extends Document {
|
|
email: string;
|
|
password: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
}
|
|
|
|
const UserSchema: Schema = new Schema(
|
|
{
|
|
email: { type: String, required: true, unique: true },
|
|
password: { type: String, required: true },
|
|
},
|
|
{ timestamps: true }
|
|
);
|
|
|
|
export default mongoose.models.User || mongoose.model<IUser>("User", UserSchema);
|