aboutsummaryrefslogtreecommitdiff
path: root/models/users/user.schema.ts
blob: fd7d1e1f5a9c10bb7176ae143b3560b717456413 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { Document, Schema } from 'mongoose';

export interface User {
  name: string;
  avatarUrl?: string;
  age?: number;
}

export interface UserSchema extends Document, User {
  password: string;
}

export const userSchema = new Schema({
  name: String,
  password: String,
  avatarUrl: {
    type: String,
    required: false
  },
  age: {
    type: Number
  }
});