fileinfo.model.ts 425 Bytes
Newer Older
Lee Soobeom's avatar
Lee Soobeom committed
1
import { model, ObjectId, Schema } from "mongoose";
Kim, MinGyu's avatar
Kim, MinGyu committed
2

Lee Soobeom's avatar
Lee Soobeom committed
3
export interface IFileInfo {
Yoon, Daeki's avatar
Yoon, Daeki committed
4
5
6
  originalfilename: string;
  newfilename: string;
  picturepath: string;
Kim, MinGyu's avatar
Kim, MinGyu committed
7
8
9
  nickname?: string;
}

Lee Soobeom's avatar
Lee Soobeom committed
10
const schema = new Schema<IFileInfo>({
Kim, MinGyu's avatar
Kim, MinGyu committed
11
12
13
14
15
16
  originalfilename: { type: String, unique: true },
  newfilename: { type: String },
  nickname: { type: String },
  picturepath: { type: String },
});

Lee Soobeom's avatar
Lee Soobeom committed
17
export default model<IFileInfo>("FileInfo", schema);