file.model.ts 298 Bytes
Newer Older
Yoon, Daeki's avatar
Yoon, Daeki committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { model, Schema } from "mongoose";

interface IFile {
  name: string;
  path: string;
}

const schema = new Schema<IFile>(
  {
    name: { type: String },
    path: { type: String },
  },
  { timestamps: true, toJSON: { versionKey: false } }
);

export default model<IFile>("File", schema);