diff --git a/src/models/post.model.ts b/src/models/post.model.ts index 061aacf9776ef2b3919aae80a3be3898a72b4ec9..2b07dd9e7e980fc5b0004bfd73efc94911339345 100644 --- a/src/models/post.model.ts +++ b/src/models/post.model.ts @@ -2,11 +2,11 @@ import { model, Schema, Types } from "mongoose"; export interface PostType { title: string; - text?: string; + text: string; theme: string; city: string; - user?: Types.ObjectId | string; - date?: Date; + user: Types.ObjectId | string; + date: Date; counts?: number; } @@ -35,6 +35,7 @@ const PostSchema = new Schema({ }, counts: { type: Number, + default: 0, }, });