Skip to content

Instantly share code, notes, and snippets.

@adsonrocha
Created October 22, 2019 23:18
Show Gist options
  • Save adsonrocha/8594f67154a0f6520de4f450a6bea04d to your computer and use it in GitHub Desktop.
Save adsonrocha/8594f67154a0f6520de4f450a6bea04d to your computer and use it in GitHub Desktop.
Mongoose User Model and Interface
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