role.model.ts 288 Bytes
Newer Older
Yoon, Daeki's avatar
Yoon, Daeki committed
1
2
3
4
5
6
7
import { model, Schema } from "mongoose";

interface IRole {
  name: string;
  priority: number;
}

Yoon, Daeki's avatar
Yoon, Daeki committed
8
9
10
11
12
13
14
const schema = new Schema<IRole>(
  {
    name: { type: String },
    priority: { type: Number },
  },
  { toJSON: { versionKey: false } }
);
Yoon, Daeki's avatar
Yoon, Daeki committed
15
16

export default model<IRole>("Role", schema);