Advertisement
Guest User

Untitled

a guest
Jan 18th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import * as mongoose from 'mongoose';
  2.  
  3. import Schema = mongoose.Schema;
  4. import Document = mongoose.Document;
  5.  
  6. var UserSchema = new Schema({
  7. name: String,
  8. password: String,
  9. email: String,
  10. head: String
  11. });
  12. // IUser只是单纯用来约束类型的,并没有什么作用
  13. export interface IUser extends Document {
  14. name: string;
  15. password: string;
  16. email: string;
  17. head: string;
  18. }
  19.  
  20. export var User = mongoose.model<IUser>("users", UserSchema);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement