katoikia-app/servicio-foro-comunicaciones/src/schemas/post.schema.ts

22 lines
419 B
TypeScript
Raw Normal View History

import { Schema, Prop, SchemaFactory } from '@nestjs/mongoose';
import { Document, ObjectId } from 'mongoose';
export type PostDocument = Post & Document;
@Schema({ collection: 'posts' })
export class Post {
2022-07-25 04:38:48 +00:00
@Prop()
post: string;
2022-07-25 04:38:48 +00:00
@Prop()
date_entry: Date;
2022-07-25 04:38:48 +00:00
@Prop()
user_id: string;
2022-07-25 04:38:48 +00:00
@Prop()
community_id: string; // id de la comunidad
}
2022-07-25 04:38:48 +00:00
export const PostSchema = SchemaFactory.createForClass(Post);