Created
October 22, 2019 23:18
-
-
Save adsonrocha/8594f67154a0f6520de4f450a6bea04d to your computer and use it in GitHub Desktop.
Mongoose User Model and Interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as mongoose from 'mongoose'; | |
export const UserSchema = new mongoose.Schema({ | |
name: { type: String, required: true }, | |
age: { type: Number, required: true }, | |
active: { type: Boolean, required: true }, | |
}); | |
export interface User { | |
id: string; | |
name: string; | |
age: number; | |
active: boolean; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment