Skip to content

Commit

Permalink
Schema for journal posts
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Apr 15, 2012
1 parent 1f8f689 commit 0049e01
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions post_schema.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
mongoose = require('mongoose')
mongoose.connect('mongodb://localhost/journal')

# Setup MongoDB schemas.
Schema = mongoose.Schema

PostSchema = new Schema (
title: String
body: String
created: { type: Date, index: true }
changed: { type: Date, index: true }
)

mongoose.model 'post', PostSchema

0 comments on commit 0049e01

Please sign in to comment.