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) • 387 B
TypeScript
import { Document, Types } from 'mongoose';
import { SoftDeleteModel } from '../../src/soft-delete-model';
export interface IPost extends Document {
title: string;
content: string;
author: Types.ObjectId;
tags: string[];
likes: number;
isPublished: boolean;
isDeleted: boolean;
deletedAt: Date | null;
}
export declare const Post: SoftDeleteModel<IPost>;