@nestjs/mongoose#Prop TypeScript Examples
The following examples show how to use
@nestjs/mongoose#Prop.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: user.schema.ts From nestjs-seeder with MIT License | 6 votes |
// You could get the previously generated value using the passed context.
@Factory((faker, ctx) => ({
first: faker.name.firstName(ctx.gender === 'male' ? 0 : 1),
last: faker.name.lastName(ctx.gender === 'male' ? 0 : 1),
}))
@Prop(
raw({
first: { type: String, required: true },
last: { type: String, required: true },
}),
)
name: Record<string, string>;
Example #2
Source File: users.schema.ts From nest-js-boilerplate with MIT License | 5 votes |
@Prop({
required: true,
unique: true,
type: String,
})
email: string = '';
Example #3
Source File: application.schema.ts From uniauth-backend with MIT License | 5 votes |
/** Application information */
@Prop({ required: true, unique: true })
name: string;
Example #4
Source File: announcement.schema.ts From edu-server with MIT License | 5 votes |
@Prop({ required: true })
title: string;