soft-delete-plugin-mongoose
Version:
a mongoose plugin that allows you to soft delete documents and restore them (for JS & TS)
14 lines (13 loc) • 416 B
TypeScript
import { Document, Types } from 'mongoose';
import { SoftDeleteModel } from '../../src/soft-delete-model';
export interface IComment extends Document {
content: string;
author: Types.ObjectId;
post: Types.ObjectId;
parentComment?: Types.ObjectId;
likes: number;
isEdited: boolean;
isDeleted: boolean;
deletedAt: Date | null;
}
export declare const Comment: SoftDeleteModel<IComment>;