dewmyth-auth-nestjs-mongo
Version:
1. Install the package
19 lines (13 loc) • 400 B
text/typescript
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { HydratedDocument } from 'mongoose';
export type UserDocument = HydratedDocument<User>;
()
export class User {
()
username: string;
({ required: true })
email: string;
({ required: true })
password: string;
}
export const UserSchema = SchemaFactory.createForClass(User);