Created
February 2, 2012 19:33
-
-
Save akb/1725280 to your computer and use it in GitHub Desktop.
example mongoose model description
This file contains hidden or 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
| model 'User' | |
| name: {type: String, index: true} | |
| email: {type: String, index: true, unique: true} | |
| password: String | |
| model 'Post' | |
| title: String | |
| creator: {type: User.ObjectId, required: true} | |
| createdOn: {type: Date, required: true} | |
| mostRecentEditor: {type: User.ObjectId, required: true} | |
| mostRecentlyEditedOn: {type: Date, required: true} | |
| author: {type: String, trim: true} | |
| publishDate: Date | |
| publishStatus: | |
| type: String | |
| lowercase: true | |
| trim: true | |
| enum: ['under construction', 'pending approval', 'approved', 'published'] | |
| required: true | |
| default: 'under construction' | |
| content: HTMLDocument.ObjectId | |
| model 'HTMLDocument' | |
| title: | |
| type: String | |
| trim: true | |
| required: true | |
| default: 'Untitled' | |
| metadata: [HTMLMetaEntity] | |
| stylesheets: [String] | |
| scripts: [String] | |
| body: String | |
| model 'HTMLMetaEntity' | |
| name: {type: String, trim: true, required: true} | |
| content: String |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment