Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as JavaScript by pkodw ( 2 years ago )
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import mongoose from 'mongoose';
import { User } from './User.Schema';
@Schema({ timestamps: true })
export class Post {
@Prop({ required: true })
title: string;
@Prop({ required: true })
contents: string;
@Prop({ type: mongoose.Schema.Types.ObjectId, ref: 'User' })
user: User;
}
export const PostSchema = SchemaFactory.createForClass(Post);
Revise this Paste
Parent: 127494