/* * @author gs * @date 2020/07/21 16:08 * @modified-user songxiwen * @modified-date 2020/08/04 14:09 * @modified-description add phone prop */ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { Document } from 'mongoose'; import { MongoDBCollection } from '../../../constant'; @Schema({ collection: MongoDBCollection.User }) export class User extends Document { @Prop() name?: string; @Prop() age?: number; @Prop({ index: true }) phone?: string; @Prop({ index: true }) email?: string; @Prop() type?: string; @Prop() password?: string; @Prop() boundToWeChat?: boolean; @Prop() wechatOpenId?: string; @Prop() isActive?: boolean; @Prop() isForbidden?: boolean; } export const userSchema = SchemaFactory.createForClass(User);