fileinfo.model.ts 428 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 {
Kim, MinGyu's avatar
Kim, MinGyu committed
4
5
6
7
8
9
  originalfilename?: string;
  newfilename?: string;
  picturepath?: string;
  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);