Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import * as mongoose from 'mongoose';
- import Schema = mongoose.Schema;
- import Document = mongoose.Document;
- var UserSchema = new Schema({
- name: String,
- password: String,
- email: String,
- head: String
- });
- // IUser只是单纯用来约束类型的,并没有什么作用
- export interface IUser extends Document {
- name: string;
- password: string;
- email: string;
- head: string;
- }
- export var User = mongoose.model<IUser>("users", UserSchema);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement