first commit
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||
|
||||
@Schema({ collection: 'users', timestamps: true, versionKey: false })
|
||||
export class UserDocument {
|
||||
@Prop({ type: String, required: true })
|
||||
_id!: string;
|
||||
|
||||
@Prop({ required: true })
|
||||
name!: string;
|
||||
|
||||
@Prop({ required: true, index: true })
|
||||
email!: string;
|
||||
|
||||
@Prop({ default: true })
|
||||
isActive!: boolean;
|
||||
}
|
||||
|
||||
export const UserSchema = SchemaFactory.createForClass(UserDocument);
|
||||
UserSchema.index({ name: 'text', email: 'text' });
|
||||
Reference in New Issue
Block a user