Skip to content

Instantly share code, notes, and snippets.

@akb
Created February 2, 2012 19:33
Show Gist options
  • Select an option

  • Save akb/1725280 to your computer and use it in GitHub Desktop.

Select an option

Save akb/1725280 to your computer and use it in GitHub Desktop.
example mongoose model description
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