apps/api/src/users/user.schema.ts
User Schema Class
Properties |
Type : string
|
Decorators :
@Prop()
|
Defined in apps/api/src/users/user.schema.ts:28
|
Email column |
gravatar |
Type : string
|
Decorators :
@Prop()
|
Defined in apps/api/src/users/user.schema.ts:34
|
Gravatar column (gravatar url) |
name |
Type : string
|
Decorators :
@Prop()
|
Defined in apps/api/src/users/user.schema.ts:22
|
Name column |
password |
Type : string
|
Decorators :
@Prop()
|
Defined in apps/api/src/users/user.schema.ts:46
|
Password column |
roles |
Type : UserRolesEnum[]
|
Decorators :
@Prop(['String'])
|
Defined in apps/api/src/users/user.schema.ts:40
|
Column to represent a one to many relationship with the roles entity |
username |
Type : string
|
Decorators :
@Prop()
|
Defined in apps/api/src/users/user.schema.ts:16
|
Username column |
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { UserRolesEnum } from '@starter/api-types';
import { Document } from 'mongoose';
export type UserDocument = User & Document;
/**
* User Schema Class
*/
@Schema()
export class User {
/**
* Username column
*/
@Prop()
username: string;
/**
* Name column
*/
@Prop()
name: string;
/**
* Email column
*/
@Prop()
email: string;
/**
* Gravatar column (gravatar url)
*/
@Prop()
gravatar: string;
/**
* Column to represent a one to many relationship with the roles entity
*/
@Prop([String])
roles: UserRolesEnum[];
/**
* Password column
*/
@Prop()
password: string;
}
export const UserSchema = SchemaFactory.createForClass(User);