role.model.ts 302 Bytes
Newer Older
1
2
3
4
5
6
7
import { model, Schema } from "mongoose";

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

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

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